You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Scott Sutherland <su...@ncs.com> on 2000/08/08 23:53:15 UTC

Weblogic 5.1.0, xml4j and jaxp won't play nice...

I've been attempting to automate the creation of deployable jar files
for EJB's used by our current project and have run into a situation
where weblogic and jaxp won't play nice together.

If anyone has experienced the following and developed a ant based
work-around I would greatly appreciate hearing your solution...

The problem manifests itself as a ClassCastException when
weblogic.ejbc is executing on the 'generic' jar file.

Here are the actual exception and stack trace:

AccountBean:
    [javac] Compiling 3 source files to D:\usr\src\pd2.1\AccountEJB\classes
  [copydir] Copying 2 files to D:\usr\src\pd2.1\AccountEJB\classes\META-INF
      [jar] Building jar: D:\usr\src\pd2.1\AccountEJB\account-generic.jar
java.lang.ClassCastException: com.sun.xml.tree.TextNode
        at weblogic.xml.dom.DOMUtils.getOptionalElementsByTagName(DOMUtils.java:204)
        at weblogic.xml.dom.DOMUtils.getOptionalElementByTagName(DOMUtils.java:170)
        at weblogic.xml.dom.DOMUtils.getOptionalValueByTagName(DOMUtils.java:97)
        at weblogic.ejb.deployment.dd.EJBReadDOM.getDescriptionValue(EJBReadDOM.java:404)
        at weblogic.ejb.deployment.dd.DescriptorLoader.createDeploymentUnit(DescriptorLoader.java:200)
        at weblogic.ejbc.runBody(ejbc.java:299)
        at weblogic.utils.compiler.Tool.run(Tool.java:80)
        at weblogic.ejbc.main(ejbc.java:353)
        at java.lang.reflect.Method.invoke(Native Method)
        at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:97)
        at org.apache.tools.ant.taskdefs.Java.run(Java.java:243)
        at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:123)
        at org.apache.tools.ant.taskdefs.Java.execute(Java.java:90)
        at org.apache.tools.ant.Target.execute(Target.java:132)
        at org.apache.tools.ant.Project.runTarget(Project.java:720)
        at org.apache.tools.ant.Project.executeTarget(Project.java:451)
        at org.apache.tools.ant.Project.executeTargets(Project.java:425)
        at org.apache.tools.ant.Main.runBuild(Main.java:298)
        at org.apache.tools.ant.Main.main(Main.java:119)
ERROR: java.lang.ClassCastException: com.sun.xml.tree.TextNode

The problem is associated with conflicts between JAXP and xml4j... I
can execute weblogic.ejbc from the command line if I change the class
path to exclude JAXP jars, but then ant will not run until I add them
back.

Thanks in advance,

Scott

-- 
Scott Sutherland                          National Computer Systems
(319) 354-9200                        Measurement Services Division
suthsc@ncs.com                                        Iowa City, Ia
import my.standard.disclaimer.*;                        GO HAWKS!!!

  "Coding in windows is sort of like writing a biography about a
  person who won't tell you anything about themselves." - jheart8


Re: Weblogic 5.1.0, xml4j and jaxp won't play nice...

Posted by Scott Sutherland <su...@ncs.com>.
>>>>> "RM" == Rod McChesney <ro...@expressaction.com> writes:

RM> Did you try putting the WebLogic stuff first on the classpath?
RM> We're doing this here (I just switched over to ant 3 days ago) and
RM> it works OK despite the potential conflict.

Yep... that fixed it...

Thanks also to "Tim Fennell" <tf...@rcn.com>

Scott

-- 
Scott Sutherland                          National Computer Systems
(319) 354-9200                        Measurement Services Division
suthsc@ncs.com                                        Iowa City, Ia
import my.standard.disclaimer.*;                        GO HAWKS!!!

  "Coding in windows is sort of like writing a biography about a
  person who won't tell you anything about themselves." - jheart8


RE: Weblogic 5.1.0, xml4j and jaxp won't play nice...

Posted by Tim Fennell <tf...@rcn.com>.
I've come up against this too, and concurr. It should work fine if you put the
weblogic jars/dirs in the classpath ahead of parser.jar. It would appear that
WebLogic's tools request a jaxp compliant parser, but then try to downcast some
of the DOM objects returned to more specific classes. The downcast only works
with the xml4j parser.  Tsk tsk.

-t

-----Original Message-----
From: Rod McChesney [mailto:rodm@expressaction.com]
Sent: Tuesday, August 08, 2000 17:56
To: ant-dev@jakarta.apache.org
Subject: Re: Weblogic 5.1.0, xml4j and jaxp won't play nice...


Did you try putting the WebLogic stuff first on the classpath? We're
doing this here (I just switched over to ant 3 days ago) and it works
OK despite the potential conflict.

Rod

