Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
Custom Task Error

Custom Task Error

2003-03-06       - By Witham, Darren (Contractor)
Reply:     1     2     3     4  


Hi,

 I am working with a very large generated build file and have had the need to
write an Ant task to ping Weblogic and continue when it is up.

 I have written a simple user task that has about 3 lines in the execute
method. I have made use of a Weblogic class to connect to the server (T3Client)
. This code works fine when I just run it from my IDE however when I run it as
an Ant task i.e set up task in build file and invoke it - the code doesn't work
. I am supplying the correct classpath's etc as the stacktrace shows the error
occuring within the T3Client code...

[wlping] java.lang.ExceptionInInitializerError: java.lang.NullPointerException
[wlping]     at weblogic.utils.classloaders.ServletClassFinder.<init>
(ServletClassFinder.java:32)
[wlping]     at weblogic.j2ee.ApplicationManager.getFinder(ApplicationManager
.java:283)
[wlping]     at weblogic.j2ee.ApplicationManager.loadFromNetwork
(ApplicationManager.java:261)
[wlping]     at weblogic.j2ee.ApplicationManager.loadClass(ApplicationManager
.java:194)
[wlping]     at weblogic.j2ee.ApplicationManager.loadClass(ApplicationManager
.java:106)
[wlping]     at weblogic.rmi.internal.ClientRuntimeDescriptor.computeInterfaces
(ClientRuntimeDescriptor.java:218)
[wlping]     at weblogic.rmi.internal.ClientRuntimeDescriptor.intern
(ClientRuntimeDescriptor.java:111)
[wlping]     at weblogic.rmi.internal.dgc.DGCClientImpl.<clinit>(DGCClientImpl
.java:66)
[wlping]     at weblogic.rmi.internal.RMIKernelService.initialize
(RMIKernelService.java:13)
[wlping]     at weblogic.kernel.Kernel.initialize(Kernel.java:159)
[wlping]     at weblogic.kernel.Kernel.ensureInitialized(Kernel.java:101)
[wlping]     at weblogic.common.T3Client.<init>(T3Client.java:215)
[wlping]     at weblogic.common.T3Client.<init>(T3Client.java:263)
[wlping]     at weblogic.common.T3Client.<init>(T3Client.java:316)
[wlping]     at com.bp.ist.tools.wlping.WLPing.doPing(WLPing.java:88)
[wlping]     at com.bp.ist.tools.wlping.WLPing.execute(WLPing.java:158)
[wlping]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java
:104)
[wlping]     at org.apache.tools.ant.Task.perform(Task.java:217)
[wlping]     at org.apache.tools.ant.Target.execute(Target.java:184)
[wlping]     at org.apache.tools.ant.Target.performTasks(Target.java:202)
[wlping]     at org.apache.tools.ant.Project.executeTarget(Project.java:601)
[wlping]     at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:266)
[wlping]     at org.apache.tools.ant.Task.perform(Task.java:217)
[wlping]     at org.apache.tools.ant.Target.execute(Target.java:184)
[wlping]     at org.apache.tools.ant.Target.performTasks(Target.java:202)
[wlping]     at org.apache.tools.ant.Project.executeTarget(Project.java:601)
[wlping]     at org.apache.tools.ant.Project.executeTargets(Project.java:560)

It would appear to be some sort of path problem. I decided to call the code via
<java classname="com.bp.ist.tools.wlping.WLPing">. This works but I notice an
Ant classloader/nullpointer exception of some description occurs unless I set
fork="true" (which is no good for me).

Without knowing what the T3Client code does, are there any obvious reasons why
working code should fall over when placed in a user written task or why just
running the code via <java...> would appear to effect Ant after it returns
unless it is run in another JVM ?

Thx


©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.