Wednesday, 6 June 2012

HP SAN switch Java web start madness

The SAN switch over here, an HP Storageworks 4/8 SAN switch, can be configured through a webpage which presents a java web start application. Apparently this is such a thing that 'used to work' that suddenly doesn't work anymore. Read: the computer that was used during the setup of the switch - which happily executed the web start app - isn't around anymore. What the web app did do was presenting some security warnings which could be clicked away with some yes/no clicking. After the warnings, a nice interface would appear, devoid of any useful information about the SAN switch. It still displayed some fancy flashing lights on a visualization of the switch though.

In the Java console, the following error popped up:

javax.xml.bind.JAXBException: Provider com.sun.xml.bind.ContextFactory_1_0_1 could not be instantiated: javax.xml.bind.JAXBException
 - with linked exception:
[java.security.AccessControlException: access denied ("javax.xml.bind.JAXBPermission" "setDatatypeConverter")]
 - with linked exception:
[javax.xml.bind.JAXBException
 - with linked exception:
[java.security.AccessControlException: access denied ("javax.xml.bind.JAXBPermission" "setDatatypeConverter")]]
at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
at javax.xml.bind.ContextFinder.find(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at com.brocade.tm.xslt.XSLTTransport.<init>(XSLTTransport.java:42)
at com.brocade.tm.TransportFactory.makeTransport(TransportFactory.java:32)
at com.brocade.tm.TransportFactory.getTransport(TransportFactory.java:25)
at com.brocade.pm.framework.MainPanel.enableProgressIndication(MainPanel.java:831)
at com.brocade.pm.ezmgr.EZManager.initMainPanel(EZManager.java:195)
at com.brocade.pm.ezmgr.EZManager.runApplication(EZManager.java:425)
at com.brocade.pm.ezmgr.EZManager.initApplication(EZManager.java:401)
at com.brocade.pm.ezmgr.EZManager.main(EZManager.java:447)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
etc ...

Hmm. Permission stuff. The JNLP file, which coordinates the web start procedure, contains the following magic lines:

<security>
<all-permissions/>
</security>

Looking good, but it clearly was not good enough. After some head scratching, googling and pixel staring, I guessed that the Java warning at the start - The application contains both signed and unsigned code. Contact the bla bla bla to bla. - might actually have a purpose; to read and interpret it. The obvious solution would have been to fix the signing issue. However, I don't know how to fix that. The second solution is to explicitly state that the web app is allowed to 'set the datatype converter', something that wasn't really working according to the Java log. In my home directory (Windows in this case), I created a file named .java.policy with the following contents:

grant codeBase "http://<ip address of the SAN switch>/-" {  
permission javax.xml.bind.JAXBPermission "setDatatypeConverter";
};


Fixed :)

1 comment: