12 Replies Latest reply on Mar 6, 2008 6:48 PM by Andrew Rubinger

    @PersistenceUnit on private javax.persistence.EntityManager.

    Jeremy Flowers Newbie

      I've been following along with an example using EJB3/JBOSS from the book
      Beginning Java EE 5 Platform and don't know why JBoss is complaining about an annotated private instance of an Entity Manager.
      I was wondering if anyone can let me know where I am going wrong.
      Here is the code:

      package beans;
      
      import javax.persistence.Entity;
      import java.io.Serializable;
      import javax.persistence.Id;
      
      @Entity
      public class Stock implements Serializable {
       // The persistent fields
       private String tickerSymbol;
       private String name;
      
       // Constructors
       public Stock() {}
       public Stock(String tickerSymbol, String name) {
       this.tickerSymbol = tickerSymbol;
       this.name = name;
       }
      
       // The access methods for persistent fields
       // tickerSymbol is the id
       @Id
       public String getTickerSymbol() {
       return tickerSymbol;
       }
      
       public void setTickerSymbol(String tickerSymbol) {
       this.tickerSymbol = tickerSymbol;
       }
      
       public String getName() {
       return name;
       }
      
       public void setName(String name) {
       this.name = name;
       }
      }
      

      package beans;
      
      import javax.ejb.Remote;
      
      @Remote
      public interface StockList {
       // The public business methods on the StockList bean
       public String getStock(String ticker);
       public void addStock(String ticker, String name);
       public void updateStock(String ticker, String name);
       public void deleteStock(String ticker);
      }
      

      package beans;
      
      import beans.Stock;
      import javax.persistence.PersistenceContext;
      import javax.ejb.Stateless;
      import javax.persistence.EntityManager;
      
      @Stateless
      public class StockListBean implements StockList {
      
       // The reference to the entity manager
       @PersistenceContext
       private EntityManager _manager;
      
       // The public business methods. These must be coded in the
       // interface also
      
       public String getStock(String ticker) {
       Stock stock = _manager.find(Stock.class, ticker);
       return stock.getName();
       }
      
       public void addStock(String ticker, String name) {
       _manager.persist(new Stock(ticker, name));
       }
      
       public void updateStock(String ticker, String name) {
       Stock stock = _manager.find(Stock.class, ticker);
       stock.setName(name);
       }
      
       public void deleteStock(String ticker) {
       Stock stock = _manager.find(Stock.class, ticker);
       _manager.remove(stock);
       }
      }
      

      I've deployed a jar called StockListApp.ejb3 with the classes compiled from this code and come up against the following error

      ------

      2008-03-06 18:35:55,671 DEBUG [org.jboss.deployment.MainDeployer] Begin deployment start file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
      2008-03-06 18:35:55,671 DEBUG [org.jboss.ejb3.EJB3Deployer] start application, deploymentInfo: org.jboss.deployment.DeploymentInfo@fe1c38ab { url=file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3 }
      deployer: MBeanProxyExt[jboss.ejb3:service=EJB3Deployer]
      status: Starting
      state: START_DEPLOYER
      watch: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
      altDD: null
      lastDeployed: 1204828555656
      lastModified: 1204828555656
      mbeans:
      , short name: StockListApp.ejb3, parent short name: null
      2008-03-06 18:35:55,671 DEBUG [org.jboss.system.ServiceController] starting service jboss.j2ee:service=EJB3,module=StockListApp.ejb3
      2008-03-06 18:35:55,671 DEBUG [org.jboss.ejb3.Ejb3Module] Starting jboss.j2ee:service=EJB3,module=StockListApp.ejb3
      2008-03-06 18:35:55,671 DEBUG [org.jboss.system.ServiceController] stopping service: jboss.j2ee:jar=StockListApp.ejb3,name=StockListBean,service=EJB3
      2008-03-06 18:35:55,671 WARN [org.jboss.system.ServiceController] Ignoring request to stop nonexistent service: jboss.j2ee:jar=StockListApp.ejb3,name=StockListBean,service=EJB3
      2008-03-06 18:35:55,671 DEBUG [org.jboss.system.ServiceController] destroying service: jboss.j2ee:jar=StockListApp.ejb3,name=StockListBean,service=EJB3
      2008-03-06 18:35:55,671 WARN [org.jboss.system.ServiceController] Ignoring request to destroy nonexistent service: jboss.j2ee:jar=StockListApp.ejb3,name=StockListBean,service=EJB3
      2008-03-06 18:35:55,671 WARN [org.jboss.ejb3.JmxKernelAbstraction] jboss.j2ee:jar=StockListApp.ejb3,name=StockListBean,service=EJB3 is not registered
      2008-03-06 18:35:55,671 DEBUG [org.jboss.ejb3.Ejb3Module] Starting failed jboss.j2ee:service=EJB3,module=StockListApp.ejb3
      java.lang.RuntimeException: Illegal @PersistenceUnit on private javax.persistence.EntityManager beans.StockListBean._manager :There is no default persistence unit in this deployment.
      at org.jboss.injection.PersistenceContextHandler.handleFieldAnnotations(PersistenceContextHandler.java:182)
      at org.jboss.injection.InjectionUtil.processFieldAnnotations(InjectionUtil.java:137)
      at org.jboss.injection.InjectionUtil.processAnnotations(InjectionUtil.java:174)
      at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:358)
      at org.jboss.ejb3.SessionContainer.processMetadata(SessionContainer.java:140)
      at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:292)
      at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:356)
      at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:91)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy33.start(Unknown Source)
      at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:512)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
      at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
      at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
      at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
      at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy34.start(Unknown Source)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy9.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
      2008-03-06 18:35:55,671 WARN [org.jboss.system.ServiceController] Problem starting service jboss.j2ee:service=EJB3,module=StockListApp.ejb3
      java.lang.RuntimeException: Illegal @PersistenceUnit on private javax.persistence.EntityManager beans.StockListBean._manager :There is no default persistence unit in this deployment.
      at org.jboss.injection.PersistenceContextHandler.handleFieldAnnotations(PersistenceContextHandler.java:182)
      at org.jboss.injection.InjectionUtil.processFieldAnnotations(InjectionUtil.java:137)
      at org.jboss.injection.InjectionUtil.processAnnotations(InjectionUtil.java:174)
      at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:358)
      at org.jboss.ejb3.SessionContainer.processMetadata(SessionContainer.java:140)
      at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:292)
      at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:356)
      at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:91)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy33.start(Unknown Source)
      at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:512)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
      at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
      at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
      at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
      at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy34.start(Unknown Source)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy9.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
      2008-03-06 18:35:55,765 INFO [org.jboss.ejb3.EJB3Deployer] Deployed: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
      2008-03-06 18:35:55,765 DEBUG [org.jboss.deployment.MainDeployer] End deployment start on package: StockListApp.ejb3
      2008-03-06 18:35:55,765 DEBUG [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
      2008-03-06 18:35:55,765 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Watch URL for: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3 -> file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
      2008-03-06 18:35:55,765 ERROR [org.jboss.deployment.scanner.URLDeploymentScanner] Incomplete Deployment listing:

      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.j2ee:service=EJB3,module=StockListApp.ejb3
      State: FAILED
      Reason: java.lang.RuntimeException: Illegal @PersistenceUnit on private javax.persistence.EntityManager beans.StockListBean._manager :There is no default persistence unit in this deployment.

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.j2ee:service=EJB3,module=StockListApp.ejb3
      State: FAILED
      Reason: java.lang.RuntimeException: Illegal @PersistenceUnit on private javax.persistence.EntityManager beans.StockListBean._manager :There is no default persistence unit in this deployment.

      -----

        • 1. Re: @PersistenceUnit on private javax.persistence.EntityMana
          Andrew Rubinger Master

           

          There is no default persistence unit in this deployment
          
          Do you have a "persistence.xml" in the META-INF of your JAR?
          
          And please wrap your stack traces in a "code" block, too. :D
          
          S,
          ALR
          
          
          
          


          • 2. Re: @PersistenceUnit on private javax.persistence.EntityMana
            Andrew Rubinger Master

            Course, given that last post, I shouldn't be one to complain about formatting. :)

            S,
            ALR

            • 3. Re: @PersistenceUnit on private javax.persistence.EntityMana
              Jeremy Flowers Newbie

               

              "ALRubinger" wrote:
              There is no default persistence unit in this deployment. Do you have a "persistence.xml" in the META-INF of your JAR?

              The answer to your question is no. Should I?
              From what I read in the book, I thought JBoss was supposed to automatically create the database back end with Hypersonic database.
              Having a cursory glance at persistence.xml from Googling it looks like some sort of Hibernate configuration....
              PS: Will format error logs in code block in future :)

              • 4. Re: @PersistenceUnit on private javax.persistence.EntityMana
                Jeremy Flowers Newbie

                BTW: Have just taken a look at the code download from Apress website for this book.
                It has defined an extra exception class and iused it in StockList interface, and as a consequence StockListBean.
                Because the design pattern in the class that was found by JBoss didn't match what it was expecting, could this be the root cause of the exception that got thrown?

                • 5. Re: @PersistenceUnit on private javax.persistence.EntityMana
                  Andrew Rubinger Master

                  Well, JBoss automatically ships with the Hypersonic database to give you features requiring persistence out of the box...like JMS.

                  But even if you use the Hypersonic DB, you still need to:

                  * Create a database (namespace, not database server) for your application (See references for your DB impl).
                  * Create your DB schema to match that which JPA/EJB3 Entities expect. See hbm2ddl configuration for Hibernate, can be done from persistence.xml; this will handle this step for you via autogen to save you this step and keep everything in line during development.
                  * Create a datasource to define the connection pool to your DB. If you use Hypersonic built-in, this is already done. Otherwise you must make your own *-ds.xml file and place in "deploy". http://wiki.jboss.org/wiki/Wiki.jsp?page=DSdotXML
                  * Create a persistence.xml to define your persistence unit (this will point to your datasource); yes this is where implementation-specific config may be done (ie. Hibernate in JBoss's case)

                  • 6. Re: @PersistenceUnit on private javax.persistence.EntityMana
                    Andrew Rubinger Master

                     

                    "JGF1" wrote:
                    BTW: Have just taken a look at the code download from Apress website for this book.
                    It has defined an extra exception class and iused it in StockList interface, and as a consequence StockListBean.
                    Because the design pattern in the class that was found by JBoss didn't match what it was expecting, could this be the root cause of the exception that got thrown?


                    Nope...your exception is complaining about a lack of default persistence unit. Please take a look at http://trailblazer.demo.jboss.com/EJB3Trail/persistence

                    S,
                    ALR

                    • 7. Re: @PersistenceUnit on private javax.persistence.EntityMana
                      Jeremy Flowers Newbie

                       

                      "JGF1" wrote:
                      BTW: Have just taken a look at the code download from Apress website for this book.
                      It has defined an extra exception class and iused it in StockList interface, and as a consequence StockListBean.
                      Because the design pattern in the class that was found by JBoss didn't match what it was expecting, could this be the root cause of the exception that got thrown?

                      I can confirm this had no bearing on exception being thrown.
                      IE Introduced Exception class and still have same Exception being thrown:
                      Here it is formatted:
                      2008-03-06 22:26:02,734 DEBUG [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                      2008-03-06 22:26:02,734 DEBUG [org.jboss.deployment.MainDeployer] Starting deployment (init step) of package at: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                      2008-03-06 22:26:02,734 DEBUG [org.jboss.deployment.MainDeployer] Copying file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3 -> C:\apps\jboss-4.2.2.GA\server\all\tmp\deploy\tmp4408StockListApp.ejb3
                      2008-03-06 22:26:02,734 DEBUG [org.jboss.deployment.MainDeployer] using deployer MBeanProxyExt[jboss.ejb3:service=EJB3Deployer]
                      2008-03-06 22:26:02,734 DEBUG [org.jboss.ejb3.EJB3Deployer] looking for nested deployments in : file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                      2008-03-06 22:26:02,734 DEBUG [org.jboss.deployment.DeploymentInfo] createLoaderRepository from config: LoaderRepositoryConfig(repositoryName: JMImplementation:service=LoaderRepository,name=Default, repositoryClassName: null, configParserClassName: null, repositoryConfig: null)
                      2008-03-06 22:26:02,734 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.UnifiedLoaderRepository3@f1bb78, cl=org.jboss.mx.loading.UnifiedClassLoader3@122fe15{ url=file:/C:/apps/jboss-4.2.2.GA/server/all/tmp/deploy/tmp4408StockListApp.ejb3 ,addedOrder=0}
                      2008-03-06 22:26:02,734 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.UnifiedLoaderRepository3@f1bb78, cl=org.jboss.mx.loading.UnifiedClassLoader3@122fe15{ url=file:/C:/apps/jboss-4.2.2.GA/server/all/tmp/deploy/tmp4408StockListApp.ejb3 ,addedOrder=0}
                      2008-03-06 22:26:02,734 DEBUG [org.jboss.mx.loading.UnifiedLoaderRepository3] Adding org.jboss.mx.loading.UnifiedClassLoader3@122fe15{ url=file:/C:/apps/jboss-4.2.2.GA/server/all/tmp/deploy/tmp4408StockListApp.ejb3 ,addedOrder=0}
                      2008-03-06 22:26:02,734 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: beans
                      2008-03-06 22:26:02,734 DEBUG [org.jboss.deployment.MainDeployer] found 0 subpackages of file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                      2008-03-06 22:26:02,734 DEBUG [org.jboss.deployment.MainDeployer] Watching new file: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                      2008-03-06 22:26:02,734 DEBUG [org.jboss.deployment.MainDeployer] create step for deployment file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                      2008-03-06 22:26:02,734 DEBUG [org.jboss.ejb3.EJB3Deployer] create, StockListApp.ejb3
                      2008-03-06 22:26:02,734 DEBUG [org.jboss.ejb3.EJB3Deployer] Deploying: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                      2008-03-06 22:26:02,734 DEBUG [org.jboss.system.ServiceController] Creating service jboss.j2ee:service=EJB3,module=StockListApp.ejb3
                      2008-03-06 22:26:02,734 DEBUG [org.jboss.ejb3.Ejb3Module] Creating jboss.j2ee:service=EJB3,module=StockListApp.ejb3
                      2008-03-06 22:26:02,750 DEBUG [org.jboss.ejb3.Ejb3AnnotationHandler] found EJB3: ejbName=StockListBean, class=beans.StockListBean, type=STATELESS
                      2008-03-06 22:26:02,750 DEBUG [org.jboss.ejb3.Ejb3Deployment] EJB3 deployment time took: 16
                      2008-03-06 22:26:02,750 DEBUG [org.jboss.ejb3.Ejb3Module] Created jboss.j2ee:service=EJB3,module=StockListApp.ejb3
                      2008-03-06 22:26:02,750 DEBUG [org.jboss.system.ServiceController] Creating dependent components for: jboss.j2ee:service=EJB3,module=StockListApp.ejb3 dependents are: []
                      2008-03-06 22:26:02,750 DEBUG [org.jboss.deployment.MainDeployer] Done with create step of deploying StockListApp.ejb3
                      2008-03-06 22:26:02,750 DEBUG [org.jboss.deployment.MainDeployer] Begin deployment start file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                      2008-03-06 22:26:02,750 DEBUG [org.jboss.ejb3.EJB3Deployer] start application, deploymentInfo: org.jboss.deployment.DeploymentInfo@fe1c38ab { url=file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3 }
                       deployer: MBeanProxyExt[jboss.ejb3:service=EJB3Deployer]
                       status: Starting
                       state: START_DEPLOYER
                       watch: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                       altDD: null
                       lastDeployed: 1204842362734
                       lastModified: 1204842362734
                       mbeans:
                      , short name: StockListApp.ejb3, parent short name: null
                      2008-03-06 22:26:02,750 DEBUG [org.jboss.system.ServiceController] starting service jboss.j2ee:service=EJB3,module=StockListApp.ejb3
                      2008-03-06 22:26:02,750 DEBUG [org.jboss.ejb3.Ejb3Module] Starting jboss.j2ee:service=EJB3,module=StockListApp.ejb3
                      2008-03-06 22:26:02,750 DEBUG [org.jboss.system.ServiceController] stopping service: jboss.j2ee:jar=StockListApp.ejb3,name=StockListBean,service=EJB3
                      2008-03-06 22:26:02,750 WARN [org.jboss.system.ServiceController] Ignoring request to stop nonexistent service: jboss.j2ee:jar=StockListApp.ejb3,name=StockListBean,service=EJB3
                      2008-03-06 22:26:02,750 DEBUG [org.jboss.system.ServiceController] destroying service: jboss.j2ee:jar=StockListApp.ejb3,name=StockListBean,service=EJB3
                      2008-03-06 22:26:02,750 WARN [org.jboss.system.ServiceController] Ignoring request to destroy nonexistent service: jboss.j2ee:jar=StockListApp.ejb3,name=StockListBean,service=EJB3
                      2008-03-06 22:26:02,750 WARN [org.jboss.ejb3.JmxKernelAbstraction] jboss.j2ee:jar=StockListApp.ejb3,name=StockListBean,service=EJB3 is not registered
                      2008-03-06 22:26:02,765 DEBUG [org.jboss.ejb3.Ejb3Module] Starting failed jboss.j2ee:service=EJB3,module=StockListApp.ejb3
                      java.lang.RuntimeException: Illegal @PersistenceUnit on private javax.persistence.EntityManager beans.StockListBean._manager :There is no default persistence unit in this deployment.
                       at org.jboss.injection.PersistenceContextHandler.handleFieldAnnotations(PersistenceContextHandler.java:182)
                       at org.jboss.injection.InjectionUtil.processFieldAnnotations(InjectionUtil.java:137)
                       at org.jboss.injection.InjectionUtil.processAnnotations(InjectionUtil.java:174)
                       at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:358)
                       at org.jboss.ejb3.SessionContainer.processMetadata(SessionContainer.java:140)
                       at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:292)
                       at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:356)
                       at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:91)
                       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       at java.lang.reflect.Method.invoke(Method.java:597)
                       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                       at $Proxy0.start(Unknown Source)
                       at org.jboss.system.ServiceController.start(ServiceController.java:417)
                       at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       at java.lang.reflect.Method.invoke(Method.java:597)
                       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                       at $Proxy33.start(Unknown Source)
                       at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:512)
                       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       at java.lang.reflect.Method.invoke(Method.java:597)
                       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                       at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
                       at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
                       at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
                       at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
                       at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
                       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                       at $Proxy34.start(Unknown Source)
                       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
                       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
                       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
                       at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       at java.lang.reflect.Method.invoke(Method.java:597)
                       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                       at $Proxy9.deploy(Unknown Source)
                       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
                       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
                       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
                       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
                       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
                      2008-03-06 22:26:02,765 WARN [org.jboss.system.ServiceController] Problem starting service jboss.j2ee:service=EJB3,module=StockListApp.ejb3
                      java.lang.RuntimeException: Illegal @PersistenceUnit on private javax.persistence.EntityManager beans.StockListBean._manager :There is no default persistence unit in this deployment.
                       at org.jboss.injection.PersistenceContextHandler.handleFieldAnnotations(PersistenceContextHandler.java:182)
                       at org.jboss.injection.InjectionUtil.processFieldAnnotations(InjectionUtil.java:137)
                       at org.jboss.injection.InjectionUtil.processAnnotations(InjectionUtil.java:174)
                       at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:358)
                       at org.jboss.ejb3.SessionContainer.processMetadata(SessionContainer.java:140)
                       at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:292)
                       at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:356)
                       at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:91)
                       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       at java.lang.reflect.Method.invoke(Method.java:597)
                       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                       at $Proxy0.start(Unknown Source)
                       at org.jboss.system.ServiceController.start(ServiceController.java:417)
                       at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       at java.lang.reflect.Method.invoke(Method.java:597)
                       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                       at $Proxy33.start(Unknown Source)
                       at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:512)
                       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       at java.lang.reflect.Method.invoke(Method.java:597)
                       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                       at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
                       at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
                       at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
                       at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
                       at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
                       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                       at $Proxy34.start(Unknown Source)
                       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
                       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
                       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
                       at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       at java.lang.reflect.Method.invoke(Method.java:597)
                       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                       at $Proxy9.deploy(Unknown Source)
                       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
                       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
                       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
                       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
                       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
                      2008-03-06 22:26:03,062 INFO [org.jboss.ejb3.EJB3Deployer] Deployed: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                      2008-03-06 22:26:03,093 DEBUG [org.jboss.deployment.MainDeployer] End deployment start on package: StockListApp.ejb3
                      2008-03-06 22:26:03,093 DEBUG [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                      2008-03-06 22:26:03,093 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Watch URL for: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3 -> file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                      2008-03-06 22:26:03,093 ERROR [org.jboss.deployment.scanner.URLDeploymentScanner] Incomplete Deployment listing:
                      
                      --- MBeans waiting for other MBeans ---
                      ObjectName: jboss.j2ee:service=EJB3,module=StockListApp.ejb3
                       State: FAILED
                       Reason: java.lang.RuntimeException: Illegal @PersistenceUnit on private javax.persistence.EntityManager beans.StockListBean._manager :There is no default persistence unit in this deployment.
                      
                      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
                      ObjectName: jboss.j2ee:service=EJB3,module=StockListApp.ejb3
                       State: FAILED
                       Reason: java.lang.RuntimeException: Illegal @PersistenceUnit on private javax.persistence.EntityManager beans.StockListBean._manager :There is no default persistence unit in this deployment.
                      


                      • 8. Re: @PersistenceUnit on private javax.persistence.EntityMana
                        Jeremy Flowers Newbie

                         

                        "ALRubinger" wrote:
                        Nope...your exception is complaining about a lack of default persistence unit. Please take a look at http://trailblazer.demo.jboss.com/EJB3Trail/persistence


                        Have taken a look at this. But now I have a different problem:

                        Here is my persistence.xml
                        persistence>
                         <persistence-unit name="stkcmp">
                         <jta-data-source>java:/DefaultDS</jta-data-source>
                         <properties>
                         <property name="hibernate.hbm2ddl.auto"
                         value="create-drop"/>
                         </properties>
                         </persistence-unit>
                        </persistence>
                        


                        Here is the the updated StockList bean, with exception & unitName to tie in with xml file above:
                        package beans;
                        
                        import beans.Stock;
                        import javax.persistence.PersistenceContext;
                        import javax.ejb.Stateless;
                        import javax.persistence.EntityManager;
                        
                        @Stateless
                        public class StockListBean implements StockList {
                        
                         // The reference to the entity manager
                         @PersistenceContext(unitName="stkcmp")
                         private EntityManager _manager;
                        
                         // The public business methods. These must be coded in the
                         // interface also
                        
                         public String getStock(String ticker) throws StockException {
                         Stock stock = _manager.find(Stock.class, ticker);
                         if (stock == null) {
                         throw new StockException();
                         }
                         return stock.getName();
                         }
                        
                         public void addStock(String ticker, String name) throws StockException {
                         Stock stock = _manager.find(Stock.class, ticker);
                         if (stock != null) {
                         throw new StockException();
                         }
                         _manager.persist(new Stock(ticker, name));
                         }
                        
                         public void updateStock(String ticker, String name) throws StockException {
                         Stock stock = _manager.find(Stock.class, ticker);
                         if (stock == null) {
                         throw new StockException();
                         }
                         stock.setName(name);
                         }
                        
                         public void deleteStock(String ticker) throws StockException {
                         Stock stock = _manager.find(Stock.class, ticker);
                         if (stock == null) {
                         throw new StockException();
                         }
                         _manager.remove(stock);
                         }
                        }
                        

                        Here is the error log:
                        2008-03-06 23:00:47,265 DEBUG [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                        2008-03-06 23:00:47,265 DEBUG [org.jboss.deployment.MainDeployer] Starting deployment (init step) of package at: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                        2008-03-06 23:00:47,265 DEBUG [org.jboss.deployment.MainDeployer] Copying file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3 -> C:\apps\jboss-4.2.2.GA\server\all\tmp\deploy\tmp56278StockListApp.ejb3
                        2008-03-06 23:00:47,265 DEBUG [org.jboss.deployment.MainDeployer] using deployer MBeanProxyExt[jboss.ejb3:service=EJB3Deployer]
                        2008-03-06 23:00:47,265 DEBUG [org.jboss.ejb3.EJB3Deployer] looking for nested deployments in : file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                        2008-03-06 23:00:47,265 DEBUG [org.jboss.deployment.DeploymentInfo] createLoaderRepository from config: LoaderRepositoryConfig(repositoryName: JMImplementation:service=LoaderRepository,name=Default, repositoryClassName: null, configParserClassName: null, repositoryConfig: null)
                        2008-03-06 23:00:47,265 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.UnifiedLoaderRepository3@f1bb78, cl=org.jboss.mx.loading.UnifiedClassLoader3@b6be69{ url=file:/C:/apps/jboss-4.2.2.GA/server/all/tmp/deploy/tmp56278StockListApp.ejb3 ,addedOrder=0}
                        2008-03-06 23:00:47,265 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.UnifiedLoaderRepository3@f1bb78, cl=org.jboss.mx.loading.UnifiedClassLoader3@b6be69{ url=file:/C:/apps/jboss-4.2.2.GA/server/all/tmp/deploy/tmp56278StockListApp.ejb3 ,addedOrder=0}
                        2008-03-06 23:00:47,265 DEBUG [org.jboss.mx.loading.UnifiedLoaderRepository3] Adding org.jboss.mx.loading.UnifiedClassLoader3@b6be69{ url=file:/C:/apps/jboss-4.2.2.GA/server/all/tmp/deploy/tmp56278StockListApp.ejb3 ,addedOrder=0}
                        2008-03-06 23:00:47,265 DEBUG [org.jboss.deployment.MainDeployer] found 0 subpackages of file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                        2008-03-06 23:00:47,265 DEBUG [org.jboss.deployment.MainDeployer] Watching new file: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                        2008-03-06 23:00:47,265 DEBUG [org.jboss.deployment.MainDeployer] create step for deployment file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                        2008-03-06 23:00:47,265 DEBUG [org.jboss.ejb3.EJB3Deployer] create, StockListApp.ejb3
                        2008-03-06 23:00:47,296 DEBUG [org.jboss.ejb3.EJB3Deployer] Deploying: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                        2008-03-06 23:00:47,296 DEBUG [org.jboss.system.ServiceController] Creating service jboss.j2ee:service=EJB3,module=StockListApp.ejb3
                        2008-03-06 23:00:47,296 DEBUG [org.jboss.ejb3.Ejb3Module] Creating jboss.j2ee:service=EJB3,module=StockListApp.ejb3
                        2008-03-06 23:00:47,343 DEBUG [org.jboss.ejb3.Ejb3AnnotationHandler] found EJB3: ejbName=StockListBean, class=beans.StockListBean, type=STATELESS
                        2008-03-06 23:00:47,406 ERROR [org.jboss.ejb3.entity.PersistenceXmlLoader] Error parsing XML: XML InputStream(1) Content is not allowed in prolog.
                        2008-03-06 23:00:47,406 DEBUG [org.jboss.ejb3.Ejb3Module] Initialization failed jboss.j2ee:service=EJB3,module=StockListApp.ejb3
                        org.xml.sax.SAXParseException: Content is not allowed in prolog.
                         at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
                         at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
                         at org.jboss.ejb3.entity.PersistenceXmlLoader.loadURL(PersistenceXmlLoader.java:91)
                         at org.jboss.ejb3.entity.PersistenceXmlLoader.deploy(PersistenceXmlLoader.java:104)
                         at org.jboss.ejb3.Ejb3Deployment.initializePersistenceUnits(Ejb3Deployment.java:535)
                         at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:329)
                         at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:77)
                         at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:260)
                         at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:243)
                         at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:597)
                         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                         at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                         at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                         at $Proxy0.create(Unknown Source)
                         at org.jboss.system.ServiceController.create(ServiceController.java:330)
                         at org.jboss.system.ServiceController.create(ServiceController.java:273)
                         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:597)
                         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                         at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                         at $Proxy33.create(Unknown Source)
                         at org.jboss.ejb3.EJB3Deployer.create(EJB3Deployer.java:492)
                         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:597)
                         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                         at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
                         at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
                         at org.jboss.wsf.container.jboss42.DeployerInterceptor.create(DeployerInterceptor.java:76)
                         at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
                         at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
                         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                         at $Proxy34.create(Unknown Source)
                         at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
                         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
                         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
                         at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:597)
                         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                         at $Proxy9.deploy(Unknown Source)
                         at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
                         at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
                         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
                         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
                         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
                        2008-03-06 23:00:47,406 WARN [org.jboss.system.ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=StockListApp.ejb3
                        org.xml.sax.SAXParseException: Content is not allowed in prolog.
                         at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
                         at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
                         at org.jboss.ejb3.entity.PersistenceXmlLoader.loadURL(PersistenceXmlLoader.java:91)
                         at org.jboss.ejb3.entity.PersistenceXmlLoader.deploy(PersistenceXmlLoader.java:104)
                         at org.jboss.ejb3.Ejb3Deployment.initializePersistenceUnits(Ejb3Deployment.java:535)
                         at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:329)
                         at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:77)
                         at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:260)
                         at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:243)
                         at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:597)
                         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                         at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                         at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                         at $Proxy0.create(Unknown Source)
                         at org.jboss.system.ServiceController.create(ServiceController.java:330)
                         at org.jboss.system.ServiceController.create(ServiceController.java:273)
                         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:597)
                         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                         at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                         at $Proxy33.create(Unknown Source)
                         at org.jboss.ejb3.EJB3Deployer.create(EJB3Deployer.java:492)
                         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:597)
                         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                         at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
                         at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
                         at org.jboss.wsf.container.jboss42.DeployerInterceptor.create(DeployerInterceptor.java:76)
                         at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
                         at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
                         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                         at $Proxy34.create(Unknown Source)
                         at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
                         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
                         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
                         at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:597)
                         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                         at $Proxy9.deploy(Unknown Source)
                         at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
                         at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
                         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
                         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
                         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
                        2008-03-06 23:00:47,437 DEBUG [org.jboss.deployment.MainDeployer] Done with create step of deploying StockListApp.ejb3
                        2008-03-06 23:00:47,437 DEBUG [org.jboss.deployment.MainDeployer] Begin deployment start file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                        2008-03-06 23:00:47,453 DEBUG [org.jboss.ejb3.EJB3Deployer] start application, deploymentInfo: org.jboss.deployment.DeploymentInfo@fe1c38ab { url=file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3 }
                         deployer: MBeanProxyExt[jboss.ejb3:service=EJB3Deployer]
                         status: Starting
                         state: START_DEPLOYER
                         watch: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                         altDD: null
                         lastDeployed: 1204844447265
                         lastModified: 1204844447265
                         mbeans:
                        , short name: StockListApp.ejb3, parent short name: null
                        2008-03-06 23:00:47,453 DEBUG [org.jboss.system.ServiceController] starting service jboss.j2ee:service=EJB3,module=StockListApp.ejb3
                        2008-03-06 23:00:47,453 DEBUG [org.jboss.system.ServiceController] Ignoring start request for service: jboss.j2ee:service=EJB3,module=StockListApp.ejb3
                        2008-03-06 23:00:47,453 INFO [org.jboss.ejb3.EJB3Deployer] Deployed: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                        2008-03-06 23:00:47,453 DEBUG [org.jboss.deployment.MainDeployer] End deployment start on package: StockListApp.ejb3
                        2008-03-06 23:00:47,453 DEBUG [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                        2008-03-06 23:00:47,453 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Watch URL for: file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3 -> file:/C:/apps/jboss-4.2.2.GA/server/all/deploy/StockListApp.ejb3
                        2008-03-06 23:00:47,453 ERROR [org.jboss.deployment.scanner.URLDeploymentScanner] Incomplete Deployment listing:
                        
                        --- MBeans waiting for other MBeans ---
                        ObjectName: jboss.j2ee:service=EJB3,module=StockListApp.ejb3
                         State: FAILED
                         Reason: org.xml.sax.SAXParseException: Content is not allowed in prolog.
                        
                        --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
                        ObjectName: jboss.j2ee:service=EJB3,module=StockListApp.ejb3
                         State: FAILED
                         Reason: org.xml.sax.SAXParseException: Content is not allowed in prolog.
                        

                        Seems to be some sort of XML parsing error.
                        Can't see why this is, since all I did was modify name

                        • 9. Re: @PersistenceUnit on private javax.persistence.EntityMana
                          Jeremy Flowers Newbie

                          Dar. As soon as I posted this I spotted missing opening chevron. first character of xml file!!!

                          • 10. Re: @PersistenceUnit on private javax.persistence.EntityMana
                            Andrew Rubinger Master

                             

                            "JGF1" wrote:
                            Dar. As soon as I posted this I spotted missing opening chevron. first character of xml file!!!


                            Exactly.

                            Though the error messages are long, take the time to look in there for some nested, useful nuggets:

                            org.xml.sax.SAXParseException: Content is not allowed in prolog.


                            S,
                            ALR

                            • 11. Re: @PersistenceUnit on private javax.persistence.EntityMana
                              Jeremy Flowers Newbie

                              Many thanks for your assistance today Andrew.
                              It was greatly appreciated.
                              Everything now works perfectly.

                              • 12. Re: @PersistenceUnit on private javax.persistence.EntityMana
                                Andrew Rubinger Master

                                Great. I encourage you to pay it forward by hanging around the forums, maybe subscribing to your email, and helping other users start out as you gain experience. :)

                                S,
                                ALR