Created a Java application to upload documents via CIS (Content Integration Suite) to a storage application. The app runs successfully in RAD, but as a executable jar in a unix environment, getting a NoClassDefFoundError. I can not find the class on my local machine and there are not references to the class on the internet.
The manifest contains that class path for the needed jar files and the main class.
Can anyone help?
Fri Sep 04 16:47:25 EDT 2009 : StandardBatchApplication startup() completed.
java.lang.NoClassDefFoundError: com.stellent.cis.support.spring.ResourceHelper
at com.stellent.cis.common.classloader.IsolatedJarClassLoader$TemporaryF
at com.stellent.cis.common.classloader.IsolatedJarClassLoader$TemporaryF
at com.stellent.cis.common.classloader.IsolatedJarClassLoader$TemporaryF
at com.stellent.cis.common.classloader.IsolatedJarClassLoader.<clinit>(I
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:196)
at com.stellent.cis.impl.CISApplicationFactory.getCisClassloader(CISAppl
at com.stellent.cis.impl.CISApplicationFactory.getCisApplication(CISAppl
at com.stellent.cis.impl.CISApplicationFactory.initialize(CISApplication
at com.lowes.ipt.edi.processor.CISApp.initialize(CISApp.java:48)
at com.lowes.ipt.edi.processor.EDItoEDAMUploadProcessor.main(EDItoEDAMUp
Caused by: java.lang.ClassNotFoundException: com.stellent.cis.support.spring.Res
at java.net.URLClassLoader.findClass(URLClassLoader.java:496)
at java.lang.ClassLoader.loadClass(ClassLoader.java:631)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:597)
... 11 more
Update: There is only one jar file I have that deals with CIS. I have looked in the jar and there is no class within. I am unfamiliar with any other RAD default classes that have CIS classes. This is not only happening for this class but also for a class that is contained in the webservices.jar. I can see the class and it is part of my class path because when I remove the Jar from the path, it complains about another missing class. When I place it back in my path, it gets further in the program and gives the same error.
The missing class is probably in some JAR file that is installed on your local machine and not on the remote machine. Or more likely - it is installed in the remove machine in a different location then in your local machine (which is expected if the remote machine is a Unix machine and your local is a Windows box).
The classpath set in the MANIFEST.MF file in the JAR that you build must specify the classpath for finding all related JARs on the remote machine - you have to find where that JAR is installed and then add that path to the manifest classpath. JARs in Unix machines are often installed in /usr/share/java but I can't tell you more then that because I'm not familiar with CIS and I don't know what JAR files it normally distributes.
The issue was caused by the permissions on the tmp directory in UNIX. The CIS API uses the tmp directory to create and store needed files/classes for execution. Because I was running the process under my own ID, it was unable to access the tmp files that were created by the wsadmin. To resolve the issue, the process has to be ran as wsadmin.
Related
I am trying to set up On Demand Server in my local machine and when ever I am deploying the application on tomcat server I am getting below error message on browser. I have updated the PATH variable also.
root cause
java.lang.UnsatisfiedLinkError: ars3wapi32 (Not found in java.library.path)
java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1007)
java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:971)
java.lang.System.loadLibrary(System.java:470)
com.ibm.edms.od.ArsWWWInterface.<clinit>(ArsWWWInterface.java:15)
java.lang.J9VMInternals.initializeImpl(Native Method)
java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
com.ibm.edms.od.ODServer.<init>(ODServer.java:45)
com.ibm.edms.od.ODServer.<init>(ODServer.java:61)
com.uklife.web.ondemand.utils.DownloadUtils.getAFPDocumentFromOnDemand(DownloadUtils.java:80)
com.uklife.web.ondemand.utils.Utils.getDocument(Utils.java:288)
com.uklife.web.ondemand.servlet.OnDemandDocAccess.doGet(OnDemandDocAccess.java:81)
javax.servlet.http.HttpServlet.s`enter code here`ervice(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722
)
Here is a guide the solution (for Windows and OnDemand V9.5).
First of all, you need to install ODWEK on the machine where you want to run your java app. Please install in the default folder, this whole thing is tricky enough as it is...
Set the environment variable "PATH" in Windows, add "C:\Program Files\IBM\OnDemand\V9.5\bin"
Set CLASSPATH in your development environment - point out the ODApi.jar file and ALSO point "Native library..." to the \bin folder above. (You can also call the program and setting the CLASSPATH in the call as a parameter: -Djava.library.path="C:\Program Files\IBM\OnDemand\V9.5\www\api\ODapi.jar"
Copy the file ars3wapi64.dll from C:\Program Files\IBM\V9.5\www to C:\Program Files\IBM\OnDemand\V9.5\bin
Ensure that all of these files are in the bin-catalog above:
**ars3wapi64.dll**
icudt53.dll
icuin53.dll
icuio53.dll
icule53.dll
iculx53.dll
icuuc53.dll
arsgsk64.dll
If you are getting the error "java.lang.UnsatisfiedLinkError: ars3wapi32 (Not found in java.library.path)" one of the above is most likely incorrect.
OR you could be using different versions of ODWEK and OnDemand.
More on how to set CLASSPATH in Eclipse: How to set the java.library.path from Eclipse
I'm running script remotly through JUnit and I'm receiving.
exec(): 0509-036 Cannot load program /u01/app/gg/ggsci because of the following errors:
0509-150 Dependent module libclntsh.so could not be loaded.
0509-022 Cannot load module libclntsh.so.
0509-026 System error: A file or directory in the path name does not exist.
My script works great directly on machine. His body(lag_extract.sh):
cd /u01/app/gg
/u01/app/gg/ggsci << EOF
OBEY /u01/app/gg/lag_extract.txt
and my obey file (lag_extract.txt):
LAG EXTRACT *
JSCH version: org.apache.servicemix.bundles.jsch-0.1.44_1.jar
Oracle Golden Gate: 12.1.0.4.0
Any suggestions?
It was connected with lack of an system environments. Maybe it's a workaround, but I've just exporeted one missing system environment and now it works fine.
I have been trying to use a home grown test tool and after doing an update to Centos 6.4, I am no longer able to run the tcl based tool. I am getting the following error and I have no internet access on this server. Kindly advise how do I solve this problem?
Thanks
"XpUtils::iload -d /usr/local/testtool/repo/package/linux-glibc2.3-x86_64/lib/tcljava1.4.1 tclblend" failed:
couldn't load file "/usr/local/testtool/repo/package/linux-glibc2.3-x86_64/lib/tcljava1.4.1/libtclblend.so": libjava.so: cannot open shared object file: No such file or directory
while executing
"error "\"XpUtils::iload -d $dir tclblend\" failed:\n $errMsg""
(procedure "loadtclblend" line 168)
invoked from within
"loadtclblend /usr/local/testtool/repo/package/linux-glibc2.3-x86_64/lib/tcljava1.4.1"
("package ifneeded java 1.4.1" script)
invoked from within
"package require java"
("eval" body line 1)
invoked from within
"eval package require $pkg"
("foreach" body line 2)
invoked from within
"foreach pkg $pkgList {
set ::${pkg}Version [eval package require $pkg]
}"
(file "/usr/local/testtool/testtool" line 165)
If you read the error message trace, you'll see that it says that this is all caused by:
libjava.so: cannot open shared object file: No such file or directory
The first steps would then be to ensure that you've got a version of Java actually installed, to check that it includes the file libjava.so, and that the file has been indexed by the system shared library catalog.
It might also be worth checking that all its dependencies are also present and that you've got the architecture for the Tcl library and the Java library matched (e.g., both 32-bit) as those can cause odd failures when they go wrong.
I'm using Tomcat and PHP5 with JavaBridge. I have bridged PHP and Java so I can screencap web pages within PHP. This was working on another server but after moving to a new server I can not get it working, so I'm reaching for straws here.
require_once("http://localhost:8080/JavaBridge/java/Java.inc");
java_autoload("/web/sites/madfrog/domain.com/cron/bin/html2image.jar");
$JavaHTML2Image = new Java("com.elance.proposal.html2image.client.MainBridge");
It should have loaded all of the project html2image.jar when the script _autoloaded it, however when you create the new Java object I get the error
Class Not Found: Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: CreateInstance failed: new com.elance.proposal.html2image.client.MainBridge. Cause: java.lang.ClassNotFoundException: com.elance.proposal.html2image.client.MainBridge
I asked the guys over in Java and they said I needed to put the jar file in the lib so Java could find it, so I dumped it into Tomcat's webapps folder an into /usr/share/java. But that did nothing. With that said the PHP has a direct reference to it, so it should be loaded.
I'm at a lost after two days. any help is appreciated!
Which version of Tomcat do you use?
For Tomcat 6 or Tomcat 7 put the jar either in ${tomcat.home}/lib or in ${tomcat.home}/webapps/${your.war}/lib
While tomcat.home is your tomcat installation directory. And your.war is the name of your war file.
I am coding a RMI program with 3 JAR:
RMIServer, contains server-side classes
RMIClient contains client-side classes
RMIResource contains server & client shared content (interfaces, custom exceptions)
To make separate JAR files, I created 3 projects in NetBeans, then I declared the shared Jar in the "Libraries/Build" section of the other 2 projects.
Everything just build-up fine, no error.
But when I try to launch the server through the command-line, which was simple before I had the idea to put the shared files in a distinct JAR, this is suddenly pain in the a**...
Here are a few examples of commands I tried:
Keeping the ClassPath pointing to the server resources, but using dual CodeBase
java -cp ~/NetBeansProjects/RMIServer/dist/RMIServer.jar -Djava.rmi.server.codebase="file:/home/myuser/netbeansprojects/rmiserver/dist/rmiserver.jar file:/home/myuser/netbeansprojects/rmiserver/dist/lib/rmiresource.jar" rmiserver.Shop
Result:
Network exception: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: rmiresource.BookingManager
...
Using dual ClassPath but keeping the CodeBase pointing to the server resources
java -cp "~/NetBeansProjects/RMIServer/dist/RMIServer.jar;~/NetBeansProjects/RMIServer/dist/lib/RMIResource.jar" -Djava.rmi.server.codebase=file:/home/myuser/netbeansprojects/rmiserver/dist/rmiserver.jar rmiserver.Shop
Result:
Exception in thread "main" java.lang.NoClassDefFoundError: rmiserver/Shop
Caused by: java.lang.ClassNotFoundException: rmiserver.Shop
...
Using dual ClassPath & dual CodeBase
java -cp "~/NetBeansProjects/RMIServer/dist/RMIServer.jar;~/NetBeansProjects/RMIServer/dist/lib/RMIResource.jar" -Djava.rmi.server.codebase="file:/home/myuser/netbeansprojects/rmiserver/dist/rmiserver.jar file:/home/myuser/netbeansprojects/rmiserver/dist/lib/rmiresource.jar" rmiserver.Shop
Result:
Exception in thread "main" java.lang.NoClassDefFoundError: rmiserver/Shop
Caused by: java.lang.ClassNotFoundException: rmiserver.Shop
...
EDIT:
I am working on the local computer, simulating distant connections. Thus I use 'file' protocol and not 'http'.
Am I missing something? Thanks for any help you would provide
I tested out again my 1st solution since it was the most promising:
java -cp ~/NetBeansProjects/RMIServer/dist/RMIServer.jar -Djava.rmi.server.codebase="file:/home/myuser/netbeansprojects/rmiserver/dist/rmiserver.jar file:/home/myuser/netbeansprojects/rmiserver/dist/lib/rmiresource.jar" rmiserver.Shop
It still failed.
Then I tested out on Windows:
Setup the rmiregistry with an empty classpath (and cd to the java/bin directory)
set CLASSPATH=""; export CLASSPATH
start rmiregistry
Launch the server with an equal command as before (moduo the Win env changes)
java -cp c:/NetBeansProjects/RMIServer/dist/RMIServer.jar -Djava.rmi.server.codebase="file:/c:/netbeansprojects/rmiserver/dist/rmiserver.jar file:/c:/netbeansprojects/rmiserver/dist/lib/rmiresource.jar" rmiserver.Shop
And... It worked!
I cleaned-up/rebuilt the solution both on Linux & Windows and it is still not working on Linux and working on Windows... I use the same Netbeans version on both!
Can someone explain that to me? I am using the JDK 6 on Linux & JDK 7 on Windows: would that have an impact?
A file: codebase can't work out of the local machine. You need to use HTTP. You could possibly use a file: URL pointing to a shared directory, such that the URL makes sense at a client, but this won't work outside the LAN.
Unless you are using the codebase feature, the RMI Registry needs access to the shared classes via its classpath: rmiregistry -J-Dclasspath=... It's simpler to use LocateRegistry.createRegistry(), then it's in the same JVM as your remote objects and uses the same classpath of course.