ATG dynamosystemresource

You may have come across this “java.net.MalformedURLException: unknown protocol: dynamosystemresource” in your ATG Deployment and wondered what this is all about  .

The dynamosystemresource is a URL protocol offered by the Oracle ATG Web Commerce platform. This protocol can be used to refer to any file in the system CLASSPATH.Just as Nucleus makes components available through a Nucleus address relative to the Oracle ATG Web Commerce configuration path, the dynamosystemresource protocol makes files available through an address relative to the CLASSPATH.

For more info :
http://docs.oracle.com/cd/E24152_01/Platform.10-1/ATGPlatformProgGuide/html/s0204dynamosystemresource01.html

The dynamosystemresource implementation lies in a jar
protocol.jar in the <ATG10dir>DASlib

Its set in a lots of different startup scripts like like dynamoEnv.bat , startACC  etc

${JAVA_VM} -Xms96m -Xmx160m
  -Djava.security.policy=$DYNAMO_HOME/lib/java.policy
  -Djava.protocol.handler.pkgs=atg.net.www.protocol
  -Djava.naming.factory.url.pkgs=atg.jndi.url
${EXTRA_JAVA_ARGS}

ATG Deployment would have lots of issues if the protocol handlers are not set like some examples below :

1.Trying to expose a custom ATG Component as a JMX Bean :

Error /atg/management/MBeanRegistry ---       
java.net.MalformedURLException: unknown protocol: 
dynamosystemresource
at java.net.URL.(URL.java:574)
at java.net.URL.(URL.java:464)
at java.net.URL.(URL.java:413)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)

2.Trying to expose a ATG Component / Service as a REST Service using ATG’s REST Extensions

05:50:34,136 INFO  [STDOUT]
Unable to start service :     
/atg/rest/security/RestSecurityManager :    
atg.nucleus.ServiceException:
java.net.MalformedURLException: unknown protocol:    
dynamosystemresource
05:50:34,136 INFO  [STDOUT]

3.Unable to access the Dyn Admin’s performance-monitor page :

**** Error      
 /atg/dynamo/servlet/pagecompile/PageCompileServlet
Error compiling page: /atg/dynamo/admin/en/performance-    
monitor.jhtml :
javax.servlet.jsp.JspException:
Taglib declaration specifies an invalid URI of     
/atg/servlet/pagecompile/taglib/standard/JspTags.tld:
java.net.MalformedURLException: unknown protocol:     
dynamosystemresource
atg.servlet.pagecompile.PageCompileException:
javax.servlet.jsp.JspException:
Taglib declaration specifies an invalid URI of    
/atg/servlet/pagecompile/taglib/standard/JspTags.tld:
java.net.MalformedURLException: unknown protocol:   
dynamosystemresource
at atg.servlet.pagecompile.PageProcessor.outputServiceBody(PageProcessor.java:1663)
at atg.servlet.pagecompile.PageProcessor.outputJavaSource(PageProcessor.java:1322)

To check the protocol handlers set in system properties  in your ATG Deployment

1.Open up the DynAdmin console to point to http://localhost:8080/dyn/admin/nucleus/VMSystem/?op=listProperties

2.Look for the property : java.protocol.handler.pkgs

3.You should see the “atg.net.www.protocol” listed against the “java.protocol.handler.pkgs” property . In my ATG Deployment I have the following :

java.protocol.handler.pkg=org.jboss.net.protocol|atg.net.www.protocol|org.apache.axis.transport|com.sun.net.ssl.internal.www.protocol

4.If you are not able to access dyn admin pages then add the following snippet to a Java file or a scriptlet in JSP and print its value System.getProperty(“java.protocol.handler.pkgs”)

You should have the java.protocol.handler.pkgs set to  atg.net.www.protocol else you will get the java.net.MalformedURLException: unknown protocol: dynamosystemresource exception . If java.protocol.handler.pkgs is not set to  atg.net.www.protocol then it means that either :

  1. There is some application code that’s overriding this setting  to include its own protocol handler . Instead of correctly appending its protocol handler with the existing one its overwriting it .  In this case search for
    System.setProperty(“java.protocol.handler.pkgs”) Or “java.protocol.handler.pkgs” across your code base . You should most probably find some application code setting this manually but instead of appending to the existing property its overwriting it . The correct way to set this would be to read the property and append your new protocol handler and then set the combination . For example on my ATG Deployment the jboss , atg , axis protocol handlers are set by default and I have appended the sun ssl protocol handler to the end of it for PayPal related integration

    java.protocol.handler.pkgs = org.jboss.net.protocol|atg.net.www.protocol|org.apache.axis.transport|com.sun.net.ssl.internal.www.protocol
    
  2. As in the case of some situations and application servers you have to set the protocol handler packages manually .A good google search should lead you to a fix in this case 😉 .

Posted originally on April 16, 2013

Deepak

Read more posts by this author.