users@glassfish.java.net

Re: persistence-context-ref in ejb-jar.xml

From: <glassfish_at_javadesktop.org>
Date: Tue, 22 May 2007 07:58:46 PDT

Hi ken,
Thank you for your detailed explanation.
Using related xml schema I figure out what I did wrong.
Description in the book was correct I just didn't know that <ejb-name>midwood</ejb-name>
is required element.
But I still have problem with deployment.
Here is my file:
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns = "http://java.sun.com/xml/ns/javaee"
         version = "3.0"
         xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
  <enterprise-beans>
    <session>
      <ejb-name>midwood</ejb-name>
      <persistence-context-ref>
        <persistence-context-ref-name>persistence/midwood</persistence-context-ref-name>
        <persistence-unit-name>medbase</persistence-unit-name>
      </persistence-context-ref>
    </session>
  </enterprise-beans>
</ejb-jar>

For some reason Netbeans 5.5.1 can't deploy application.
I tried verification and got the following message:

Could not verify successfully.
java.lang.RuntimeException: Error processing EjbDescriptor
        at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:281)
        at com.sun.enterprise.deployment.EjbDescriptor.visit(EjbDescriptor.java:2058)
        at com.sun.enterprise.deployment.EjbBundleDescriptor.visit(EjbBundleDescriptor.java:734)
        at com.sun.enterprise.deployment.archivist.EjbArchivist.validate(EjbArchivist.java:190)
        at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openArchive(ApplicationArchivist.java:790)
        at com.sun.enterprise.tools.verifier.VerificationHandler.createApplicationDescriptor0(VerificationHandler.java:464)
        at com.sun.enterprise.tools.verifier.VerificationHandler.createApplicationDescriptor(VerificationHandler.java:265)
        at com.sun.enterprise.tools.verifier.VerificationHandler.initStandalone(VerificationHandler.java:216)
        at com.sun.enterprise.tools.verifier.VerificationHandler.<init>(VerificationHandler.java:109)
        at com.sun.enterprise.tools.verifier.Verifier.verify(Verifier.java:140)
        at com.sun.enterprise.tools.verifier.Verifier.main(Verifier.java:114)
Caused by: java.lang.NullPointerException
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:269)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
        at com.sun.enterprise.util.ConnectorClassLoader.loadClass(ConnectorClassLoader.java:199)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:238)
        ... 10 more

Keep in mind that XML validation was successful.
Please tell me if you have idea why this happened?
Can I use both ejb-jar.xml and sun-ejb-jar.xml in the same application?

Thank you,
Vladimir
[Message sent by forum member 'vladperl' (vladperl)]

http://forums.java.net/jive/thread.jspa?messageID=218345