1 2 Previous Next 24 Replies Latest reply: Mar 24, 2012 10:18 PM by abhi0123 RSS

jboss-6.0.0.Final: Unable to process @Resource annotation (title changed)

abhi0123 Newbie

Hi,

Fed up from vendor lock in and pushy not so intelligent support, and hopeful from the ever growing JBoss fanbase, we started a new development project on JBoss 5.1.0.GA. We are using JBoss 5.x because we want to stick to Java EE 5 for some more time. If it matters, we are using Mainframe DB2 server.

I only found a similar problem as mine but the solution did not work for me. Please help.

http://community.jboss.org/message/533636

 

Server log:

Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:483)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4388)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
... 74 more
Caused by: java.lang.NullPointerException
at org.jboss.injection.PersistenceUnitHandler.getManagedEntityManagerFactory(PersistenceUnitHandler.java:149)
at org.jboss.injection.PcEncInjector.inject(PcEncInjector.java:76)
at org.jboss.web.tomcat.service.TomcatInjectionContainer.populateEnc(TomcatInjectionContainer.java:482)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:471)
... 77 more
2011-02-17 21:30:37,561 INFO  [org.jboss.profileservice.management.upload.remoting.DeployHandler] (ResourceContainer.invoker.nonDaemon-1) Failed to complete command: [start] for deployment: names=[vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/reporting.war/], copyContent=true
org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

*** DEPLOYMENTS IN ERROR: Name -> Error

vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/reporting.war/ -> org.jboss.deployers.spi.DeploymentException: URL file:/C:/jboss-5.1.0.GA/server/default/tmp/a18b2w-m9yq71-gkahbb86-1-gkahg04r-ij/reporting.war/ deployment failed

 

persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.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_1_0.xsd">
<persistence-unit name="abcPU" transaction-type="JTA">
  <provider>org.hibernate.ejb.HibernatePersistence</provider>
  <jta-data-source>java:TEST</jta-data-source>
  <properties>
   <property name="hibernate.hbm2ddl.auto" value="validate" />
   <property name="hibernate.show_sql" value="true" />
   <property name="hibernate.dialect" value="org.hibernate.dialect.DB2Dialect" />
   <property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory" />
   <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />  
  </properties> 
</persistence-unit>

</persistence>

 

db2-ds.xml:

<?xml version="1.0" encoding="UTF-8"?>

<datasources>
<local-tx-datasource>
  <jndi-name>TEST</jndi-name>
  <connection-url>jdbc:db2://MVST:50000/TEST</connection-url>

  <driver-class>com.ibm.db2.jcc.DB2Driver</driver-class>
  <user-name>x</user-name>
  <password>y</password>
  <min-pool-size>0</min-pool-size>

  <!-- New org.jboss.resource.adapter.jdbc.vendor.DB2ExceptionSorter -->
  <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DB2ExceptionSorter
  </exception-sorter-class-name>

  <!-- sql to call on an existing pooled connection when it is obtained from
   pool -->
  <check-valid-connection-sql>SELECT 1 FROM TABLE1
  </check-valid-connection-sql>
  <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
  <metadata>
   <type-mapping>DB2</type-mapping>
  </metadata>
</local-tx-datasource>

</datasources>

1 2 Previous Next