-
1. Re: Migration issue from jboss-4.0.3SP1 to jboss-5.1.0.GA. : org.xml.sax.S AXException: Element type "res-type" must be declared.
wolfgangknauf Jun 28, 2011 10:10 AM (in response to maltiyadav)In jboss-web.xml, remove the two lines "res-type" - the "resource-ref" does not have this child element according to the DTD.
JBoss 5 became stricter on XML validation.
Best regards
Wolfgang
-
2. Re: Migration issue from jboss-4.0.3SP1 to jboss-5.1.0.GA. : org.xml.sax.S AXException: Element type "res-type" must be declared.
maltiyadav Jun 30, 2011 12:46 AM (in response to wolfgangknauf)Thanks for the reply..i have removed "res-type" tag from the xml file then getting deployment exception.
see below the edited jboss-web.xml file for your reference.I have tried all the cominations with different dtd versions but deployment issue is coming.
Exception:
DEPLOYMENTS IN ERROR:
Deployment "vfszip:/E:/JBOSS/JBOSS_5.1/jboss-5.1.0.GA/jboss-5.1.0.GA/server/de
fault/deploy/application.war/" is in error due to the following reason(s): org.jboss.dep
loyers.spi.DeploymentException: URL file:/E:/JBOSS/JBOSS_5.1/jboss-5.1.0.GA/jbos
s-5.1.0.GA/server/default/tmp/4sm4i5d-a3d0oe-gphs4cfl-1-gphs527k-9r/application.war/ dep
loyment failed
jboss-web.xml :
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE jboss-web
PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
<jboss-web>
<resource-ref>
<res-ref-name>jdbc/SampleDS</res-ref-name>
<jndi-name>java:/jdbc/SampleDS</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>jdbc/ReportDS</res-ref-name>
<jndi-name>java:/jdbc/ReportDS</jndi-name>
</resource-ref>
</jboss-web>
Used jars in the application:
-
3. Re: Migration issue from jboss-4.0.3SP1 to jboss-5.1.0.GA. : org.xml.sax.S AXException: Element type "res-type" must be declared.
wdfink Jun 29, 2011 1:56 AM (in response to maltiyadav)XML look valid, can you attach the complete logfile there must be a Exception or hint before the deployment result is logged.
-
4. Re: Migration issue from jboss-4.0.3SP1 to jboss-5.1.0.GA. : org.xml.sax.S AXException: Element type "res-type" must be declared.
maltiyadav Jun 29, 2011 2:07 AM (in response to wdfink)attaching server log file.
-
server.log.zip 5.2 KB
-
-
5. Re: Migration issue from jboss-4.0.3SP1 to jboss-5.1.0.GA. : org.xml.sax.S AXException: Element type "res-type" must be declared.
wolfgangknauf Jun 29, 2011 3:47 AM (in response to maltiyadav)Hi,
your app contains "XercesImpl.jar" - don't deploy this, because it will cause conflicts with the Xerces version that is bundled with JBoss. Taking a look at your file list, I suggest to:
-kick "log4j.jar" (also contained in JBoss).
-remove "j2ee.jar" - in general don't bundle JavaEE APIs. "jms.jar" might be another candidate, because JBoss contains a JMS implementation.
-I am not sure about "xmlParserAPIs.jar", maybe this will cause more trouble.
So remove one jar, check for errors and try to find out which JAR might cause a conflict.
Hope this helps
Wolfgang
-
6. Re: Migration issue from jboss-4.0.3SP1 to jboss-5.1.0.GA. : org.xml.sax.S AXException: Element type "res-type" must be declared.
maltiyadav Jun 29, 2011 6:20 AM (in response to wolfgangknauf)Hi,
As you suggested i have removed XercesImpl.jar, jms.jar, xmlParserAPIs.jar and tried to deploy but the same deployment exception is coming.
I tried to remove log4j and j2ee jars but was throwing build fail error so reverted back
-
7. Re: Migration issue from jboss-4.0.3SP1 to jboss-5.1.0.GA. : org.xml.sax.S AXException: Element type "res-type" must be declared.
maltiyadav Jun 30, 2011 12:47 AM (in response to maltiyadav)Now in the logs it gives different error attaching logs:
2011-06-29 15:38:15,238 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/application]] (main) Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory
-
server.log.zip 12.9 KB
-
-
8. Re: Migration issue from jboss-4.0.3SP1 to jboss-5.1.0.GA. : org.xml.sax.S AXException: Element type "res-type" must be declared.
wolfgangknauf Jun 29, 2011 8:51 AM (in response to maltiyadav)Well, the error looks a little bit different, but still a Xerces conflict... Did you check that your deployed app really does not contain "XercesImpl.jar"? Depending on the tool you use to create your deployment, it might still happen that you exclude the JAR, but it is still deployed.
And you might also check whether any other JAR file directly includes the Xerces classes, without using a JAR file.
How do you create your deployment and how do you edit your project? Eclipse? Maven? Removing the J2EE jars from deployment should be possible, so that they are only present at compile time.
Best regards
Wolfgang
-
9. Re: Migration issue from jboss-4.0.3SP1 to jboss-5.1.0.GA. : org.xml.sax.S AXException: Element type "res-type" must be declared.
maltiyadav Jun 30, 2011 2:29 AM (in response to wolfgangknauf)Finally i am able to resolve the error, i have removed xmlParserAPIs.jar,xercesImpl.jar,jaxp-api.jar from everywhere.And excluded these jars from the build.xml.
I am using eclipse IDE and Ant build tool.
Now facing other issue which talks about linkage error.Not sure its coming because of removing above jars or anything else.
attaching server.log...please have a look and let me know your view.
Many thanks..
-
server.log.zip 6.2 KB
-
-
10. Re: Migration issue from jboss-4.0.3SP1 to jboss-5.1.0.GA. : org.xml.sax.S AXException: Element type "res-type" must be declared.
wolfgangknauf Jun 30, 2011 4:14 AM (in response to maltiyadav)Hi,
I paste the error here so that other people who are googleing for the error message might find this post:
2011-06-30 11:42:50,968 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/lms]] (main) Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.LinkageError: loader constraint violation: when resolving method "javax.xml.parsers.DocumentBuilder.setErrorHandler(Lorg/xml/sax/ErrorHandler;)V" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, org/springframework/beans/factory/xml/XmlBeanDefinitionReader, and the class loader (instance of <bootloader>) for resolved class, javax/xml/parsers/DocumentBuilder, have different Class objects for the type org/xml/sax/ErrorHandler used in the signature
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.createDocumentBuilder(XmlBeanDefinitionReader.java:270)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:221)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:173)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:148)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:129)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:145)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:126)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:262)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:139)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:252)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4393)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
A similar error can be found here:
http://www.coderanch.com/t/526834/JBoss/Linkage-Error-LOG
This pointed me to another question: what Java version do you use? Depending on the version of JDK, you have to download a JBoss version for JDK 1.5 or JDK 1.6. Could you check that you picked a matching combination of JBoss/JDK?
Best regards
Wolfgang