How to handle error java.lang.RuntimeException/NullPointerException
<p>I follow this tutorial about "JPA in Web Service"(<a href="http://www.netbeans.org/kb/61/javaee/persistence.html" rel="nofollow">http://www.netbeans.org/kb/61/javaee/persistence.html</a>).</p>

<p>i follow this tutorial step by step, and when i compile the code , i have no problem. But when i run the program i got many error</p>

<p>i already download the finish project, but it still same error, any way to handle this error?</p>

<p>thx</p>

<pre><code>    CORE5061: Exception : 
    java.lang.NullPointerException
            at com.sun.enterprise.util.InvocationManagerImpl.preInvoke(InvocationManagerImpl.java:136)
            at com.sun.appserv.server.ServerLifecycleModule.preInvoke(ServerLifecycleModule.java:178)
            at com.sun.appserv.server.ServerLifecycleModule.postEvent(ServerLifecycleModule.java:219)
            at com.sun.appserv.server.ServerLifecycleModule.onTermination(ServerLifecycleModule.java:277)
            at com.sun.appserv.server.LifecycleModuleService.onTermination(LifecycleModuleService.java:496)
            at com.sun.enterprise.server.ApplicationServer.onTermination(ApplicationServer.java:591)
            at com.sun.enterprise.server.PEMain.run(PEMain.java:432)
            at com.sun.enterprise.server.PEMain.main(PEMain.java:336)
            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 com.sun.enterprise.server.PELaunch.main(PELaunch.java:415)

java.lang.RuntimeException: EMBEDDED Broker start failure:code = 1
        at com.sun.messaging.jms.ra.EmbeddedBrokerRunner.start(EmbeddedBrokerRunner.java:268)
        at com.sun.messaging.jms.ra.ResourceAdapter.start(ResourceAdapter.java:472)
        at com.sun.enterprise.connectors.ActiveInboundResourceAdapter$1.run(ActiveInboundResourceAdapter.java:178)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.enterprise.connectors.ActiveInboundResourceAdapter.startResourceAdapter(ActiveInboundResourceAdapter.java:174)
        at com.sun.enterprise.connectors.ActiveInboundResourceAdapter.&lt;init&gt;(ActiveInboundResourceAdapter.java:132)
        at com.sun.enterprise.connectors.system.ActiveJmsResourceAdapter.&lt;init&gt;(ActiveJmsResourceAdapter.java:234)
        at com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:107)
        at com.sun.enterprise.connectors.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:300)
        at com.sun.enterprise.connectors.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:445)
        at com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:230)
        at com.sun.enterprise.jms.JmsProviderLifecycle.onStartup(JmsProviderLifecycle.java:428)
        at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:446)
        at com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:134)
        at com.sun.enterprise.server.PEMain.run(PEMain.java:409)
        at com.sun.enterprise.server.PEMain.main(PEMain.java:336)
        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 com.sun.enterprise.server.PELaunch.main(PELaunch.java:415)
RAR6035 : Resource adapter start failed : {0}
javax.resource.spi.ResourceAdapterInternalException: MQJMSRA_RA4001: start:Aborting:Exception starting EMBEDDED broker=EMBEDDED Broker start failure:code = 1
        at com.sun.messaging.jms.ra.ResourceAdapter.start(ResourceAdapter.java:476)
        at com.sun.enterprise.connectors.ActiveInboundResourceAdapter$1.run(ActiveInboundResourceAdapter.java:178)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.enterprise.connectors.ActiveInboundResourceAdapter.startResourceAdapter(ActiveInboundResourceAdapter.java:174)
        at com.sun.enterprise.connectors.ActiveInboundResourceAdapter.&lt;init&gt;(ActiveInboundResourceAdapter.java:132)
        at com.sun.enterprise.connectors.system.ActiveJmsResourceAdapter.&lt;init&gt;(ActiveJmsResourceAdapter.java:234)
        at com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:107)
        at com.sun.enterprise.connectors.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:300)
        at com.sun.enterprise.connectors.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:445)
        at com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:230)
        at com.sun.enterprise.jms.JmsProviderLifecycle.onStartup(JmsProviderLifecycle.java:428)
        at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:446)
        at com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:134)
        at com.sun.enterprise.server.PEMain.run(PEMain.java:409)
        at com.sun.enterprise.server.PEMain.main(PEMain.java:336)
        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 com.sun.enterprise.server.PELaunch.main(PELaunch.java:415)
Caused by: java.lang.RuntimeException: EMBEDDED Broker start failure:code = 1
        at com.sun.messaging.jms.ra.EmbeddedBrokerRunner.start(EmbeddedBrokerRunner.java:268)
        at com.sun.messaging.jms.ra.ResourceAdapter.start(ResourceAdapter.java:472)
        ... 19 more
</code></pre>
