2 Replies Latest reply on Feb 5, 2008 10:24 AM by Holger Lins

    Can not deploy process archive (par)

    Holger Lins Newbie

      Hi to all,

      I'm trying to deploy a process archive with an ant task. If I do it with the process designer it works fine. :-/
      But when I call the ant task a ClassNotFoundException:org.jnp.interfaces.NamingContextFactory occurs.
      I'm pretty sure that I've added the jbossall-client, which should contain this class to the classpath.

      Here's my build.xml

       <target name="deploy.par" description="deploys the jbpm processes" depends="par">
       <taskdef name="deploypar" classname="org.jbpm.ant.DeployProcessTask" >
       <classpath refid="compile.classpath"/>
       <classpath>
       <pathelement path="${process.resource.dir}" />
       </classpath>
       <classpath>
       <fileset dir="lib">
       <include name="jbossall-client.jar"/>
       </fileset>
       </classpath>
       </taskdef>
       <deploypar process="${dist.dir}/dslorderprocess.par"
       jbpmCfg="${dist.dir}/jbpm.cfg.xml"> </deploypar>
       </target>
      


      And the part of the hibernate.cfg.xml, where I set the jndi parameters:

      <property name="hibernate.jndi.url">jnp://127.0.1.1:1299</property>
       <property name="hibernate.jndi.class">org.jnp.interfaces.NamingContextFactory</property>
       <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
      
      


      And this happens:

      [deploypar] javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
      [deploypar] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
      [deploypar] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
      [deploypar] at javax.naming.InitialContext.init(InitialContext.java:223)
      [deploypar] at javax.naming.InitialContext.<init>(InitialContext.java:197)
      [deploypar] at org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:28)
      [deploypar] at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
      [deploypar] at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
      [deploypar] at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
      [deploypar] at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:410)
      [deploypar] at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
      [deploypar] at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
      [deploypar] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
      [deploypar] at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91)
      [deploypar] at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:95)
      [deploypar] at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:99)
      [deploypar] at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:341)
      [deploypar] at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:571)
      [deploypar] at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
      [deploypar] at org.jbpm.ant.DeployProcessTask.deploy(DeployProcessTask.java:93)
      [deploypar] at org.jbpm.ant.DeployProcessTask.execute(DeployProcessTask.java:58)
      [deploypar] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
      [deploypar] at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      [deploypar] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [deploypar] at java.lang.reflect.Method.invoke(Method.java:597)
      [deploypar] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
      [deploypar] at org.apache.tools.ant.Task.perform(Task.java:348)
      [deploypar] at org.apache.tools.ant.Target.execute(Target.java:357)
      [deploypar] at org.apache.tools.ant.Target.performTasks(Target.java:385)
      [deploypar] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
      [deploypar] at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
      [deploypar] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
      [deploypar] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
      [deploypar] at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
      [deploypar] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
      [deploypar] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
      [deploypar] Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
      [deploypar] at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      [deploypar] at java.security.AccessController.doPrivileged(Native Method)
      [deploypar] at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      [deploypar] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      [deploypar] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
      [deploypar] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      [deploypar] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      [deploypar] at java.lang.Class.forName0(Native Method)
      [deploypar] at java.lang.Class.forName(Class.java:247)
      [deploypar] at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46)
      [deploypar] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
      [deploypar] ... 34 more
      [deploypar] 05.02.2008 09:00:20 org.hibernate.connection.DatasourceConnectionProvider configure
      [deploypar] SCHWERWIEGEND: Could not find datasource: java:jdbc/MysqljBPM
      [deploypar] javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
      [deploypar] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
      [deploypar] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
      [deploypar] at javax.naming.InitialContext.init(InitialContext.java:223)
      [deploypar] at javax.naming.InitialContext.<init>(InitialContext.java:197)
      [deploypar] at org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:28)
      [deploypar] at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
      [deploypar] at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
      [deploypar] at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
      [deploypar] at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:410)
      [deploypar] at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
      [deploypar] at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
      [deploypar] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
      [deploypar] at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91)
      [deploypar] at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:95)
      [deploypar] at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:99)
      [deploypar] at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:341)
      [deploypar] at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:571)
      [deploypar] at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
      [deploypar] at org.jbpm.ant.DeployProcessTask.deploy(DeployProcessTask.java:93)
      [deploypar] at org.jbpm.ant.DeployProcessTask.execute(DeployProcessTask.java:58)
      [deploypar] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
      [deploypar] at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      [deploypar] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [deploypar] at java.lang.reflect.Method.invoke(Method.java:597)
      [deploypar] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
      [deploypar] at org.apache.tools.ant.Task.perform(Task.java:348)
      [deploypar] at org.apache.tools.ant.Target.execute(Target.java:357)
      [deploypar] at org.apache.tools.ant.Target.performTasks(Target.java:385)
      [deploypar] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
      [deploypar] at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
      [deploypar] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
      [deploypar] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
      [deploypar] at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
      [deploypar] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
      [deploypar] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
      [deploypar] Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
      [deploypar] at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      [deploypar] at java.security.AccessController.doPrivileged(Native Method)
      [deploypar] at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      [deploypar] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      [deploypar] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
      [deploypar] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      [deploypar] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      [deploypar] at java.lang.Class.forName0(Native Method)
      [deploypar] at java.lang.Class.forName(Class.java:247)
      [deploypar] at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46)
      [deploypar] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
      [deploypar] ... 34 more
      [deploypar] org.hibernate.HibernateException: Could not find datasource
      [deploypar] at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:56)
      [deploypar] at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
      [deploypar] at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
      [deploypar] at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:410)
      [deploypar] at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
      [deploypar] at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
      [deploypar] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
      [deploypar] at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91)
      [deploypar] at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:95)
      [deploypar] at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:99)
      [deploypar] at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:341)
      [deploypar] at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:571)
      [deploypar] at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
      [deploypar] at org.jbpm.ant.DeployProcessTask.deploy(DeployProcessTask.java:93)
      [deploypar] at org.jbpm.ant.DeployProcessTask.execute(DeployProcessTask.java:58)
      [deploypar] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
      [deploypar] at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      [deploypar] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [deploypar] at java.lang.reflect.Method.invoke(Method.java:597)
      [deploypar] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
      [deploypar] at org.apache.tools.ant.Task.perform(Task.java:348)
      [deploypar] at org.apache.tools.ant.Target.execute(Target.java:357)
      [deploypar] at org.apache.tools.ant.Target.performTasks(Target.java:385)
      [deploypar] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
      [deploypar] at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
      [deploypar] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
      [deploypar] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
      [deploypar] at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
      [deploypar] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
      [deploypar] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
      [deploypar] Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
      [deploypar] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
      [deploypar] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
      [deploypar] at javax.naming.InitialContext.init(InitialContext.java:223)
      [deploypar] at javax.naming.InitialContext.<init>(InitialContext.java:197)
      [deploypar] at org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:28)
      [deploypar] at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
      [deploypar] ... 29 more
      [deploypar] Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
      [deploypar] at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      [deploypar] at java.security.AccessController.doPrivileged(Native Method)
      [deploypar] at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      [deploypar] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      [deploypar] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
      [deploypar] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      [deploypar] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      [deploypar] at java.lang.Class.forName0(Native Method)
      [deploypar] at java.lang.Class.forName(Class.java:247)
      [deploypar] at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46)
      [deploypar] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
      [deploypar] ... 34 more
      
      BUILD FAILED
      /home/hlins/projects/diplomarbeit_jbpm/build.xml:198: couldn't deploy process archives : Could not find datasource
      


      I hope anybody can help me.

      thx

      hlins