aspose file tools*
The moose likes JBoss/WildFly and the fly likes WAR deployment - XML parser issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "WAR deployment - XML parser issue" Watch "WAR deployment - XML parser issue" New topic
Author

WAR deployment - XML parser issue

Siva Vulchi
Ranch Hand

Joined: Nov 17, 2011
Posts: 30
Hi,

I am using Jboss 6. I have an issue while deploying my WAR file which has Oracle xml parser to this server. It seems to me that, Jboss web container or deployer is trying to use my Oracle XML parser present in my WAR file instead of its own XML parser. And i am getting following deployment error.



Could you please help in making Jboss web container to use its own parser?

Thanks,
Siva
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10266
    
168

Leave out the parser jar from your application packaging.


[My Blog] [JavaRanch Journal]
Siva Vulchi
Ranch Hand

Joined: Nov 17, 2011
Posts: 30
Leave out the parser jar from your application packaging.


Getting classNotFoundException if i leave out that jar..

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5843
    
    7

Is a WAR file all that you have or do you have additional artifacts deployed? The class cast exception is usually due to two different class loaders loading the two classes in question. But since javax.xml.parsers.DocumentBuilderFactory is in the Java runtime, I suspect that there might be multiple JARs with that class.

Edit the run.conf (or run.conf.bat) file to add "-verbose:class" to the JAVA_OPTS and restart the app server. This option causes the JVM to print the location of the JAR file for each class loaded. This generates a lot of output to be sure to redirect stdout and stderr to a file. Then look through the file to see where javax.xml.parsers.DocumentBuilderFactory and oracle.xml.jaxp.JXDocumentBuilderFactory are being loaded from. That should give you some clue as to what went wrong.


JBoss In Action
Siva Vulchi
Ranch Hand

Joined: Nov 17, 2011
Posts: 30
Yes. I do not have any additional artifacts to be deployed.

Edit the run.conf (or run.conf.bat) file to add "-verbose:class" to the JAVA_OPTS and restart the app server. This option causes the JVM to print the location of the JAR file for each class loaded. This generates a lot of output to be sure to redirect stdout and stderr to a file. Then look through the file to see where javax.xml.parsers.DocumentBuilderFactory and oracle.xml.jaxp.JXDocumentBuilderFactory are being loaded from. That should give you some clue as to what went wrong.


Thanks for this good option!!! I will look for the clue with this.
 
 
subject: WAR deployment - XML parser issue