You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by wabom <ou...@gmail.com> on 2009/06/09 10:07:35 UTC
Run a file using maven
Hi,
I want to know how to run a file using maven command.
Thanks...
--
View this message in context: http://www.nabble.com/Run-a-file-using-maven-tp23938277p23938277.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Run a file using maven
Posted by wabom <ou...@gmail.com>.
Thank you,
I deployed some web services (build by maven) in tomcat, after that, I
integrated them in PEtALS(Entreprise Service Bus).
Now I am using a client to instantiate a subset of these web services using
a generic chain(also deployed in PEtALS).
http://www.nabble.com/file/p23939446/pom.xml pom.xml
The command is: mvn exec:java
-Dexec.mainClass=org.weblab_project.services.Client
The Client.java (main class) is like this:
http://www.nabble.com/file/p23939446/Client.java Client.java
--
View this message in context: http://www.nabble.com/Run-a-file-using-maven-tp23938277p23939446.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Run a file using maven
Posted by Samuli Ulmanen <sa...@tkk.fi>.
Hello,
if you're up for using groovy, this might work, depending on what
type of input you are
thinking of.
The basic idea is to use the gmaven plugin and some inline groovy code
to dynamically run your web services client.
You can find what to put in your pom.xml in the below link.
Almost everything you need is under this link...
http://groovy.codehaus.org/GMaven+-+Executing+Groovy+Code
Take a look at the Custom Properties and Class Dependencies sections
on how to access Maven properties and how to include your java
dependencies.
Cheers,
-Samuli Ulmanen
On Jun 9, 2009, at 4:14 PM, wabom wrote:
>
> To be clear: I have a set of web services deployed in tomcat. I
> want to
> invoke only a subset of these web services based on my input. i.e
> depending
> on my inputs I have a module which compute the appropriate web
> services to
> be called and generates the name of these web services. The problem
> is that
> I don't know how to invoke them in dynamic way, that's why I want
> to use
> PEtALS but, I think it is too complicated.
> If there is an other way to do that please tell me as soon possible!
> --
> View this message in context: http://www.nabble.com/Run-a-file-
> using-maven-tp23938277p23942579.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Run a file using maven
Posted by Wayne Fay <wa...@gmail.com>.
> If there is an other way to do that please tell me as soon possible!
This is not a general Java programming help email list. Ask the PEtALS
users list what they think you should do, or JavaRanch, or places like
that. Maven is doing its job properly.
Wayne
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Run a file using maven
Posted by wabom <ou...@gmail.com>.
To be clear: I have a set of web services deployed in tomcat. I want to
invoke only a subset of these web services based on my input. i.e depending
on my inputs I have a module which compute the appropriate web services to
be called and generates the name of these web services. The problem is that
I don't know how to invoke them in dynamic way, that's why I want to use
PEtALS but, I think it is too complicated.
If there is an other way to do that please tell me as soon possible!
--
View this message in context: http://www.nabble.com/Run-a-file-using-maven-tp23938277p23942579.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Run a file using maven
Posted by Martin Höller <ma...@xss.co.at>.
On Tuesday 09 June 2009 wabom wrote:
> Hi,
> I want to know how to run a file using maven command.
> Thanks...
http://www.lmgtfy.com/?q=maven+execute+command
- martin
Re: Run a file using maven
Posted by Martin Höller <ma...@xss.co.at>.
On Tuesday 09 June 2009 wabom wrote:
> Thank you first of all,
> I got this type of exception and I don't know how to solve it???
>
> org.apache.maven.lifecycle.LifecycleExecutionException: An exception
> occured while executing the Java class. null
How did you specify the java class you want to execute? It seems it has the
value 'null'.
You need to provide us with more information to make us able to help you.
Show us the pom.xml and the command line you executed.
hth,
- martin
Re: Run a file using maven
Posted by Wayne Fay <wa...@gmail.com>.
This is your problem. Fix your code.
> Caused by: javax.xml.ws.WebServiceException: javax.xml.bind.MarshalException
> - with linked exception:
> [javax.xml.bind.JAXBException: A DOM document "class
> com.sun.org.apache.xerces.internal.dom.DocumentImpl" is found but an element
> is needed. Use Document.getDocumentElement() and set that object instead.]
...
> at $Proxy35.process(Unknown Source)
> at org.weblab_project.services.Client.main(Client.java:75)
Wayne
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Run a file using maven
Posted by wabom <ou...@gmail.com>.
Thank you first of all,
I got this type of exception and I don't know how to solve it???
org.apache.maven.lifecycle.LifecycleExecutionException: An exception occured
while executing the Java class. null
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
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:287)
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:597)
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)
Caused by: org.apache.maven.plugin.MojoExecutionException: An exception
occured while executing the Java class. null
at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:338)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
... 16 more
Caused by: java.lang.reflect.InvocationTargetException
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:597)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:283)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.xml.ws.WebServiceException: javax.xml.bind.MarshalException
- with linked exception:
[javax.xml.bind.JAXBException: A DOM document "class
com.sun.org.apache.xerces.internal.dom.DocumentImpl" is found but an element
is needed. Use Document.getDocumentElement() and set that object instead.]
at
com.sun.xml.internal.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.java:303)
at
com.sun.xml.internal.ws.message.AbstractMessageImpl.writeTo(AbstractMessageImpl.java:128)
at
com.sun.xml.internal.ws.encoding.StreamSOAPCodec.encode(StreamSOAPCodec.java:94)
at
com.sun.xml.internal.ws.encoding.SOAPBindingCodec.encode(SOAPBindingCodec.java:251)
at
com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:130)
at
com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:74)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:581)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:540)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:525)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:422)
at com.sun.xml.internal.ws.client.Stub.process(Stub.java:235)
at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(SEIStub.java:120)
at
com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:230)
at
com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:210)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:103)
at $Proxy35.process(Unknown Source)
at org.weblab_project.services.Client.main(Client.java:75)
... 6 more
Caused by: javax.xml.bind.MarshalException
- with linked exception:
[javax.xml.bind.JAXBException: A DOM document "class
com.sun.org.apache.xerces.internal.dom.DocumentImpl" is found but an element
is needed. Use Document.getDocumentElement() and set that object instead.]
at
com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:255)
at
com.sun.xml.internal.bind.v2.runtime.BridgeImpl.marshal(BridgeImpl.java:64)
at com.sun.xml.internal.bind.api.Bridge.marshal(Bridge.java:105)
at
com.sun.xml.internal.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.java:296)
... 22 more
Caused by: javax.xml.bind.JAXBException: A DOM document "class
com.sun.org.apache.xerces.internal.dom.DocumentImpl" is found but an element
is needed. Use Document.getDocumentElement() and set that object instead.
at
com.sun.xml.internal.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:224)
at
com.sun.xml.internal.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:239)
at
com.sun.xml.internal.bind.v2.runtime.property.SingleReferenceNodeProperty.serializeBody(SingleReferenceNodeProperty.java:77)
at
com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:286)
at
com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:663)
at
com.sun.xml.internal.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:29)
at
com.sun.xml.internal.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:132)
at
com.sun.xml.internal.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:116)
at
com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:286)
at
com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:663)
at
com.sun.xml.internal.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:113)
at
com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:286)
at
com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:663)
at
com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:250)
... 25 more
Caused by: javax.xml.bind.JAXBException: A DOM document "class
com.sun.org.apache.xerces.internal.dom.DocumentImpl" is found but an element
is needed. Use Document.getDocumentElement() and set that object instead.
at
com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:539)
at
com.sun.xml.internal.bind.v2.runtime.property.SingleReferenceNodeProperty.serializeBody(SingleReferenceNodeProperty.java:69)
... 36 more
--
View this message in context: http://www.nabble.com/Run-a-file-using-maven-tp23938277p23938805.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org