Google Gruplar, artık yeni Usenet gönderilerini veya aboneliklerini desteklememektedir. Geçmişteki içerikler görüntülenebilir kalmaya devam edecek.

ClassNotFoundException with moving to WAS 6.1

6 görüntüleme
İlk okunmamış mesaja atla

cald...@churchmutual.com

okunmadı,
31 Ağu 2007 16:59:0031.08.2007
alıcı
Hello,

We have an iSeries system (I believe it is V5R4). We have WAS 5.0.2.18 installed on it with several apps. We recently installed WAS 6.1.0.7 on the same system and are in the process of migrating our apps over to run on it. The apps that we have inside of WAS run fine so far. We are having issues with our apps that run outside of WAS and attempt to make a connection to WAS to place messages on queues, etc.

We have an application called "propagation" which is one of these apps. We kick off the app using a QShell script, which is set up as follows for WAS 5.0:
../initEnvironment

/QIBM/ProdData/WebAS5/Base/bin/setupClient -instance $WASENVIRONMENT

export LIB_DIR=3rdparty
export COMPONENTS_DIR=lib

export COMPONENTS=$COMPONENTS_DIR/cmic-propagation-properties.jar:$COMPONENTS_DIR/cmic-propagation.jar:$COMPONENTS_DIR/rulesengine-dummy.jar:$COMPONENTS_DIR/cmic-base.jar:$COMPONENTS_DIR/systemx.jar:$COMPONENTS_DIR/messaging.jar:$COMPONENTS_DIR/systemx-server-tools.jar:$COMPONENTS_DIR/cmic-persistence.jar:$COMPONENTS_DIR/cmic-database.jar

export LIST1=$LIB_DIR/arch4j.jar:$LIB_DIR/jt400.jar:$LIB_DIR/log4j.jar:$LIB_DIR/castor-0.9.5.2.jar:$LIB_DIR/cmic-utilities.jar:$LIB_DIR/commons-cli-1.0.jar
export LIST2=$LIB_DIR/commons-collections.jar:$LIB_DIR/commons-dbcp.jar:$LIB_DIR/commons-pool.jar:$LIB_DIR/xercesImpl.jar:$LIB_DIR/cvslib_36.jar:$LIB_DIR/commons-logging-1.1-dev.jar

export CP=$COMPONENTS:$LIST1:$LIST2

java $JAVA_FLAGS_EXT -classpath $CP com.churchmutual.project6.propagation.automation.VersionQuestions


We realized that we needed to call a different setupClient for WAS 6.1, so after a little searching we found it an modified our shell script to look like the following:
../initEnvironment

/QIBM/ProdData/WebSphere/AppServer/V61/Base/bin/setupClient -profileName $WASENVIRONMENT

export LIB_DIR=3rdparty
export COMPONENTS_DIR=lib

export COMPONENTS=$COMPONENTS_DIR/cmic-propagation-properties.jar:$COMPONENTS_DIR/cmic-propagation.jar:$COMPONENTS_DIR/rulesengine-dummy.jar:$COMPONENTS_DIR/cmic-base.jar:$COMPONENTS_DIR/systemx.jar:$COMPONENTS_DIR/messaging.jar:$COMPONENTS_DIR/systemx-server-tools.jar:$COMPONENTS_DIR/cmic-persistence.jar:$COMPONENTS_DIR/cmic-database.jar

export LIST1=$LIB_DIR/arch4j.jar:$LIB_DIR/jt400.jar:$LIB_DIR/log4j.jar:$LIB_DIR/castor-0.9.5.2.jar:$LIB_DIR/cmic-utilities.jar:$LIB_DIR/commons-cli-1.0.jar
export LIST2=$LIB_DIR/commons-collections.jar:$LIB_DIR/commons-dbcp.jar:$LIB_DIR/commons-pool.jar:$LIB_DIR/xercesImpl.jar:$LIB_DIR/cvslib_36.jar:$LIB_DIR/commons-logging-1.1-dev.jar

export CP=$COMPONENTS:$LIST1:$LIST2

java $JAVA_FLAGS_EXT -classpath $CP com.churchmutual.project6.propagation.automation.VersionQuestions


Now when we try to execute this script to kick off our code we can a ClassNotFoundException looking for com.ibm.websphere.naming.WsnInitialContextFactory.

Here's the stack trace:
Exception in thread "Thread-0" org.arch4j.core.EnvironmentalException: Cannot create JNDI InitialContext!; nested exception is:
javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory]
javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory]
at java.lang.Throwable.<init>(Throwable.java:196)
at java.lang.Exception.<init>(Exception.java:41)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:82)
at org.arch4j.baseservices.websphere.WebsphereBaseServices.getContext(WebsphereBaseServices.java:111)
at org.arch4j.messaging.websphere.WebsphereMessageQueueFacade.getQueueConnectionFactory(WebsphereMessageQueueFacade.java:
56)
at org.arch4j.messaging.MessageQueueFacade.initialize(MessageQueueFacade.java:73)
at org.arch4j.messaging.MessageQueueFacade.initialize(MessageQueueFacade.java:106)
at org.arch4j.messaging.MessagingProvider.getMessageQueueFacade(MessagingProvider.java:82)
at com.churchmutual.project6.messaging.processing.senders.SimpleMessageSender.sendMessage(SimpleMessageSender.java:39)
at com.churchmutual.project6.messaging.processing.senders.MessageSenderHelper.sendSimpleMessage(MessageSenderHelper.java:
42)
at com.churchmutual.project6.propagation.automation.VersionQuestions.main(VersionQuestions.java:61)
Caused by: java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory
at java.lang.Throwable.<init>(Throwable.java:218)
at java.lang.Exception.<init>(Exception.java:59)
at java.net.URLClassLoader.findClass(URLClassLoader.java:224)
at java.lang.ClassLoader.loadClass(ClassLoader.java:337)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:350)
at java.lang.Class.forName(Class.java:266)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
... 12 more


I can see that class being set up in the setupClient script in the above directory and am not sure what is going on wrong here. We even tried manually dumping the jar that this class is in (om.ibm.ws.runtime_6.1.0.jar) and other needed jars into our 3rdparty lib directory and adding them to the classpath manually and that didn't work either. We are using JVM 1.5.0 to kick off the code. Any ideas on what to do here? What we are missing? The old script that runs under WAS 5.0 runs fine and locates the context factory. Why is this one not finding it? Any ideas would be greatly appreciated.

cald...@churchmutual.com

okunmadı,
4 Eyl 2007 14:04:074.09.2007
alıcı
I'm guessing based on the number of views and replies that no one has ever encountered this?

Bob C

okunmadı,
4 Eyl 2007 14:26:434.09.2007
alıcı
Try using WebSphere's JVM as your JAVA_HOME, if your not doing that already.
0 yeni ileti