Scott Sutherland wrote:
>
> I've been attempting to automate the creation of deployable jar files
> for EJB's used by our current project and have run into a situation
> where weblogic and jaxp won't play nice together.
>
> If anyone has experienced the following and developed a ant based
> work-around I would greatly appreciate hearing your solution...
>
> The problem manifests itself as a ClassCastException when
> weblogic.ejbc is executing on the 'generic' jar file.
>
> Here are the actual exception and stack trace:
>
> AccountBean:
>     [javac] Compiling 3 source files to D:\usr\src\pd2.1\AccountEJB\classes
>   [copydir] Copying 2 files to D:\usr\src\pd2.1\AccountEJB\classes\META-INF
>       [jar] Building jar: D:\usr\src\pd2.1\AccountEJB\account-generic.jar
> java.lang.ClassCastException: com.sun.xml.tree.TextNode
>         at
weblogic.xml.dom.DOMUtils.getOptionalElementsByTagName(DOMUtils.java:204)
>         at
weblogic.xml.dom.DOMUtils.getOptionalElementByTagName(DOMUtils.java:170)
>         at
weblogic.xml.dom.DOMUtils.getOptionalValueByTagName(DOMUtils.java:97)
>         at
weblogic.ejb.deployment.dd.EJBReadDOM.getDescriptionValue(EJBReadDOM.java:404)
>         at
weblogic.ejb.deployment.dd.DescriptorLoader.createDeploymentUnit(DescriptorLoade
r.java:200)
>         at weblogic.ejbc.runBody(ejbc.java:299)
>         at weblogic.utils.compiler.Tool.run(Tool.java:80)
>         at weblogic.ejbc.main(ejbc.java:353)
>         at java.lang.reflect.Method.invoke(Native Method)
>         at
org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:97)
>         at org.apache.tools.ant.taskdefs.Java.run(Java.java:243)
>         at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:123)
>         at org.apache.tools.ant.taskdefs.Java.execute(Java.java:90)
>         at org.apache.tools.ant.Target.execute(Target.java:132)
>         at org.apache.tools.ant.Project.runTarget(Project.java:720)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:451)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:425)
>         at org.apache.tools.ant.Main.runBuild(Main.java:298)
>         at org.apache.tools.ant.Main.main(Main.java:119)
> ERROR: java.lang.ClassCastException: com.sun.xml.tree.TextNode
>
> The problem is associated with conflicts between JAXP and xml4j... I
> can execute weblogic.ejbc from the command line if I change the class
> path to exclude JAXP jars, but then ant will not run until I add them
> back.
>
> Thanks in advance,
>
> Scott
>
> --
> Scott Sutherland                          National Computer Systems
> (319) 354-9200                        Measurement Services Division
> suthsc@ncs.com                                        Iowa City, Ia
> import my.standard.disclaimer.*;                        GO HAWKS!!!
>
>   "Coding in windows is sort of like writing a biography about a
>   person who won't tell you anything about themselves." - jheart8


Re: Weblogic 5.1.0, xml4j and jaxp won't play nice...

Posted by Rod McChesney <ro...@expressaction.com>.
Did you try putting the WebLogic stuff first on the classpath? We're
doing this here (I just switched over to ant 3 days ago) and it works
OK despite the potential conflict.

Rod

Scott Sutherland wrote:
> 
> I've been attempting to automate the creation of deployable jar files
> for EJB's used by our current project and have run into a situation
> where weblogic and jaxp won't play nice together.
> 
> If anyone has experienced the following and developed a ant based
> work-around I would greatly appreciate hearing your solution...
> 
> The problem manifests itself as a ClassCastException when
> weblogic.ejbc is executing on the 'generic' jar file.
> 
> Here are the actual exception and stack trace:
> 
> AccountBean:
>     [javac] Compiling 3 source files to D:\usr\src\pd2.1\AccountEJB\classes
>   [copydir] Copying 2 files to D:\usr\src\pd2.1\AccountEJB\classes\META-INF
>       [jar] Building jar: D:\usr\src\pd2.1\AccountEJB\account-generic.jar
> java.lang.ClassCastException: com.sun.xml.tree.TextNode
>         at weblogic.xml.dom.DOMUtils.getOptionalElementsByTagName(DOMUtils.java:204)
>         at weblogic.xml.dom.DOMUtils.getOptionalElementByTagName(DOMUtils.java:170)
>         at weblogic.xml.dom.DOMUtils.getOptionalValueByTagName(DOMUtils.java:97)
>         at weblogic.ejb.deployment.dd.EJBReadDOM.getDescriptionValue(EJBReadDOM.java:404)
>         at weblogic.ejb.deployment.dd.DescriptorLoader.createDeploymentUnit(DescriptorLoader.java:200)
>         at weblogic.ejbc.runBody(ejbc.java:299)
>         at weblogic.utils.compiler.Tool.run(Tool.java:80)
>         at weblogic.ejbc.main(ejbc.java:353)
>         at java.lang.reflect.Method.invoke(Native Method)
>         at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:97)
>         at org.apache.tools.ant.taskdefs.Java.run(Java.java:243)
>         at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:123)
>         at org.apache.tools.ant.taskdefs.Java.execute(Java.java:90)
>         at org.apache.tools.ant.Target.execute(Target.java:132)
>         at org.apache.tools.ant.Project.runTarget(Project.java:720)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:451)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:425)
>         at org.apache.tools.ant.Main.runBuild(Main.java:298)
>         at org.apache.tools.ant.Main.main(Main.java:119)
> ERROR: java.lang.ClassCastException: com.sun.xml.tree.TextNode
> 
> The problem is associated with conflicts between JAXP and xml4j... I
> can execute weblogic.ejbc from the command line if I change the class
> path to exclude JAXP jars, but then ant will not run until I add them
> back.
> 
> Thanks in advance,
> 
> Scott
> 
> --
> Scott Sutherland                          National Computer Systems
> (319) 354-9200                        Measurement Services Division
> suthsc@ncs.com                                        Iowa City, Ia
> import my.standard.disclaimer.*;                        GO HAWKS!!!
> 
>   "Coding in windows is sort of like writing a biography about a
>   person who won't tell you anything about themselves." - jheart8