Jump to content
Excelsior Forums
Sign in to follow this  
pozole

xFunction + WebSphere

Recommended Posts

I have an web app that runs xFunction on WebSphere.

When I start the server, xFunction seems to be working ok. But when I call the xFunction again, the app throws the next error:

[11/11/03 17:43:45:185 CST] 37819d6a WebGroup      E SRVE0026E: [servlet Error]-[Native Library C:\WebSphere\AppServer\xFunction.dll already loaded in another classloader]: java.lang.UnsatisfiedLinkError: Native Library C:\WebSphere\AppServer\xFunction.dll already loaded in another classloader

     at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)

     at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1729)

     at java.lang.Runtime.loadLibrary0(Runtime.java:780)

     at java.lang.System.loadLibrary(System.java:865)

     at com.excelsior.xFunction.xFunction.<clinit>(xFunction.java:229)

     at com.cat.wis.cta.drivers.CTATimeAndDistance.getETE(CTATimeAndDistance.java:33)

     at org.apache.jsp._Itineraryview._jspService(_Itineraryview.java:694)

     at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)

     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

     at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)

     at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:598)

     at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:696)

     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

     at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)

     at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)

     at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)

     at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)

     at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:258)

     at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)

     at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)

     at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:872)

     at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:491)

     at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:173)

     at org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.java:1759)

     at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1596)

     at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)

     at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

     at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)

     at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)

     at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)

     at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)

     at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:258)

     at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)

     at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)

     at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:872)

     at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:491)

     at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:173)

     at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)

     at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:199)

     at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)

     at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)

     at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:331)

     at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)

     at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:432)

     at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:343)

     at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:592)

What is happening? Is xFunction trying to load the DLL twice?

Please help.

Pozole

Share this post


Link to post
Share on other sites

this is a feature of the Java 2 platform (not xFunction).

1. Native method DLL can be loaded only once

2. Classes using native methods can be loaded by ___the only one__ classloader.

In your case, xFunction was used from a class loaded by classloader A (therefore xFunction classes were loaded by classloader A too). Then, there was an attempt to use xFunction from another class loaded by classloader B but that's impossible by the Java specification).

Solution1: to use xFunction from within the only classloader namespace

Solution2: to arrange an appropriate delegation model between classloaders.

We are not familiar with WebSphere so it's up to you to investigate these possibilities.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×