Hi, my program talks to DB2 on mainframe and retrieves data. It was working before. Suddenly it stopped working and showing following error in log file. (My Web server is NES and JRun): I required files exists on the server. 08Jun2001 15:35:09 java.sql.SQLException: java.lang.UnsatisfiedLinkError: no db2jdbc in shared library path at COM.ibm.db2.jdbc.app.DB2Driver.<init>(Compiled Code) at cat.cis.register.server.DB2DataAccess.<clinit>(DB2DataAccess.java:32) at cat.cis.register.server.servlet.ErrorReportingServlet.<clinit>(ErrorReportingServlet.java:41) at java.lang.ClassLoader.findSystemClass(Compiled Code) at com.livesoftware.jrun.JRunServletLoader.loadClass(Compiled Code) at com.livesoftware.jrun.JRunServletLoader.getServlet(Compiled Code) at com.livesoftware.jrun.JRunServletLoader.loadServlet(Compiled Code) at com.livesoftware.jrun.JRun.getServlet(Compiled Code) at com.livesoftware.jrun.JRun.getServlet(Compiled Code) at com.livesoftware.jrun.JRun.runServlet(Compiled Code) at com.livesoftware.jrun.JRunGeneric.handleConnection(Compiled Code) at com.livesoftware.jrun.JRunGeneric.handleProxyConnection(Compiled Code) at com.livesoftware.jrun.service.proxy.JRunProxyServiceHandler.handleRequest(Compiled Code) at com.livesoftware.jrun.service.ThreadConfigHandler.run(Compiled Code) 08Jun2001 15:36:42 java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.doConnect(Compiled Code) at java.net.PlainSocketImpl.connectToAddress(Compiled Code) at java.net.PlainSocketImpl.connect(Compiled Code) at java.net.Socket.<init>(Compiled Code) at java.net.Socket.<init>(Compiled Code) at sun.net.NetworkClient.doConnect(Compiled Code) at sun.net.www.http.HttpClient.openServer(Compiled Code) at sun.net.www.http.HttpClient.openServer(Compiled Code) at sun.net.www.http.HttpClient.<init>(Compiled Code) at sun.net.www.http.HttpClient.<init>(Compiled Code) at sun.net.www.http.HttpClient.New(Compiled Code) at sun.net.www.protocol.http.HttpURLConnection.connect(Compiled Code) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Compiled Code) at java.net.URL.openStream(Compiled Code) at cat.cis.register.server.DB2DataAccessUpdateThread.run(Compiled Code)
The UnsatisfiedLinkError occurs when the JVM cannot find a native language definition of a method that was declared native in a Java class. The problem is usually fixed by making sure that the shared library or DLL is in the PATH of the JVM. Things don't just start breaking. If it worked at one time then something or someone has changed either a path of a library file and the JVM is no longer able to load everything required to run properly. I struggled with a similar problem using IBM's Websphere Application Server when I had a servlet that was attempting to use a JNI class. I finally wrapped the JNI class with RMI and made a server out of it. Sometimes the problems are with the tools we use or misuse of the tools we use. I never did go back and figure out what the actual problem was. Due to time constraints I decided to move on the alternative architecture despite the probable degredation to performance. I'd recommend turning on verbose mode and trying to identify exactly which class or library is failing to load and then double check that the native file is in the PATH (not CLASSPATH) of the JVM. Good Luck.
Hi, This happens when you have conflicting versions of JDBC classes available for the application.Run the usejdbc2.bat under ..\SQLLIB\java12 directory and add the db2java.zip to your classpath.Restart the serlvet engine to picl up the latest classpath.It will work. Good luck, Narendra Kamaraju