[GE users] DRMAA vs. Tomcat

Daniel Templeton Dan.Templeton at Sun.COM
Mon Apr 10 22:29:29 BST 2006


    [ The following text is in the "ISO-8859-1" character set. ]
    [ Your display is set for the "ISO-8859-10" character set.  ]
    [ Some special characters may be displayed incorrectly. ]

Stefan,

The problem is that Tomcat is probably assigning a different classloader
for each application.  It does that so that it can automatically
reloaded the classes if the jar files get updated.  The JVM does not
allow classloaders to share libraries or libraries to be loaded more
than once.

It sounds like Axis is keeping a classloader per user or something
similar.  As long as you only have one concurrent user, I'm guessing you
don't run into the problem.

A simple solution might be to make a separate servlet that handles the
DRMAA calls and exports them to your web services.  That way, only one
classloader will try to access the library.

I'll dig around and see if I can find another solution.

Daniel

Stefan Metzlaff wrote On 04/10/06 23:20,:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Hi,
>
>I'm developing a drmaa application which should run on the tomcat
>application server with axis. The web front end accesses the application
>through web services (wsdl).
>The application works pretty fine, if it is started from command line.
>But if I'm using the web services the following error occurs frequently:
>
>java.lang.UnsatisfiedLinkError: Native Library
>/opt/SGE/lib/lx26-amd64/libdrmaa.so already loaded in another classloader
>java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1716)
>java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
>java.lang.Runtime.loadLibrary0(Runtime.java:822)
>java.lang.System.loadLibrary(System.java:992)
>com.sun.grid.drmaa.SessionImpl$1.run(SessionImpl.java:58)
>java.security.AccessController.doPrivileged(Native Method)
>com.sun.grid.drmaa.SessionImpl.(SessionImpl.java:56)
>com.sun.grid.drmaa.SessionFactoryImpl.getSession(SessionFactoryImpl.java:59)
>cef.VirtualJob.startDRMAAJob(VirtualJob.java:591)
>cef.VirtualBlastJob.startJob(VirtualBlastJob.java:212)
>cef.ClusterMaster.startNewJob(ClusterMaster.java:91)
>cef.BlastAllWebService.startNewJob(BlastAllWebService.java:47)
>org.apache.jsp.sampleBlastAllWebService.Result_jsp._jspService(Result_jsp.java:81)
>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
>javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
>org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
>org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
>javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>
>After this error every other drmaa web service call results the
>following error:
>
>java.lang.NoClassDefFoundError
>com.sun.grid.drmaa.SessionFactoryImpl.getSession(SessionFactoryImpl.java:59)
>cef.VirtualJob.startDRMAAJob(VirtualJob.java:591)
>cef.VirtualBlastJob.startJob(VirtualBlastJob.java:212)
>cef.ClusterMaster.startNewJob(ClusterMaster.java:91)
>cef.BlastAllWebService.startNewJob(BlastAllWebService.java:47)
>org.apache.jsp.sampleBlastAllWebService.Result_jsp._jspService(Result_jsp.java:81)
>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
>javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
>org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
>org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
>javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>
>After restarting the tomcat and the grid engine the application is
>working for some web service calls, until the UnsatisfiedLinkError occurs.
>
>I'm using the following environment:
>Linux
>SGE 6.0u4
>6.0u4 DRMAA.JAR
>jdk1.5.0_06
>Tomcat 5.5
>Axis 1.3
>
>I think something is going wrong the the factory.getSession() call, but
>I dont't know why. All my sessions are closed (via session.exit()) on
>exit of the application. So there should be no conflict with the drmaa
>library.
>Is it possible that tomcat tries to load the libdrmaa.so more than once,
>if one user calls different methods of the web service or multiple users
>using the web services?
>
>
>Best regards
>Stefan Metzlaff
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.4.1 (GNU/Linux)
>
>iD8DBQFEOswnmaoB5W5tYLoRAi9vAJ9Don+Bl5bGX2H1y8e8JMQ3Y87RowCgmnsH
>koNhpNla+1FSAWl9S1kf/+0=
>=7mD5
>-----END PGP SIGNATURE-----
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
>For additional commands, e-mail: users-help at gridengine.sunsource.net
>
>  
>

-- 
******************************************************
*         Daniel Templeton   UMPK18 x83749           *
*        Staff Engineer, Sun N1 Grid Engine          *
******************************************************
* "What's the sense in never thinkin' 'bout the tomb *
*  When you're much too busy returning to the womb?" *
*                  -They Might Be Giants             *
******************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
For additional commands, e-mail: users-help at gridengine.sunsource.net




More information about the gridengine-users mailing list