0 Replies Latest reply on Dec 6, 2008 8:27 PM by bdlink

    Update workbook to work with JBoss 5?

    bdlink

      Tried to get work book examples to work with JBoss 5. Had to change buid.xml to use %JBOSS_HOME%/client in classpath instead of what was there.
      Then example 4_1 would compile at least. When loaded in, got error

      vfszip:/C:/apps/jboss-as-5.0.0.GA/server/default/deploy/titan.jar -> org.jboss.xb.binding.JBossXBRuntimeException: Failed to resolve schema nsURI= location=persistence
      
      
       at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:863)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:665)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:293)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
       at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.j
      ava:65)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.
      java:142)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166
      )
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
       at java.lang.Thread.run(Thread.java:595)


      which was fixed by changing persistence.xml to
      <?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 persistence_1_0.xsd ">
       <persistence-unit name="titan">
       <provider>org.hibernate.ejb.HibernatePersistence</provider>
       <jta-data-source>java:/DefaultDS</jta-data-source>
       <properties>
       <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
       <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
       </properties>
       </persistence-unit>
      </persistence>


      But according to ejb3 spec, the persistence.xml that was present should have worked:
      <?xml version="1.0" encoding="UTF-8"?>
      <persistence>
       <persistence-unit name="titan">
       <jta-data-source>java:/DefaultDS</jta-data-source>
       <properties>
       <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
       </properties>
       </persistence-unit>
      </persistence>


      When I successfully ran the example, got following warnings from JBOSS 5.0.0.GA:
      16:56:03,671 WARN [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, Inte
      rceptorRegistry should be used via the bean container
      16:56:03,671 WARN [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, Inte
      rceptorRegistry should be used via the bean container
      16:56:03,671 WARN [InterceptorRegistry] applicable interceptors is non-existent for public void com.titan.travelagent.T
      ravelAgentBean.createCabin(com.titan.domain.Cabin)
      16:56:03,687 WARN [InterceptorRegistry] applicable interceptors is non-existent for public com.titan.domain.Cabin com.t
      itan.travelagent.TravelAgentBean.findCabin(int)
      16:56:03,687 WARN [InterceptorRegistry] applicable interceptors is non-existent for public void com.titan.travelagent.T
      ravelAgentBean.createCabin(com.titan.domain.Cabin)
      16:56:03,687 WARN [InterceptorRegistry] applicable interceptors is non-existent for public com.titan.domain.Cabin com.t
      itan.travelagent.TravelAgentBean.findCabin(int)