[jboss-user] [jBPM] - JDBC Driver class not found

Jonathan Albornoz do-not-reply at jboss.com
Sun Jan 6 17:54:01 EST 2013


Jonathan Albornoz [https://community.jboss.org/people/betoflint] created the discussion

"JDBC Driver class not found"

To view the discussion, visit: https://community.jboss.org/message/788572#788572

--------------------------------------------------------------
Hi, i have a problem, i have jbpm 5.4 with oracle and jboss 7.1.1.
When i want run my project (example with persistence) i have the next error.
I put the ojdbc6.jar in db folder, and lib folder.
I was made all the test that i imagine...any help please...thanks!!!


*console log.*

Exception in thread "main" javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.persistence.jpa] Unable to build EntityManagerFactory
          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)
          at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)
          at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
          at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
          at com.sample.fefefefefe.main(fefefefefe.java:26)
Caused by: org.hibernate.HibernateException: JDBC Driver class not found: oracle.jdbc.driver.OracleDriver
          at org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
          at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:137)
          at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29)
          at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:89)
          at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119)
          at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115)
          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339)
          at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
          ... 4 more
Caused by: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
          at java.net.URLClassLoader$1.run(Unknown Source)
          at java.net.URLClassLoader$1.run(Unknown Source)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Unknown Source)
          at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
          at org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
          ... 12 more
0    06/01 19:48:39,121[main] ERROR hibernate.connection.DriverManagerConnectionProvider.configure  - JDBC Driver class not found: oracle.jdbc.driver.OracleDriver
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
          at java.net.URLClassLoader$1.run(Unknown Source)
          at java.net.URLClassLoader$1.run(Unknown Source)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Unknown Source)
          at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
          at org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
          at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:137)
          at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29)
          at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:89)
          at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119)
          at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115)
          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339)
          at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
          at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)
          at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
          at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
          at com.sample.fefefefefe.main(fefefefefe.java:26)

*My java code:*

package com.sample;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import org.drools.KnowledgeBase;
import org.drools.KnowledgeBaseFactory;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import org.drools.io.ResourceFactory;
import org.drools.persistence.jpa.JPAKnowledgeService;
import org.drools.runtime.Environment;
import org.drools.runtime.EnvironmentName;
import org.drools.runtime.StatefulKnowledgeSession;

public class fefefefefe {

            /**
           * @param args
           */
          public static void main(String[] args) {
                    // TODO Auto-generated method stub

                    KnowledgeBase kbase = readKnowledgeBase();
                    EntityManagerFactory emf = Persistence.createEntityManagerFactory( "org.jbpm.persistence.jpa" );
                    Environment env = KnowledgeBaseFactory.newEnvironment();
                    env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
                    // create a new knowledge session that uses JPA to store the runtime state
                    StatefulKnowledgeSession ksession =JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );
                    int sessionId = ksession.getId();
                    // invoke methods on your method here
                    ksession.startProcess( "com.sample.bpmn.hello" );
                    ksession.dispose();
          }
          private static KnowledgeBase readKnowledgeBase() {
                    KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
                    kbuilder.add(ResourceFactory.newClassPathResource("sample.bpmn"), ResourceType.BPMN2);
                    return kbuilder.newKnowledgeBase();
          }
}


*My persistence file inside my project. Resource/Meta-Inf*

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence version="1.0" xsi:schemaLocation=
    " http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence
      http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
      http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm
      http://java.sun.com/xml/ns/persistence/orm_1_0.xsd http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
  xmlns:orm=" http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm"
  xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
  xmlns=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence">
  <persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>

    <mapping-file>META-INF/JBPMorm.xml</mapping-file>
    <class>org.drools.persistence.info.SessionInfo</class>
    <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
    <class>org.drools.persistence.info.WorkItemInfo</class>
    <properties>

    <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
      <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/>
      <property name="hibernate.connection.url" value="jdbc:oracle:thin:@192.168.20.200:1521:orcl2" />
      <property name="hibernate.connection.username" value="jbpm5"/>
      <property name="hibernate.connection.password" value="ryc"/>
      <property name="hibernate.connection.autocommit" value="false" />
      <property name="hibernate.max_fetch_depth" value="3"/>
      <property name="hibernate.hbm2ddl.auto" value="create" />
      <property name="hibernate.show_sql" value="false" />
      <property name="javax.persistence.jdbc.driver" value="oracle.jdbc.driver.OracleDriver"/>



    </properties>
  </persistence-unit>
</persistence>


//********************************************************************************************
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/788572#788572]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130106/2f0dd522/attachment-0001.html 


More information about the jboss-user mailing list