Metro has been contributed to Eclipse Foundation. This repository is for legacy review only. Please refer to the Eclipse EE4J Metro project for the very latest
Currently, the maven-jaxws-plugin requires that libraries needed during its
compilation of the generated classes be in 'compile' scope. This, however, is
very inconvenient when working in a JEE environment where these libraries are
regularly provided by the JEE container. Therefore, you would usually prefer to
have these libraries in 'provided' scope.
The current situation is further aggravated by the fact that many of the maven
plugins usually used during JEE development glean necessary information from the
different scopes. Most notably does the maven-ear-plugin include every
dependency in 'compile' or 'runtime' scope as a third party library in the
generated ear. Today this amounts to the jsr181's being included in the
generated ear while simultaneously being provided by the JEE container.
Allow the dependencies needed during compilation of the generated classes to be
either in 'compile' OR 'PROVIDED' scope.
I am using Metro 1.2, JAX-WS Spring 1.8, and Xbean-Spring 3.4.3 and am trying to
instantiate a service using the following Spring context xml configuration:
Here is the stack trace:
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'com.sun.xml.ws.transport.http.servlet.SpringBinding#0' defined in
ServletContext resource [/WEB-INF/classes/ApplicationContext.xml]: Cannot create
inner bean '(inner bean)' of type
[org.jvnet.jax_ws_commons.spring.SpringService] while setting bean property
'service'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name '(inner bean)' defined in ServletContext resource
[/WEB-INF/classes/ApplicationContext.xml]: Invocation of init method failed;
nested exception is java.lang.IllegalArgumentException: Unknown type
WEB-INF/wsdl/notify_consumer.wsdl
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:230)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
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:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
I am running into a problem using the wsgen goal.
It requires dependency resolution of artifacts in runtime scope. See https://jax-ws-commons.dev.java.net/jaxws-maven-plugin/wsgen-mojo.html
Alas, it requires me to specify a compile scope for things like
javax.persistence:persistence-api – when the scope should be provided.
In theory, the maven way around this limitation is to add dependencies to the
plugin definition, so that the dependency is available for the plugin but they
don't interfere with my artifact's dependency declaration. Similar to: https://jax-ws-commons.dev.java.net/jaxws-maven-plugin/usage.html
Alas, that doesn't seem to work. (Also note that the usage example is not
structured correctly. A is wrapped in .)
By forcing a compile scope for JEE APIs like javax.persistence:persistence-api,
it requires other projects to explicitly exclude them – and that is just silly
and flies in the face of maven's clever transitive dependency mechanism.
I think I traced the problem down to the getWsGenArgs method in
AbstractWsGenMojo. The code is creating the classpath for wsgen solely based
on project.getArtifacts(). But I think it should ALSO include
project.getPluginArtifacts(). I think my problem will be solved with a minor
code change.
Possibly the jsr181-api dependency ought to be pulled in as a transitive
dependency.
In any case it is not.
One solution/workaround is to add an explicit dependency on jsr181-api to the
sample code (feels like a workaround as I think the plugin itself ought to pull
in its own runtime depends).
My 'helloservice' POM now looks like this ...
(Nb the same fix is also required on the helloclient POM).
4.0.0
com.example.maven.jaxws
helloservice
war
helloservice Maven Webapp
1.0-SNAPSHOT http://maven.apache.org
java.net - Dev
[https://maven-repository.dev.java.net/repository](https://maven-repository.dev.java.net/repository)
legacy
java.net - Maven2
[http://download.java.net/maven/2](http://download.java.net/maven/2)
legacy
default-tools.jar
java.vendor
Sun Microsystems Inc.
com.sun
tools
1.5.0
system
$
I am upgrading from jaxws-maven-plugin from version 1.9 to latest 1.12 and
discovered that since version 1.10 it does not handle any XJC args that are
really intended to be processed by XJC extension plugins like Equlas, Copy
plugins etc.
This causes following in plugin configuration to cause the plugin to fail...
-Xequals
-XhashCode
-Xcopyable
-Xannotate
To further compound thhe problem the failure does not say why it failed and
instead I had to run a standalone wsimport with same options as the plugin to
find out the root problem.
I tested with changing my pom to only change the jaxws-maven-plugin version and
found that 1.9 works while 1.10-1.12 do not.
When trying to use an XWSS 2.0 style configuration file
(/WEB-INF/server_security_config.xml) for my Metro 1.0.1 service endpoint
implementation using JAX-WS Commons Spring integration and Provider
I tracked this behavior down to the following issue in
com.sun.xml.ws.assembler.PipelineAssemblerFactoryImpl (line 728 in Metro 1.0.1
source code):
It turned out that JAX-WS Commons Spring integration uses a
SpringService.ContainerWrapper implementation which is unable to return a
ServletContext (but instead returns null), as no default Container will be
available in class SpringService:
// TODO: how to set the default container?
public void setContainer(Container container)
{ this.container = container; }
Luckily, we have the correct ServletContext available in SpringService
I therefore suggest the following two small changes to class SpringService:
Add a getter method for the ServletContext instance:
public ServletContext getServletContext()
{ return servletContext; }
Take special care of ServletContexts in the ContainerWrapper (inner class):
if(spiType==TubelineAssemblerFactory.class)
{ (... omitted by intention ...) // take special care of requests for the ServletContext }
else if(spiType==ServletContext.class)
{ return spiType.cast(getServletContext()); }
if(container!=null)
{ (... omitted by intention ...) }
After applying these two changes, my Provider
After fixing this, please be so kind as to post a new release of the JAX-WS
Commons Spring integration, such that we can return to using an officially
released version.
Many thanks in advance and best regards,
Andreas
–
Andreas Loew
Java Architect
Sun Microsystems (Germany)
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI
(from jar:file:/home/marat/.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.2/jaxb-
impl-2.1.2.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1
API. Use the endorsed directory mechanism to place jaxb-api.jar in the
bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/
standards/)
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap
classloader, but this RI (from jar:file:/home/marat/.m2/repository/com/sun/xml/
bind/jaxb-impl/2.1.2/jaxb-impl-2.1.2.jar!/com/sun/xml/bind/v2/model/impl/
ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to
place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/
1.5.0/docs/guide/standards/)
at
com.sun.xml.bind.v2.model.impl.ModelBuilder.(ModelBuilder.java:135)
at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:389)
at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:253)
at
com.sun.tools.xjc.reader.xmlschema.bindinfo.BindInfo.getJAXBContext(BindInfo.java:316)
at
com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet.apply(SCDBasedBindingSet.java:195)
at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:502)
at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:216)
at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:69)
at
com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:120)
at
com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2159)
at
com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:179)
at
com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:127)
at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:146)
at org.codehaus.mojo.jaxws.WsImportMojo.wsImport(WsImportMojo.java:232)
at
org.codehaus.mojo.jaxws.WsImportMojo.processWsdlViaUrls(WsImportMojo.java:219)
at org.codehaus.mojo.jaxws.WsImportMojo.execute(WsImportMojo.java:150)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
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)
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Wed Jul 18 13:40:02 MSD 2007
[INFO] Final Memory: 4M/8M
[INFO] ------------------------------------------------------------------------
jaxws-spring v1.8 refers the following artefacts, which do not exist at http://download.java.net/maven/2/ (possibly they are cached at some Maven mirrors):
I found an OS independent patch for your build.
You guys may or may not be aware that the jax-ws
maven plugin does not work on Mac OS X due to the
tools.jar reference. This is impacting many people.
My solution is simple, remove the tools.jar
dependency, and then add it via profiles:
Remove this from the element:
sun.jdk
tools
1.5.0
system
$
{java.home}/../lib/tools.jar
Add this to the element:
other-oses
true
sun.jdk
tools
1.5.0
system
${java.home}
/../lib/tools.jar
mac
mac os x
thank you I hope that all tags, and the trunk can be updated
with this minor update to the pom.
Hello, the Metro documentation clearly states how to attach a binding file to
the wsimport process if you are using the CLI[1] (-b option) and Ant[2], but
could do a better job showing how to do so with Maven[3]. (I needed to Google
to find the syntax[4].) If [3] could be updated to show how a binding file can
be specified (even if it is commented out), that would be very helpful to the
reader, especially since attaching binding files in Maven is not immediately
obvious.
The wsimport tool accepts both .wsdl and .jar files. The jars normally contain a
shared schemas and corresponding generated classes along with
META-INF\sun-jaxb.episode file. This allows separate compilation and reuse of a
common schema between multiple projects without copying xsd files around.
Unfortunately the current Maven plugin does not allow to specify jars in a same
way and only supports the wsdl files as an input. The attached patch removes
such limitation and it simply adds resolved project dependencies to the list of
arguments passed to wsimport tool.
Jaxws plugin multiple executions are not considered.
I have a module project with a jaxws plugin configured to process 4 wsdl files
with different settings, so 4 executions. Only 1st execution runs.
A well documented ticket is open on codehaus, but they have refered it back to
dev.java.net since you are now in charge of the maven plugin.
Exception in thread "main" java.lang.NullPointerException
at org.jvnet.jax_ws_commons.json.schema.JsonOperation.build(JsonOperation.java:53)
at org.jvnet.jax_ws_commons.json.schema.JsonOperation.(JsonOperation.java:33)
at org.jvnet.jax_ws_commons.json.SchemaInfo.buildJsonSchema(SchemaInfo.java:221)
at org.jvnet.jax_ws_commons.json.SchemaInfo.(SchemaInfo.java:132)
at org.jvnet.jax_ws_commons.json.JSONCodec.setEndpoint(JSONCodec.java:64)
at com.sun.xml.ws.server.WSEndpointImpl.(WSEndpointImpl.java:158)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:217)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:486)
at
com.sun.xml.ws.transport.http.server.EndpointImpl.createEndpoint(EndpointImpl.java:222)
at com.sun.xml.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:152)
at com.sun.xml.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:113)
at javax.xml.ws.Endpoint.publish(Endpoint.java:170)
at orc.orchard.soap.CompilerService.(CompilerService.java:33)
at orc.orchard.soap.CompilerService.main(CompilerService.java:53)
After some investigation, it appears the problem is that the SchemaInfo
constructor which parses the WSDL is not following the WSDL statement
in the primary WSDL file which refers to the WSDL definition for the
endpointInterface (which in turn refers to the schema file). A quick fix should
be to parse all WSDL SDDocuments rather than just the primary one.
Based on this theory I'm going to try converting my service to not use an
endpointInterface and see if that resolves the issue.
I have problems to execute wsgen with the jaxws-maven-plugin the protocol
Xsoap1.2 and -extension option. The plug-in get the protocol option but the
extension option does not apear in the command. So, when I execute maven I get
this error.
[INFO] [jaxws:wsgen
{execution: default}
]
The optional protocol "Xsoap1.2" must be used in conjunction with the
"-extension" option.
In the wsgen comman generated by the plug-in, the -extension option has not been
generated. Looking the source code it seem there is not any extension option
however it is in the documentation. Maybe, the extension argument implementation
is missing? Has anybody had the same error? Do you know If I am doing something
wrong?
Hello.
I've deployed EJB3 WebService with wsldLocation, put my wsdl in service jar,
include jar to ear and deploy it. All seems OK and I see my wsdl file, located
at domain1\generated\xml\j2ee-apps\BMUserManagement...
The thread http://forums.java.net/jive/thread.jspa?messageID=290159񆵯 has
the details.
The wsimport adapter should invoke wsimport tool in jax-ws with -Xnocompile
option so that the compilation is done by maven compiler and all the compiler
options and classpath will be well taken care of.
Even if I attach jaxws-maven-plugin execution to test-generate-sources, it still adds a
regular compile source root for the generated files.
This is because addCompileSourceRoot() is always invoked in WsImportMojo.execute(), there is
no way to disable it or make it invoke addTestCompileSourceRoot() instead.
Also the Eclipse plugin only invokes generates-sources and not test-generate-sources, so I
want to be able to generate my test classes in the normal generate-sources phase but still
attach them to the test compile root.
So, there should be a configuration option to be able to specify which compile root I want to
add, if any, for example like this:
WSSpringServlet from Jaxws-Spring fails to release WSServletDelegate and the
associated application context when it is destroyed. This causes a memory leak
during redeployment of the web application.
The following code should be added to WSSpringServlet.java:
/**
destroys the servlet and releases all associated resources,
such as the Spring application context and the JAX-WS delegate.
*/ @OverRide
public void destroy() {
When i build from POM 1.8 and 1.9-SNAPSHOT, i got this messages.
6/13/09 6:56:25 AM CDT: [WARN] POM for
'com.sun.xml.stream.buffer:streambuffer:pom:0.4:provided' is invalid. It will be ignored for artifact
resolution. Reason: Failed to validate POM for project com.sun.xml.stream.buffer:streambuffer at
/Users/rlezama/.m2/repository/com/sun/xml/stream/buffer/streambuffer/0.4/streambuffer-0.4.pom
6/13/09 6:56:25 AM CDT: [WARN] POM for 'org.jvnet.staxex:stax-ex:pom:1.0:provided' is invalid. It
will be ignored for artifact resolution. Reason: Not a v4.0.0 POM. for project org.jvnet.staxex:stax-ex at
/Users/rlezama/.m2/repository/org/jvnet/staxex/stax-ex/1.0/stax-ex-1.0.pom
please update the jaxws-spring component to support the latetst Spring version;
it now needs Spring 2.0.6, whereas Spring 2.5 has a lot new features, for
instance caching with jndiTemplate.
It seems that there's a lack of AOP proxy support in jax-ws-commons. Proxied
webservice endpoints aren't correctly recognized as webservices (although
annotated). The problem lies in the fact, that jax-ws-commons doesn't unwrap the
proxied object to read the annotations from the target class instead from the
proxy. This makes AOP for webservices unusable for nice features like automatic
logging etc.
In order to get local transport to work, there is an entry missing for
local-transport in each of the two files META-INF/spring.services and
META-INF/spring.handlers:
After fixing this, can you please push version 1.4.1 (or so), so that I can
reference an official version in the java.net Maven2 repository from my POM file?
I have a jar with JAXWS/JAXB binding classes and interfaces generated from a WSDL. I would like to have
one of my Grails services implement the port-type interface, sp I did the following:
installed the metro grails plug-in
dropped my jar with jaxws/jaxb interfaces/classes into the lib directory of my grails app
Made my Grails service implement the jax-ws-generated interface (SEI) from my jar
grails run-app
I'm reporting this as an enhancement request, since I suspect it wasn't the intended use of the plug-in.
There were a lot of exceptions occurring during start-up (using Grails 1.0.4). please let me know if this
was indeed a supported scenario. I will then provide detailed descriptions of the stack traces.
missing Addressing class in jaxws-api, added 2.1-1 dependency to plugin
section. The jar from central does not contain the Addressing class, the jar
from this site does, but central is picked up first. This has been resolved by
providing 2.1-1, but the example does not use that dependency for the plugin yet.
jsr-181 from bea must be added to repo manually, I found it on http://ftpna2.bea.com/pub/downloads/jwsri-1.0.zip, but it was really difficult
to locate since dev2dev no longer exists and Oracle has not exposed the link
anywhere. It is just a matter of time when the above link will be closed as
well. This is because the 2.1-1 points to the bea impl by default and does not
use the geronimo version
It seems there's no way to specify an endpoint interface in the ws: or wss:
schema like in the sun-jaxws.xml. Although it seems to work without it, it
should be enhanced in that way.
Currently it is not possible to configure wsimport goal to pass xjc arguments
using the WsImport -B option. This is an urgently needed RFE by the HyperJAXB3
project.
I have created a simpel and safe patch that implements this RFE and hope that
project owners could quickly review and commit this patch. The patch may be
found at:
05.08.2008 23:58:13 com.sun.xml.ws.server.sei.EndpointMethodHandler invoke
SCHWERWIEGEND: Cannot invoke method doAnything() on null object
java.lang.NullPointerException: Cannot invoke method doAnything() on null object
at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77)
at
org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:784)
at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:758)
at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:170)
at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0(ScriptBytecodeAdapter.java:198)
at de.foo.bar.ExternalService.serviceMethod(ExternalService.groovy:19)
Problem:
There's no way to specify a custom encoding for the java sources generated by
the jaxws-maven-plugin.
The com.sun.codemodel.CodeWriter which creates the
java.io.OutputStreamWriter.OutputStreamWriter dosen't set a special
java.nio.charset.Charset. For this reason the OutputStreamWriter always uses the
system encoding.
Workaround:
A Workaround is to add an encoding parameter to the WsImportMojo and extend the
classes WSCodeWriter, FileCodeWriter and CodeWriter with an Charset parameter to
put it into the OutputStreamWriter.
wsgen generates a wsdl containing REPLACE_WITH_ACTUAL_URL as soap address. When
this wsdl is used by wsimport, the generated client code does not work because
it uses that address
What is the recommended practice to handle this? If there is none, can we have a
plugin argument that actually replaces that string by a URL that can be given in
a profile?
For xbean, you need to make sure your javadoc is xml compliant.
SpringService.java has some bad javadoc which causes below when deploying the
test-app
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Line 1 in XML
document from ServletContext resource [/WEB-INF/applicationContext.xml] is
invalid; nested exception is org.xml.sax.SAXParseException: White spaces are
required between publicId and systemId.
Caused by: org.xml.sax.SAXParseException: White spaces are required between
publicId and systemId.
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
at
com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1411)
at
com.sun.org.apache.xerces.internal.impl.XMLScanner.scanExternalID(XMLScanner.java:1026)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.scanDoctypeDecl(XMLDocumentScannerImpl.java:685)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:965)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
at
com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(SchemaParsingConfig.java:435)
at
com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(SchemaParsingConfig.java:491)
at
com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaDOMParser.parse(SchemaDOMParser.java:510)
at
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument(XSDHandler.java:1802)
at
com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:531)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:552)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(XMLSchemaValidator.java:2408)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1753)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:685)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2740)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
at
org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:77)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:405)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:357)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
at
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:123)
at
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:91)
at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:94)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:294)
at
org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3692)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4127)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:804)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:693)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1181)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:292)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1304)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1568)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1577)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1557)
at java.lang.Thread.run(Thread.java:619)
In fact the problem has nothing to do with /WEB-INF/applicationContext.xml or
systemId or publicId. It has to do with unescaped > in
spring-jax-ws-core.xsd.html generated by xbean.
but rather is completely useless: Due to being declared as
"namespace='##other'", it does not accept any nested tags from "ws" namespace,
such as ws:addressing and ws:mtom.
s that are activated in this endpoint.
]]></xs:documentation>
</xs:annotation>
xs:complexType
<xs:sequence minOccurs='0' maxOccurs='unbounded'><xs:any
namespace='##other'/></xs:sequence>
</xs:complexType>
</xs:element>
Changing this by directly modifying the xsd to read
works around the issue, but in order to really solve the issue from its roots, I
think some XBean annotations must be changed (sorry, I am not at all familiar
with XBean).
Could you please release an updated version of the Spring extension to fix this?
Starting grails to run functional tests cause following error:
grails test-app
[5132] spring.GrailsWebApplicationContext Bean factory for application context
[org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext@35be06]:
org.springframework.beans.factory.support.DefaultListableBeanFactory@d8fb2b
Error executing tests Error creating bean with name
'com.sun.xml.ws.transport.http.servlet.SpringBinding#0' defined in URL
file:./grails-app/conf/spring/resources.xml: Cannot create inner bean '(inner
bean)' of type [org.jvnet.jax_ws_commons.spring.SpringService] while setting
bean property 'service'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name '(inner bean)#1': FactoryBean threw exception on object creation;
nested exception is com.sun.xml.ws.model.RuntimeModelerException: runtime
modeler error: Wrapper class de.foo.bar.jaxws.ServiceMethod is not found. Have
you run APT to generate them? ...
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'com.sun.xml.ws.transport.http.servlet.SpringBinding#0' defined in URL
file:./grails-app/conf/spring/resources.xml: Cannot create inner bean '(inner
bean)' of type [org.jvnet.jax_ws_commons.spring.SpringService] while setting
bean property 'service'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name '(inner bean)#1': FactoryBean threw exception on object creation;
nested exception is com.sun.xml.ws.model.RuntimeModelerException: runtime
modeler error: Wrapper class de.foo.bar.jaxws.ServiceMethod is not found. Have
you run APT to generate them?
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:230)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1244)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1008)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:470)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.
Recently I took jaxws-commons spring integration for a spin with glassfish and
noticed 2 things.
1. when following the tutorial on jaxws and spring from the metro site
(https://metro.dev.java.net/guide/Using_Metro_With_Spring_and_NetBeans_6_1.html)
the resulting application will register 2 web services. The first one being the
autodeployed webservice (I believe glassfish registers an interceptor prior to
loading the spring stuff) and the 2nd web service endpoint is the spring one. To
prevent the autdeployment one will need to add <web-app ...
metadata-complete="true"> to the web.xml. This is not really desirable as I
believe glassfish will ignore sun-web.xml alltogether. Maybe a setting in the
sun-web.xml to turn off autodeploy for webservices would be a better solution.
2. After disabling autodeployment of webservices for the web app the spring
servlet does not generate a webservices.xml nor does it register the service
with the glassfish admin console. Perhaps that would be a nice feature for the
spring integration. I am not too sure if there is much more work involved to
regain monitoring and other admin features.
Hope this case make sense, happy to send some further details.
It should be possible to specify multiple values for the ws:metadata element.
This is actually supported by the code in the SpringService class which has the
appropriate setter method:
void setMetadata(Collection metadata)
However, the element definition in spring-jax-ws-core.xsd only allows for a
single value: