-
1. Re: ejb-jar.xml Schema verification fails
logankiefer Jun 7, 2006 7:07 PM (in response to logankiefer)Is the issue I'm having related to Jira Ticket JBAS-2282 - JBossEntityResolver is not using schemaLocation URIs that are valid non-file URLs?
http://jira.jboss.com/jira/browse/JBAS-2282 -
2. Re: ejb-jar.xml Schema verification fails
logankiefer Jun 22, 2006 6:19 PM (in response to logankiefer)I still have a problem with updating the xsd in the deployment but have gotten further. It seems I was compiling in JDK 1.4. Once I compiled my code in JDK 1.5 I can deploy successfully. But now I get a ClassCastException when attempting to lookup the EJB home interface. The exception occurs during a PortableRemote.narrow in the jdk code itself. Debugging it shows that the Proxy being casted is not the EJB Home interface that I'm expecting. It doesn't look like anything I'm expecting. Of course when I revert the jboss.xml and the ejb-jar.xml file to the previous state DTD and XSD then all works well. I'll post the details when I test it again.
-
3. Re: ejb-jar.xml Schema verification fails
logankiefer Jun 22, 2006 7:32 PM (in response to logankiefer)In my ejb-jar.xml I change this:
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
to this:
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
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"
version="3.0">
When I deploy I get a viloation error saying that
<res-auth>CONTAINER</res-auth> needs to be either 'Container' or 'Application'. It seems it did not like CONTAINER being in all caps.
org.jboss.xb.binding.JBossXBException: Failed to parse source: cvc-enumeration-valid: Value 'CONTAINER' is not facet-valid with respect to enumeration '[Application, Container]'. It must be a value from the enumeration.
So, I change this to 'Container' and it deploys successfully.
The next error I get makes no sense it says:
org.jboss.xb.binding.JBossXBException: Failed to parse source: The content of element type "resource-ref" must match "(res-ref-name,resource-name)". @ *unknown*[11,25]
I believe this is referring to the jboss.xml file. I'm using a jndi-name instead of a resource-name which is legal.
<resource-ref>
<res-ref-name>jdbc/DS</res-ref-name>
<jndi-name>java:/DS</jndi-name>
</resource-ref>
Any ideas? -
4. Re: ejb-jar.xml Schema verification fails
bill.burke Jun 22, 2006 7:50 PM (in response to logankiefer)use ejb-jar.xml's
<resource-ref> <res-ref-name>... <mapped-name>java:/DS</mapped-name>
-
5. Re: ejb-jar.xml Schema verification fails
logankiefer Jun 22, 2006 8:32 PM (in response to logankiefer)I tried putting the mapped-name tag in like so in my ejb-jar.xml file
<resource-ref>
database reference
<res-ref-name>jdbc/DS</res-ref-name>
<mapped-name>java:/DS</mapped-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
and removed all the resource-ref tags from the jboss.xml file and got this message:
Failed to parse source: cvc-complex-type.2.4.a: Invalid content was found starting with element 'res-type'. One of '{"http://java.sun.com/xml/ns/javaee":injection-target}' is expected. @ *unknown*[39,27]
It seems like it is complaining about the line right after I put the <mapped-name> tag in. -
6. Re: ejb-jar.xml Schema verification fails
logankiefer Jun 22, 2006 9:10 PM (in response to logankiefer)What's interesting is that when I upgrade the jboss.xml file to use the xsd for jboss_5.0.xsd deployment seems to be all good:
<jboss
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
version="3.0">
However at runtime I get a ClassCastException doing a JNDI lookup on the Home interface.
Below is the call
EJBHome home = (EJBHome)PortableRemoteObject.narrow(
context.lookup(sJNDIName),narrowTo);
The sJNDIName has the correct name in it however when I inspect the value of 'context.lookup(sJNDIName)' it has the value:
jboss.j2ee:ear=treetop.ear,jar=TreeTop_Controllers.jar,name=ManageSubassetController,service=EJB3:a2a2-yd8fkv-eorsjc28-1-eoruc8m5-17
instead of the ejb/HelloWorldHome value.
this causes a ClassCastException in the narrowing part of the code in the PortableRemoteObject's narrow method.
And all I changed was the ejb-jar.xml and jboss.xml to the latest xsd versions and changed the CONTAINER value to be lowercase. -
7. Re: ejb-jar.xml Schema verification fails
logankiefer Jun 24, 2006 7:52 PM (in response to logankiefer)Refresher. I'm using JBoss 4.0.4GA with EJB RC7. My current ejbs are all 2.0 ejbs and I want to keep using the deployment descriptors.
When I change the ejb-jar.xml to use ejb-jar_3.0.xsd the context.lookup(jndiName) is returning a proxy that does not extend the EJBHome interface. If I change back to the ejb-jar_2.0.dtd the EJBHome does extend javax.ejb.EJBHome.
Does this mean in order for my EJB 2.0 beans to be EJB 3.0 compliant (i.e. use ejb-jar_3.0.xsd) I must now remove all occurances of casting the Proxy object, returned from a context.lookup, to EJBHome??? -
8. Re: ejb-jar.xml Schema verification fails
logankiefer Jun 24, 2006 8:58 PM (in response to logankiefer)The schema verfication works for me now. The solution for me was to just use the correct version of the schema:
ejb-jar_3_0.xsd for the ejb.jar.xml
jboss_4_0.dtd for the jboss.xml
Then I needed to change CONTAINER to Container in the ejb-jar.xml file.
I also had to ensure that the jboss.xml file was correct. I did eventually get the mapped_name to work in the ejb-jar.xml file.
I don't have any more verification errors but I still have the classCastException.
I'm going to start a different thread for that since it longer falls under this thread of verification failure.