Hi again...
I'm working with Maven 2, JDK 1.4, Weblogic 8.1 SP3
I've a trouble with an embeded Ant script in my pom.xml. This script
generates a webservice using servicegen, but, after trying many
configuration I got out of my mind.
With the next configuration I've added some jars (classworlds-1.1.jar,
weblogic.jar, tools.jar, webservices.jar, webserviceclient+ssl_pj.jar,
jasperreports-0.5.2.jar, HSReportEjb.jar, log4j-1.2.5.jar) to maven /lib
folder. But caused the error below
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
<configuration>
<tasks>
<echo
message="${CMP_PROXY_EJB_PATH}/${ear.path}, ${java.class.path},
${ejbc-classpath}" />
<servicegen
destEar="${CMP_PROXY_EJB_PATH}/${ear.path}"
contextURI="/cmpws">
<classpath>
<pathelement
path="${java.class.path}" />
<pathelement
path="${ejbc-classpath}" />
<pathelement
path="." />
</classpath>
<service
ejbJar="${CMP_PROXY_EJB_PATH}/${module}Bean.jar"
serviceName="cmpWebServiceProxy"
targetNamespace="http://auohsalti10.posadas.com:15010/CMP"
serviceURI="/cmp_interface"
includeEJBs="cmpWebServiceProxy">
</service>
</servicegen>
todir="${DEPLOY_WLS61}/config/${domain-name61}/applications"
file="${dist}/${ear.path}" />
</tasks>
</configuration>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-jsch</artifactId>
<version>1.6.5</version>
</dependency>
<dependency>
<groupId>jsch</groupId>
<artifactId>jsch</artifactId>
<version>0.1.25</version>
</dependency>
</dependencies>
</plugin>
THE ERROR:
[INFO] Executing tasks
[echo]
/develop/Kronos/Maeven/src/contact/implementacion/WebServices/CMPWebServiceProxy/dist/CMPWS.ear,
/develop/Kronos/Maeven/opt/apache-maven-2.0.10/boot/classworlds-1.1.jar,
/develop/Kronos/opt/bea81/weblogic81/server/lib/weblogic.jar:/develop/Kronos/opt/bea81/jdk142_04/lib/tools.jar:/develop/Kronos/opt/bea81/weblogic81/server/lib/webservices.jar:/develop/Kronos/opt/bea81/weblogic81/server/lib/webserviceclient+ssl_pj.jar:/develop/Kronos/Maeven/maevenserver/config/maevendomain/lib/jasperreports-0.5.2.jar:/develop/Kronos/Maeven/src/hsreports/HSReportEjb.jar:/develop/Kronos/opt/jolt/log4j-1.2.5.jar:/develop/Kronos/opt/compoze/lib/misc/xerces.jar
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error executing ant tasks
Embedded error: Could not create task or type of type: servicegen.
Ant could not find the task or a class this task relies upon.
This is common and has a number of causes; the usual
solutions are to read the manual pages then download and
install needed JAR files, or fix the build file:
- You have misspelt 'servicegen'.
Fix: check your spelling.
- The task needs an external JAR file to execute
and this is not found at the right place in the classpath.
Fix: check the documentation for dependencies.
Fix: declare the task.
- The task is an Ant optional task and the JAR file and/or libraries
implementing the functionality were not found at the time you
yourself built your installation of Ant from the Ant sources.
Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
task and make sure it contains more than merely a META-INF/MANIFEST.MF.
If all it contains is the manifest, then rebuild Ant with the needed
libraries present in ${ant.home}/lib/optional/ , or alternatively,
download a pre-built release version from apache.org
- The build file was written for a later version of Ant
Fix: upgrade to at least the latest release version of Ant
- The task is not an Ant core or optional task
and needs to be declared using <taskdef>.
- You are attempting to use a task defined using
<presetdef> or <macrodef> but have spelt wrong or not
defined it at the point of use
Remember that for JAR files to be visible to Ant tasks implemented
in ANT_HOME/lib, the files must be in the same directory or on the
classpath
Please neither file bug reports on this problem, nor email the
Ant mailing lists, until all of these causes have been explored,
as this is not an Ant bug.
What it means?
In other hand, I tryied adding this line before all the script to define the
task.
<taskdef name="servicegen"
classname="weblogic.ant.taskdefs.webservices.servicegen.ServiceGenTask" />
But I get the next ERROR:
[INFO] Executing tasks
[echo]
/develop/Kronos/Maeven/src/contact/implementacion/WebServices/CMPWebServiceProxy/dist/CMPWS.ear,
/develop/Kronos/Maeven/opt/apache-maven-2.0.10/boot/classworlds-1.1.jar,
/develop/Kronos/opt/bea81/weblogic81/server/lib/weblogic.jar:/develop/Kronos/opt/bea81/jdk142_04/lib/tools.jar:/develop/Kronos/opt/bea81/weblogic81/server/lib/webservices.jar:/develop/Kronos/opt/bea81/weblogic81/server/lib/webserviceclient+ssl_pj.jar:/develop/Kronos/Maeven/maevenserver/config/maevendomain/lib/jasperreports-0.5.2.jar:/develop/Kronos/Maeven/src/hsreports/HSReportEjb.jar:/develop/Kronos/opt/jolt/log4j-1.2.5.jar:/develop/Kronos/opt/compoze/lib/misc/xerces.jar
java.lang.NullPointerException
at org.apache.tools.ant.Task.log(Task.java:346)
at
weblogic.ant.taskdefs.webservices.servicegen.ServiceGenTask.setupClasspath(ServiceGenTask.java:640)
at
weblogic.ant.taskdefs.webservices.servicegen.ServiceGenTask.execute(ServiceGenTask.java:171)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at
org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108)
at
org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:453)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:513)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:483)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:331)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:292)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:301)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error executing ant tasks
Embedded error: java.lang.NullPointerException
So, I don't know what to do... Some idea?
Thanks for the replies in advance...
--
View this message in context:
http://www.nabble.com/Problem-with-servicegen-tp24082088p24082088.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]