File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant build - With weblogic 10 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant build - With weblogic 10" Watch "Ant build - With weblogic 10" New topic
Author

Ant build - With weblogic 10

Karthika Kannan
Greenhorn

Joined: Feb 18, 2006
Posts: 19
Hi everyone,

I am trying to build an ejb jar for Weblogic 10, using Ant in Eclipse. I am getting the exception below:

java.lang.NoClassDefFoundError: weblogic/utils/NestedException
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.newInstance0(Class.java:326)
at java.lang.Class.newInstance(Class.java:308)
at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:147)
at javax.xml.parsers.FactoryFinder.findJarServiceProvider(FactoryFinder.java:294)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:221)
at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:128)
at org.apache.tools.ant.util.JAXPUtils.newParserFactory(JAXPUtils.java:114)
at org.apache.tools.ant.util.JAXPUtils.getNSParserFactory(JAXPUtils.java:100)
at org.apache.tools.ant.util.JAXPUtils.getNamespaceXMLReader(JAXPUtils.java:163)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:193)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:140)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.parseBuildFile(InternalAntRunner.java:191)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:400)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)

This seems to be becuase the older weblogic jar had an "weblogic/utils/NestedException", but the Weblogic10 jar has a class "weblogic/auddi/NestedException".

I tried using the Ant in the Weblogic 10 folder also, with no success.

Any suggestions would be very helpful.

Thanks.

Regards,
Karthika
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi Karthika,

It means that it's still trying to look for that old class instead of the new one. Are you sure that the ANT task supports WL10 and that everything is correct on your CLASSPATH?


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Arun Rama
Greenhorn

Joined: Jun 01, 2009
Posts: 2
HI Karthika

I am also getting same build error with Weblogic 10. Were you able to solve your issue? Please let me know.

Julien Rebel
Greenhorn

Joined: Jun 12, 2009
Posts: 1
I got the same error, it's because i try to compile autotype with the weblogic 10 library.
But now with weblogic 10 i need to use JAX-WS and for the generation the tool XJC.
So there is some changes to do with the ant task ...
rajabhayya Sekharbhayya
Greenhorn

Joined: Oct 23, 2008
Posts: 14
I am getting the below error while runing build.xml please suggest me , wht is error ?
i have weblogic.jar in classpath , i am using eclipse . Please tell me wht is class it is not finding

BUILD FAILED
java.lang.NoClassDefFoundError: weblogic/utils/NestedException
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at javax.xml.parsers.FactoryFinder.newInstance(Unknown Source)
at javax.xml.parsers.FactoryFinder.findJarServiceProvider(Unknown Source)
at javax.xml.parsers.FactoryFinder.find(Unknown Source)
at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source)
at org.apache.tools.ant.util.JAXPUtils.newParserFactory(JAXPUtils.java:120)
at org.apache.tools.ant.util.JAXPUtils.getNSParserFactory(JAXPUtils.java:104)
at org.apache.tools.ant.util.JAXPUtils.getNamespaceXMLReader(JAXPUtils.java:172)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:185)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:140)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.parseBuildFile(InternalAntRunner.java:191)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:400)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
Caused by: java.lang.ClassNotFoundException: weblogic.utils.NestedException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 29 more
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

rajabhayya, welcome to Java Ranch!

Please use real words. 'wht' is not a word.

The simple answer is: make sure the JAR file containing weblogic.utils.NestedException.class is in the classpath for your Ant task. But without the details of what your build.xml does, and what you have done to debug this issue (you did try running with the -v option, right?) it is hard to help you more than that.

http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch


JBoss In Action
rajabhayya Sekharbhayya
Greenhorn

Joined: Oct 23, 2008
Posts: 14
Please find the build.xml file




I am getting error at build-client target , and error is displayed as below

Buildfile: D:\Raja1\Demo4\build\build.xml
clean:
[echo] Raja Completed cleaning
build-client:

BUILD FAILED
D:\Raja1\Demo4\build\build.xml:17: java.lang.NoClassDefFoundError: weblogic/diagnostics/debug/DebugLogger

Total time: 471 milliseconds


From above error, i understood that clean is working fine , but build-client target is not working, and it is not finding ClientGenTask class, and I placed weblogic.jar in project class path and i added them too in windows->preferences->ant runtime libraries in eclipse , but still getting same error, any suggestions are really helpful
rajabhayya Sekharbhayya
Greenhorn

