April 16, 2013

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 :

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

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: 
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 :    
java.net.MalformedURLException: unknown protocol:    
05:50:34,136 INFO  [STDOUT]

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

**** Error      
Error compiling page: /atg/dynamo/admin/en/performance-    
monitor.jhtml :
Taglib declaration specifies an invalid URI of     
java.net.MalformedURLException: unknown protocol:     
Taglib declaration specifies an invalid URI of    
java.net.MalformedURLException: unknown protocol:   
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 :


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