4 Replies Latest reply on May 30, 2006 8:09 AM by Ronald van Kuijk

    Junit Test failed: NamingContextFactory can't be instantiate

    njipwo Bertrand Newbie

      Hello,

      i a'm still trying to run the hello example in the JBPM-BPEL but still stucking.

      All steps was successfull till the run-test with ant. Hier the Junit test can't run successfully because of the class NamingContextFactory that couldn't be found.

      I become the following error when running "ant run-test" :

      C:\OrdnerHyrarchie\MyCourses\Diplomarbeit\KOM\jBPM\Engine\jbpm-bpel-1.0-alpha4\doc\examples\hello>ant run-test
      Buildfile: build.xml
      
      compile-test:
      
      run-test:
       [junit] Testsuite: org.jbpm.bpel.tutorial.hello.HelloTest
       [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0,01 sec
      
       [junit] Testcase: testSayHello(org.jbpm.bpel.tutorial.hello.HelloTest):Caused an ERROR
       [junit] Cannot instantiate class: org.jnp.interfaces.NamingContextFactory
       [junit] javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory
      [Root exception is java.lang.ClassNotFound Exception: org.jnp.interfaces.NamingContextFactory]
       [junit] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
       [junit] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
       [junit] at javax.naming.InitialContext.init(InitialContext.java:223)
       [junit] at javax.naming.InitialContext.<init>(InitialContext.java:197)
       [junit] at org.jbpm.bpel.tutorial.hello.HelloTest.getInitialContext(HelloTest.java:43)
       [junit] at org.jbpm.bpel.tutorial.hello.HelloTest.setUp(HelloTest.java:21)
       [junit] Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
       [junit] at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
       [junit] at java.security.AccessController.doPrivileged(Native Method)
       [junit] at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
       [junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
       [junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       [junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       [junit] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      
       [junit] at java.lang.Class.forName0(Native Method)
       [junit] at java.lang.Class.forName(Class.java:242)
       [junit] at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
       [junit] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
       [junit] ... 29 more
      
      
       [junit] Test org.jbpm.bpel.tutorial.hello.HelloTest FAILED
      
      BUILD SUCCESSFUL
      Total time: 1 second
      
      .

      I have the following configurations:


      MySQL Server.4.1.9,
      jbpm-bpel-1.0-alpha4
      JBoss AS 4.0.3SP1
      jbpm-3.0.2
      jwsdp-1.6

      {JBPM.BPEL}/doc/examples/hello/jndi.properties:


      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.factory.url.pkgs=org.jboss.naming.client
      #java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
      java.naming.provider.url=jnp://localhost:1099
      #java.naming.provider.url=jnp://Bertrand:1099
      .

      {JBPM.BPEL}/doc/examples/hello/build.xml :

      <?xml version="1.0"?>
      <project name="helloWorld" default="deploy-application" basedir=".">
       <property file="build.properties"/>
       <property name="build.dir" value="build"/>
       <property name="definition.dir" value="definition"/>
       <property name="web.dir" value="web"/>
       <property name="client.dir" value="client"/>
       <property name="application.dir" value="application"/>
       <property name="test.dir" value="test"/>
       <property name="jboss.server.dir" value="${jboss.home}/server/${jboss.server}"/>
      
       <!-- ================= -->
       <!-- === CLASSPATH === -->
       <!-- ================= -->
       <path id="webtask.classpath">
       <pathelement location="${jbpm.bpel.home}/build/jbpm-bpel-${jbpm.bpel.version}.jar"/>
       </path>
       <path id="servicegen.classpath">
       <pathelement path="${basedir}"/>
       <pathelement location="${jbpm.bpel.home}/build/jbpm-bpel-${jbpm.bpel.version}.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/jbpm/jbpm-${jbpm.version}.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/wsdl4j/wsdl4j-1.4.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/commons/commons-collections-2.1.1.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/commons/commons-lang-2.1.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/commons/commons-logging-1.0.4.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/log4j/log4j-1.2.11.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/jaxen/jaxen-1.1-beta-7.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/hibernate/dom4j-1.6.1.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/j2ee/qname.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/j2ee/saaj.jar"/>
       <!-- uncomment to replace the TrAX implementation in JSE 1.5.0
       <pathelement location="${jbpm.bpel.home}/lib/xalan/xalan-2.6.0.jar"/>
       -->
       </path>
      
       <path id="test.classpath">
       <pathelement path="${basedir}"/>
       <pathelement location="${jboss.home}/client/jboss-ws4ee-client.jar"/>
       <pathelement location="${jboss.home}/client/axis-ws4ee.jar"/>
       <pathelement location="${jboss.home}/client/commons-discovery.jar"/>
       <pathelement location="${jboss.home}/client/activation.jar"/>
       <pathelement location="${jboss.home}/client/wsdl4j.jar"/>
       <pathelement location="${jboss.home}/client/log4j.jar"/>
       <pathelement location="${jboss.home}/client/commons-logging.jar"/>
      
       <pathelement location="${jboss.home}/client/jnp-client.jar"/>
       <pathelement location="${jboss.home}/client/jboss-j2ee.jar"/>
       <pathelement location="${jboss.home}/client/jbossall-client.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/JBossadditionLib/jbosscx-client.jar"/>
       <pathelement location="${jboss.home}/client/jboss-client.jar"/>
       <pathelement location="${jboss.home}/client/jbossmq-client.jar"/>
       <pathelement location="${jboss.home}/client/jbosssx-client.jar"/>
       <pathelement location="${jboss.home}/client/jboss-common-client.jar"/>
       <pathelement location="${jboss.home}/client/jboss-system-client.jar"/>
       <pathelement location="${jboss.home}/client/jboss-ws4ee-client.jar"/>
       <pathelement location="${jboss.home}/client/jboss-system-client.jar"/>
       <pathelement location="${jboss.home}/client/jbossjmx-ant.jar"/>
       <pathelement location="${jboss.home}/client/jboss-iiop-client.jar"/>
       <pathelement location="${jboss.home}/client/jbossha-client.jar"/>
       <pathelement location="${jboss.home}/client/jboss-aop-jdk50-client.jar"/>
       <!-- Added from Bertrand -->
       <pathelement location="${jbpm.bpel.home}/lib/Lib4JWSDP/dom.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/Lib4JWSDP/jaxp-api.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/Lib4JWSDP/jax-qname.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/Lib4JWSDP/jaxrpc-api.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/Lib4JWSDP/jaxrpc-impl.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/Lib4JWSDP/jaxrpc-spi.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/Lib4JWSDP/mail.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/Lib4JWSDP/namespace.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/Lib4JWSDP/relaxngDatatype.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/Lib4JWSDP/saaj-api.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/Lib4JWSDP/saaj-impl.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/Lib4JWSDP/sax.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/Lib4JWSDP/xalan.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/Lib4JWSDP/xercesImpl.jar"/>
       <pathelement location="${jbpm.bpel.home}/lib/Lib4JWSDP/xsdlib.jar"/>
       <!-- Added from Bertrand -->
       </path>
       <!-- ================ -->
       <!-- TASK DEFINITIONS -->
       <!-- ================ -->
       <taskdef name="webdbschema" classname="org.jbpm.bpel.ant.WebDBSchemaTask">
       <classpath refid="webtask.classpath"/>
       </taskdef>
       <taskdef name="webdeploy" classname="org.jbpm.bpel.ant.WebDeployTask">
       <classpath refid="webtask.classpath"/>
       </taskdef>
       <taskdef name="servicegen" classname="org.jbpm.bpel.ant.ServiceGeneratorTask">
       <classpath refid="servicegen.classpath"/>
       </taskdef>
       <!-- ======================= -->
       <!-- === DATABASE SCHEMA === -->
       <!-- ======================= -->
       <target name="create-schema" description="creates the jbpm tables">
       <webdbschema operation="create"/>
       </target>
       <!-- ==================================== -->
       <!-- === PROCESS DEFINITION PACKAGING === -->
       <!-- ==================================== -->
       <target name="pack-definition">
       <mkdir dir="${build.dir}"/>
       <jar destfile="${build.dir}/hello-definition.par">
       <fileset dir="${definition.dir}">
       <include name="hello.bpel"/>
       <include name="hello.wsdl"/>
       </fileset>
       <zipfileset dir="${definition.dir}" prefix="META-INF">
       <include name="bpel-definition.xml"/>
       </zipfileset>
       </jar>
       </target>
       <!-- ================================== -->
       <!-- === PROCESS ARCHIVE DEPLOYMENT === -->
       <!-- ================================== -->
       <target name="deploy-definition" depends="pack-definition" description="deploys the process archive">
       <webdeploy par="${basedir}/${build.dir}/hello-definition.par"/>
       </target>
       <!-- =============================== -->
       <!-- === WSDL SERVICE GENERATION === -->
       <!-- =============================== -->
       <target name="generate-service" depends="pack-definition" description="generate wsdl service document">
       <servicegen processfile="${basedir}/${build.dir}/hello-definition.par" outputdir="${basedir}/${web.dir}/wsdl"/>
       </target>
       <!-- =================================== -->
       <!-- === SERVER ARTIFACTS GENERATION === -->
       <!-- =================================== -->
       <target name="wscompile" if="wsdp.home" description="generates ws4ee server artifacts">
       <mkdir dir="${web.dir}/src"/>
       <mkdir dir="${web.dir}/classes"/>
       <java classname="LauncherBootstrap" dir="${web.dir}" fork="yes">
       <classpath>
       <pathelement path="${wsdp.home}/jwsdp-shared/bin"/>
       </classpath>
       <arg line="wscompile"/>
       <arg line="-import"/>
       <arg line="-keep"/>
       <arg line="-d classes"/>
       <arg line="-s src"/>
       <arg line="-mapping jaxrpc-mapping.xml"/>
       <arg line="-f:norpcstructures,wsi,strict"/>
       <arg line="wscompile-cfg.xml"/>
       </java>
       <copy file="${web.dir}/jaxrpc-mapping.xml" todir="${client.dir}"/>
       <copy todir="${test.dir}/src">
       <fileset dir="${web.dir}/src" includes="**/*.java" excludes="**/*_Impl.java"/>
       </copy>
       </target>
       <!-- ================================= -->
       <!-- === WEB APPLICATION PACKAGING === -->
       <!-- ================================= -->
       <target name="pack-web">
       <mkdir dir="${build.dir}"/>
       <jar destfile="${build.dir}/hello-web.war">
       <zipfileset dir="${web.dir}" prefix="WEB-INF">
       <exclude name="src/**"/>
       <exclude name="wscompile-cfg.xml"/>
       </zipfileset>
       <zipfileset dir="." prefix="WEB-INF/classes" includes="jbpm.properties"/>
       </jar>
       </target>
       <!-- ==================================== -->
       <!-- === APPLICATION CLIENT PACKAGING === -->
       <!-- ==================================== -->
       <target name="pack-client">
       <mkdir dir="${build.dir}"/>
       <jar destfile="${build.dir}/hello-client.jar">
       <zipfileset dir="${client.dir}" prefix="META-INF"/>
       </jar>
       </target>
       <!-- ============================= -->
       <!-- === APPLICATION PACKAGING === -->
       <!-- ============================= -->
       <target name="pack-application" depends="pack-web, pack-client">
       <jar destfile="${build.dir}/hello-application.ear">
       <zipfileset dir="${application.dir}" prefix="META-INF"/>
       <zipfileset dir="${build.dir}">
       <include name="hello-web.war"/>
       <include name="hello-client.jar"/>
       </zipfileset>
       </jar>
       </target>
       <!-- ====================================== -->
       <!-- === APPLICATION DEPLOYMENT (JBOSS) === -->
       <!-- ====================================== -->
       <target name="deploy-application" depends="pack-application" description="deploys the bpel application">
       <copy file="${build.dir}/hello-application.ear" todir="${jboss.server.dir}/deploy"/>
       </target>
       <target name="undeploy-application">
       <delete file="${jboss.server.dir}/deploy/hello-application.ear"/>
       </target>
       <!-- ============================= -->
       <!-- === TEST CLIENT EXECUTION === -->
       <!-- ============================= -->
       <target name="compile-test">
       <mkdir dir="${test.dir}/classes"/>
       <javac srcdir="${test.dir}/src" destdir="${test.dir}/classes" debug="on">
       <classpath refid="test.classpath"/>
       </javac>
       </target>
       <target name="run-test" depends="compile-test" description="executes the test client">
       <junit>
       <classpath>
       <path refid="test.classpath"/>
       <pathelement path="${test.dir}/classes"/>
       </classpath>
       <formatter type="brief" usefile="no"/>
       <test name="org.jbpm.bpel.tutorial.hello.HelloTest"/>
       </junit>
       </target>
       <!-- =============== -->
       <!-- === CLEANUP === -->
       <!-- =============== -->
       <target name="clean" description="removes all generated files">
       <delete failonerror="no" includeemptydirs="yes">
       <fileset dir="${build.dir}"/>
       <fileset dir="${web.dir}/classes"/>
       <fileset dir="${web.dir}/src"/>
       <fileset dir="${web.dir}/wsdl"/>
       <fileset dir="${web.dir}" includes="jaxrpc-mapping.xml"/>
       <fileset dir="${test.dir}/classes"/>
       </delete>
       </target>
      </project>
      
      .

      As you can see i have added the most JBoss clien libraries on the build-Path but the problem can't be solved. This seems to be a general problem deploying Services to JBoss and one than more user encounter this problem most of time related to the *.client.jar files and the JNDI-propertie file. Through google i can't lose the problem that's wy this new thread.

      Is there some on who know why the org.jnp.interfaces.NamingContextFactory can't be found ? I'll be very greatfull for a solution approach.

      Thanks in Advance


      Njipwo Bertrand

        • 1. Re: Junit Test failed: NamingContextFactory can't be instant
          Alejandro Guizar Master

          Bertrand,

          This is not a problem with jBPM BPEL. Dealing with classpath exceptions is a basic Java programming skill. Adding every library you can find will not solve the problem.

          The org.jnp.interfaces.NamingContextFactory class resides in the jnp-client.jar. Your favorite archive utility can help you find files within archives. Even the Windows XP explorer does it.

          Look at the path entry:

          ${jboss.home}/client/jnp-client.jar


          Now that you are sure what archive contains your class, you have to make sure that the property actually contains the value you want it to have. Did you modify your {jbpm.bpel.home}/doc/examples/hello/build.properties file to match your local environment?

          • 2. Re: Junit Test failed: NamingContextFactory can't be instant
            njipwo Bertrand Newbie

            Hello Alex,

            Thanks for your reply. Im online again. Thanks for your advice.

            I didn't provide the jnp-client.jar in the classpath. Additionally my system was not setup well. I haved removed my old configuration and installed the needed programs (Java-1.5, Ant, jwsdp, ....) again and it's work well. I can deploy the hello Example successfully. But now that the jBoss server tell me my process have been succefully deployed:

            12:10:28,775 WARN [EhCacheProvider] Could not find configuration [org.jbpm.context.def.VariableAccess]; using defaults.
            12:10:28,775 WARN [EhCacheProvider] Could not find configuration [org.jbpm.graph.def.Action]; using defaults.
            12:10:28,785 WARN [EhCacheProvider] Could not find configuration [org.jbpm.bpel.data.exe.MessageVariableInstance]; using defaults.
            12:10:28,785 WARN [EhCacheProvider] Could not find configuration [org.jbpm.bpel.data.def.VariableDefinition]; using defaults.
            12:10:28,785 WARN [EhCacheProvider] Could not find configuration [org.jbpm.bpel.exe.Fault]; using defaults.
            12:10:28,895 WARN [EhCacheProvider] Could not find configuration [org.jbpm.bpel.service.exe.CorrelationSetInstance]; using defaults.
            12:10:28,895 WARN [EhCacheProvider] Could not find configuration [org.jbpm.bpel.service.def.CorrelationSetDefinition]; using defaults.
            12:10:30,057 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
            12:10:30,057 INFO [SessionFactoryImpl] Checking 0 named queries
            12:10:30,057 INFO [JbpmService] binding JbpmSessionFactory 'java:/jbpm/BpelSessionFactory' into JNDI...
            12:10:30,217 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-xa-jdbc.rar
            12:10:30,728 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jms/jms-ra.rar
            12:10:31,288 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/mail-ra.rar
            12:10:32,049 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
            12:10:32,480 INFO [A] Bound to JNDI name: queue/A
            12:10:32,480 INFO [B] Bound to JNDI name: queue/B
            12:10:32,480 INFO [C] Bound to JNDI name: queue/C
            12:10:32,480 INFO [D] Bound to JNDI name: queue/D
            12:10:32,480 INFO [ex] Bound to JNDI name: queue/ex
            12:10:32,510 INFO [testTopic] Bound to JNDI name: topic/testTopic
            12:10:32,510 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
            12:10:32,510 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
            
            12:10:32,510 INFO [testQueue] Bound to JNDI name: queue/testQueue
            12:10:32,560 INFO [UILServerILService] JBossMQ UIL service available at : /0.0.0.0:8093
            12:10:32,600 INFO [DLQ] Bound to JNDI name: queue/DLQ
            12:10:32,811 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
            12:10:32,881 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
            12:10:33,031 INFO [EARDeployer] Init J2EE application: file:/C:/OrdnerHyrarchie/MyCourses/Diplomarbeit/KOM/jBPM/Engine/jBossAS-4.0.3SP1/server/default/deploy/hello-application.ear
            12:10:33,291 INFO [ClientDeployer] Client ENC bound under: hello-client
            12:10:33,301 INFO [TomcatDeployer] deploy, ctxPath=/hello, warUrl=.../tmp/deploy/tmp60829hello-application.ear-contents/hello-web-exp.war/
            12:10:37,387 INFO [[/hello]] messagerServlet: BPEL application started: helloWorld
            12:10:37,668 INFO [WSDLFilePublisher] WSDL published to: file:/C:/OrdnerHyrarchie/MyCourses/Diplomarbeit/KOM/jBPM/Engine/jBossAS-4.0.3SP1/server/default/data/wsdl/hello-application.ear/hello-web.war/service.wsdl
            12:10:37,818 INFO [AxisService] WSDD published to: C:\OrdnerHyrarchie\MyCourses\Diplomarbeit\KOM\jBPM\Engine\jBossAS-4.0.3SP1\server\default\data\wsdl\hello-application.ear\hello-web.war\callerPort.wsdd
            12:10:38,389 INFO [AxisService] Web Service deployed: http://Bertrand:8080/hello/caller
            12:10:38,399 INFO [EARDeployer] Started J2EE application: file:/C:/OrdnerHyrarchie/MyCourses/Diplomarbeit/KOM/jBPM/Engine/jBossAS-4.0.3SP1/server/default/deploy/hello-application.ear
            12:10:38,479 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
            12:10:38,609 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
            12:10:38,619 INFO [JkMain] Jk running ID=0 time=0/40 config=null
            12:10:38,629 INFO [Server] JBoss (MX MicroKernel) [4.0.3SP1 (build: CVSTag=JBoss
            .


            Running the Junit-Test (Running Ant with the Windows CMD-Tool in the {JBPM.BPEL.HOME}/doc/example/hello ) give some strange Error i can't analyse:

            C:\OrdnerHyrarchie\MyCourses\Diplomarbeit\KOM\jBPM\Engine\jbpm-bpel-1.0-alpha4\doc\examples\hello>ant run-test
            Buildfile: build.xml
            
            compile-test:
            
            run-test:
             [junit] Testsuite: org.jbpm.bpel.tutorial.hello.HelloTest
             [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 2,824 sec
            
             [junit] Testcase: testSayHello(org.jbpm.bpel.tutorial.hello.HelloTest):Caused an ERROR
             [junit] (500)Internal Server Error
             [junit] AxisFault
             [junit] faultCode: {http://xml.apache.org/axis/}HTTP
             [junit] faultSubcode:
             [junit] faultString: (500)Internal Server Error
             [junit] faultActor:
             [junit] faultNode:
             [junit] faultDetail:
             [junit] {}string: return code: 500
             [junit] <html><head><title>Apache Tomcat/5.5 - Error repor
            t</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color
            :white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sa
            ns-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:T
            ahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BOD
            Y {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {f
            ont-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {fon
            t-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
            {color : black;}A.name {color : black;}HR {color : #525D76;}--></style>
             </head><body><h1>HTTP Status 500 - </h1><HR size=&qu
            ot;1" noshade="noshade"><p><b>type</b> Excep
            tion report</p><p><b>message</b> <u></u><
            /p><p><b>description</b> <u>The server encountered an
             internal error () that prevented it from fulfilling this request.</u><
            /p><p><b>exception</b> <pre>javax.servlet.ServletExce
            ption: Servlet execution threw an exception
             [junit] org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
             [junit] </pre></p><p><b>root cause</b> <pre>java.lang.NoSuchMethodError:
            org.apache.commons.lang.StringUtils.isWhitespace(Ljava/lang/String;)Z
             [junit] org.jbpm.bpel.xml.util.XmlUtil.copyChildNodes(XmlUtil.java:700)
             [junit] org.jbpm.bpel.xml.util.XmlUtil.copy(XmlUtil.java:623)
             [junit] org.jbpm.bpel.service.messager.PortHandler.processResponse(PortHandler.java:495)
             [junit] org.jbpm.bpel.service.messager.PortHandler.handleResponse(PortHandler.java:248)
             [junit] org.jboss.webservice.handler.HandlerWrapper.handleResponse(HandlerWrapper.java:127)
             [junit] org.jboss.webservice.handler.HandlerChainBaseImpl.handleResponse(HandlerChainBaseImpl.java:279)
             [junit] org.jboss.webservice.handler.ServerHandlerChain.handleResponse(ServerHandlerChain.java:83)
             [junit] org.jboss.webservice.server.InvokerProviderJSE.invokeTarget(InvokerProviderJSE.java:117)
             [junit] org.jboss.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:121)
             [junit] org.jboss.axis.providers.java.JavaProvider.invoke(JavaProvider.java:358)
             [junit] org.jboss.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
             [junit] org.jboss.axis.SimpleChain.doVisiting(SimpleChain.java:160)
             [junit] org.jboss.axis.SimpleChain.invoke(SimpleChain.java:123)
             [junit] org.jboss.axis.handlers.soap.SOAPService.invoke(SOAPService.java:560)
             [junit] org.jboss.webservice.server.ServerEngine.invokeInternal(ServerEngine.java:200)
             [junit] org.jboss.webservice.server.ServerEngine.invoke(ServerEngine.java:89)
             [junit] org.jboss.axis.transport.http.AxisServlet.doPost(AxisServlet.java:911)
             [junit] javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
             [junit] org.jboss.axis.transport.http.AxisServletBase.service(AxisServletBase.java:370)
             [junit] javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
             [junit] org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
             [junit] </pre></p><p><b>note</b> <u>The
            full stack trace of the root cause is available in the Apache Tomcat/5.5 logs.&l
            t;/u></p><HR size="1" noshade="noshade"><h
            3>Apache Tomcat/5.5</h3></body></html>
            
             [junit] org.jboss.axis.AxisFault: (500)Internal Server Error
             [junit] at org.jboss.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:717)
             [junit] at org.jboss.axis.transport.http.HTTPSender.invoke(HTTPSender.java:136)
             [junit] at org.jboss.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
             [junit] at org.jboss.axis.SimpleChain.doVisiting(SimpleChain.java:160)
             [junit] at org.jboss.axis.SimpleChain.invoke(SimpleChain.java:123)
             [junit] at org.jboss.webservice.client.ClientEngine.invoke(ClientEngine.java:128)
             [junit] at org.jboss.axis.client.Call.invokeEngine(Call.java:3079)
             [junit] at org.jboss.axis.client.Call.invoke(Call.java:3064)
             [junit] at org.jboss.axis.client.Call.invoke(Call.java:2652)
             [junit] at org.jboss.axis.client.Call.invoke(Call.java:2561)
             [junit] at org.jboss.axis.client.Call.invokeInternal(Call.java:1982)
             [junit] at org.jboss.axis.client.Call.invoke(Call.java:1920)
             [junit] at org.jboss.webservice.client.CallImpl.invoke(CallImpl.java:265)
             [junit] at org.jboss.axis.client.AxisClientProxy.invokeSEIMethod(AxisClientProxy.java:286)
             [junit] at org.jboss.webservice.client.PortProxy.invoke(PortProxy.java:177)
             [junit] at $Proxy3.sayHello(Unknown Source)
             [junit] at org.jbpm.bpel.tutorial.hello.HelloTest.testSayHello(HelloTest.java:32)
            
            
             [junit] Test org.jbpm.bpel.tutorial.hello.HelloTest FAILED
            
            BUILD SUCCESSFUL
            Total time: 3 seconds
            /code]
            
            And the JBoss-server responses with:
            
            
            
            12:16:22,353 INFO [WSDLFilePublisher] WSDL published to: file:/C:/OrdnerHyrarchie/MyCourses/Diplomarbeit/KOM/jBPM/Engine/jBossAS-4.0.3SP1/server/default/data/wsdl/hello-application.ear/hello-web.war/service.wsdl
            12:16:22,483 INFO [AxisService] WSDD published to: C:\OrdnerHyrarchie\MyCourses\Diplomarbeit\KOM\jBPM\Engine\jBossAS-4.0.3SP1\server\default\data\wsdl\hello-ap
            plication.ear\hello-web.war\callerPort.wsdd
            12:16:22,944 INFO [AxisService] Web Service deployed: http://Bertrand:8080/hello/caller
            12:16:22,964 INFO [EARDeployer] Started J2EE application: file:/C:/OrdnerHyrarchie/MyCourses/Diplomarbeit/KOM/jBPM/Engine/jBossAS-4.0.3SP1/server/default/deploy/hello-application.ear12:16:23,034 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
            12:16:23,164 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
            12:16:23,184 INFO [JkMain] Jk running ID=0 time=0/40 config=null
            12:16:23,194 INFO [Server] JBoss (MX MicroKernel) [4.0.3SP1 (build: CVSTag=JBoss_4_0_3_SP1 date=200510231751)] Started in 35s:501ms
            12:29:08,515 ERROR [[callerServlet]] Servlet.service() for servlet callerServlet threw exception
            java.lang.NoSuchMethodError: org.apache.commons.lang.StringUtils.isWhitespace(Ljava/lang/String;)Z
             at org.jbpm.bpel.xml.util.XmlUtil.copyChildNodes(XmlUtil.java:700)
             at org.jbpm.bpel.xml.util.XmlUtil.copy(XmlUtil.java:623)
             at org.jbpm.bpel.service.messager.PortHandler.processResponse(PortHandler.java:495)
             at org.jbpm.bpel.service.messager.PortHandler.handleResponse(PortHandler.java:248)
             at org.jboss.webservice.handler.HandlerWrapper.handleResponse(HandlerWrapper.java:127)
             at org.jboss.webservice.handler.HandlerChainBaseImpl.handleResponse(HandlerChainBaseImpl.java:279)
             at org.jboss.webservice.handler.ServerHandlerChain.handleResponse(ServerHandlerChain.java:83)
             at org.jboss.webservice.server.InvokerProviderJSE.invokeTarget(InvokerProviderJSE.java:117)
             at org.jboss.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:121)
             at org.jboss.axis.providers.java.JavaProvider.invoke(JavaProvider.java:358)
             at org.jboss.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
             at org.jboss.axis.SimpleChain.doVisiting(SimpleChain.java:160)
             at org.jboss.axis.SimpleChain.invoke(SimpleChain.java:123)
             at org.jboss.axis.handlers.soap.SOAPService.invoke(SOAPService.java:560)
            
             at org.jboss.webservice.server.ServerEngine.invokeInternal(ServerEngine.java:200)
             at org.jboss.webservice.server.ServerEngine.invoke(ServerEngine.java:89)
            
             at org.jboss.axis.transport.http.AxisServlet.doPost(AxisServlet.java:911)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
             at org.jboss.axis.transport.http.AxisServletBase.service(AxisServletBase.java:370)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
             at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
             at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
             at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
             at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
             at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
             at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
             at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
             at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
             at java.lang.Thread.run(Thread.java:595)
            .
            
            I have tried to use eclipse-3.1 to deploy the Hello process and every think works well till the ant run-test I become the following Error :
            
            Buildfile: C:\OrdnerHyrarchie\MyCourses\Diplomarbeit\KOM\jBPM\Engine\jbpm-bpel-1.0-alpha4\doc\examples\hello\build.xml
            compile-test:
            run-test:
            
            BUILD FAILED
            C:\OrdnerHyrarchie\MyCourses\Diplomarbeit\KOM\jBPM\Engine\jbpm-bpel-1.0-alpha4\doc\examples\hello\build.xml:224: Could not create task or type of type: junit.
            
            Ant could not find the task or a class this task relies upon.
            
            This is common and has a number of causes; the usual
            solutions are to read the manual pages then download and
            install needed JAR files, or fix the build file:
             - You have misspelt 'junit'.
             Fix: check your spelling.
             - The task needs an external JAR file to execute
             and this is not found at the right place in the classpath.
             Fix: check the documentation for dependencies.
             Fix: declare the task.
             - The task is an Ant optional task and the JAR file and/or libraries
             implementing the functionality were not found at the time you
             yourself built your installation of Ant from the Ant sources.
             Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
             task and make sure it contains more than merely a META-INF/MANIFEST.MF.
             If all it contains is the manifest, then rebuild Ant with the needed
             libraries present in ${ant.home}/lib/optional/ , or alternatively,
             download a pre-built release version from apache.org
             - The build file was written for a later version of Ant
             Fix: upgrade to at least the latest release version of Ant
             - The task is not an Ant core or optional task
             and needs to be declared using <taskdef>.
             - You are attempting to use a task defined using
             <presetdef> or <macrodef> but have spelt wrong or not
             defined it at the point of use
            
            Remember that for JAR files to be visible to Ant tasks implemented
            in ANT_HOME/lib, the files must be in the same directory or on the
            classpath
            
            Please neither file bug reports on this problem, nor email the
            Ant mailing lists, until all of these causes have been explored,
            as this is not an Ant bug.
            
            Total time: 1 second
            
            
            
            I tried to fix this like described in the FAQ by copying the junit-2.8.1.jar and the clover.jar to the {ANT_HOME}/lib and put them on the classpath. Additionally on eclipse Project -> properties -> Java Build Path -> .... -> (Hope you unterstand what i mean.)
            But it doesn't solve the problem with eclipse and i leave this issues.
            
            Know i need any way to talk to my process by sending a String message in a SOAP-Request. This could be done using the Junit test provided with the hello example.
            
            Later i intend to analyse the JMS (Java Message Service) and correlation used in JBPM to send the right message to the correct processinstance. There for i'll need to send more SOAP-Messages (With differents String in the SOAP-Body) to the deployed prozess and analyse which information is persisted to the DB.
            
            
            Could any give me better ideas how to solve this problem ?
            
            Thanks once again.
            
            Regards
            
            Bertrand N.


            • 3. Re: Junit Test failed: NamingContextFactory can't be instant
              njipwo Bertrand Newbie

              Hello community,

              i'm looking back to some post and realised that i didn't provide some answer or solution how i solved this problem some week ago.

              I couldn't find out the really cause of this problem. I agree with alex when he says the JBPM.BPEL extion works well on a well and cleaned configured system. I then install my system new: I desinstall or deleted all allready installed program (java 1.5, jwsdp, jbossAS-4.0.3SP1, jbpm.bpel-1.0-alpha4) and installed it again. You need the following jars in my classpath :


              jboss-4.0.3SP1\client\jnp-Client.jar;
              jboss-4.0.3SP1\client\jbossall-client.jar;
              jboss-4.0.3SP1\client\axis-ws4ee.jar;
              jboss-4.0.3SP1\client\commons-discovery.jar;
              jboss-4.0.3SP1\client\activation.jar;
              jboss-4.0.3SP1\client\wsdl4j.jar;
              jboss-4.0.3SP1\client\log4j.jar;
              jboss-4.0.3SP1\client\commons-logging.jar;
              jboss-4.0.3SP1\client\concurrent.jar;
              jboss-4.0.3SP1\client\jboss-common-client.jar;
              jboss-4.0.3SP1\client\jboss-j2ee.jar;
              jboss-4.0.3SP1\client\jboss-system-client.jar;
              jboss-4.0.3SP1\client\jboss-ws4ee-client.jar


              and every think works
              PS: all this jars are needed in order to successfull run the examples in the jbpm module.

              Well i hope if some one has the same problem he knows now what he has to do to solve it.


              Regards


              Bertrand