JBoss Community

Re: javax.naming.NameNotFoundException: persistence not bound

created by Trong Nguyen in JNDI and Naming - View the full discussion

You have to add below libs into: "c:\jboss-6.1.0.Final\server\default\lib"
1. eclipselink-2.3.0.jar
2. javax.persistence-2.0.jar
3. org.eclipse.persistence.jpa.jar
4. org.eclipse.persistence.jpa.jpql_1.0.0.jar

my persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
  <persistence-unit name="BluePumpkin-ejbPU" transaction-type="JTA">
     <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>java:/Bluepumpkin</jta-data-source>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties/>
  </persistence-unit>
</persistence>

My jboos-ds.xml

<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <local-tx-datasource>
    <jndi-name>Bluepumpkin</jndi-name>
    <connection-
url>jdbc:sqlserver://localhost:1433;databaseName=BluePumpkinDB</connection-url>
    <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
    <user-name>sa</user-name>
    <password/>
    <min-pool-size>5</min-pool-size>
    <max-pool-size>20</max-pool-size>
    <idle-timeout-minutes>5</idle-timeout-minutes>
  </local-tx-datasource>
</datasources>

 



Reply to this message by going to Community

Start a new discussion in JNDI and Naming at Community