Joined: Oct 23, 2008
Posts: 14
I am providing some more information

I am using weblogic server 10.3 and eclipse for Java EE IDE 1.2 version .
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

It's failing in the 'clientgen' task which is a task specific to weblogic. You need to find out how to set the classpath for that task and add the weblogic jar files there.
rajabhayya Sekharbhayya
Greenhorn

Joined: Oct 23, 2008
Posts: 14
Hi Peter

, I got the clientGen error resolved and after that I got
NoClassDefFoundError : weblogic/diagnostics/debug/DebugLogger

Thats also resolved , After that I got stuck up by the below error

Buildfile: D:\Raja1\Demo1\build\build.xml
clean:
[echo] Raja Completed cleaning
[echo] ${weblogic.jar.classpath}
build-client:
[echo] ${weblogic.jar.classpath}
[clientgen] Ignoring JAX-WS options - building a JAX-RPC client

BUILD FAILED
D:\Raja1\Demo1\build\build.xml:18: java.lang.NoClassDefFoundError: com/bea/xml/XmlException

, and the error is shown is below target

<target name="build-client">
<echo>${weblogic.jar.classpath}</echo>
<clientgen wsdl="http://localhost:8002/parlayx21/presence/PresenceConsumer?WSDL" destDir="src/raja" />
<javac srcdir="${clientclass-dir}" destdir="${clientclass-dir}" includes="**/*.java" />
</target>

There are 3 concerns in this regard

1) I dont think , that weblogic.jar is not in classpath , since my previous 2 errors are resolved, now I opened my weblogic.jar and I found com\bea\xml contains only registry folder, there is no XMLException class, so why its referring to ?

2) I am much more not understood if that exception is related to weblogic.jar or any other jar.

3) when I use this statment [echo] ${weblogic.jar.classpath}
, it is not printing the classpath, it is printing {weblogic.jar.classpath}
Does it mean that , still weblogic.jar is not in classpath ?


please help me in this regards.

Regards
Raja

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

1, 2) Apparently there is yet another JAR file you are missing. I have no idea which jar file contains the com/bea/xml/XmlException class (I don't use weblogic). Try this tool to lookup classes in jar files: http://www.isocra.com/2006/02/jarfinder/

3) You cannot echo out path references, only properties. Some tasks print out the classpath when you supply the -v option to ant.
rajabhayya Sekharbhayya
Greenhorn

Joined: Oct 23, 2008
Posts: 14
Hi Peter,

I have done the following thing

In javacious site , i found that xmlexception is contained in totally 4 classes, so I added xmlbeans-1.0 jar in classpath
and that error is resolved, now i got one more error, when I run build.xml , i got new error


BUILD FAILED
D:\Raja1\Demo1\build\build.xml:16: java.lang.NoClassDefFoundError: com/bea/staxb/buildtime/internal/tylar/Tylar

I found the jar as com.bea.core.xml.staxb.buildtime_1.3.0.0 jar , but it does not contain tylar folder in internal folder

and when I run again, it does not again, since it doesnt contain tylar folder

Any idea to which jar it belongs to ?

Regards
Rajasekhar
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

I gave you a link to the isocra jarfinder tool - download it and use it to locate the jar file for the missing class.
rajabhayya Sekharbhayya
Greenhorn

Joined: Oct 23, 2008
Posts: 14
Hi Peter

I got resolved that error, i manually searched from c:\bea\modules folder and got the required jar files,

When I tried to build , i got the below error

BUILD FAILED
D:\Raja1\Demo1\build\build.xml:15: java.lang.NoSuchFieldError: METADATA_PACKAGE_GEN

This is occuring at same target ,

I did a lot of googling , but i could not find any one encountered with this problem, I am sure it is not a jar problem .

and ClientGen is recognized properly now, because when i click ctrl+enter it is showing clientGen attributes .

have you ever by chance , got this error message ?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

The error you posted, was that the entire error or was there a full stack trace? If there was a full stack trace then that should give some clue as to what is wrong. If there was no full stack trace, try running ant with the -v option - that should cause it to output the full stack trace.

Either way, I think that at this point it is an error noted by ClientGen, in which case you might want to bring it up in the WebLogic forum.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ant build - With weblogic 10
 
Similar Threads
uPortal + ant
Build Error with Weblogic10.3 and Ant 1.6.5
Why doesn't the JUnit test OUTPUT appear using the Ant build?
Ant build in Beginning Hibernate
weblogic 10 web service Standalone client issue