You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by cmoulliard <cm...@gmail.com> on 2009/03/05 11:42:41 UTC
How to avoid to generate hard coded wsdl file reference - wsdl2java
Hi,
I would like to know if it is possible to have local reference of the wsdl
file in the SEI instead of the hard coding generated by wsdl2java using the
maven plugin cxf-codegen :
Here is a snapshot :
@WebServiceClient(name = "ReportIncidentEndpointService",
wsdlLocation =
"file:/c:/workspace/osgi/reportincident.domain/src/main/resources/wsdl/report_incident.wsdl",
targetNamespace =
"http://reportincident.example.camel.apache.org")
public class ReportIncidentEndpointService extends Service {
public final static URL WSDL_LOCATION;
public final static QName SERVICE = new
QName("http://reportincident.example.camel.apache.org",
"ReportIncidentEndpointService");
public final static QName ReportIncidentService = new
QName("http://reportincident.example.camel.apache.org",
"ReportIncidentService");
static {
URL url = null;
try {
url = new
URL("file:/c:/workspace/osgi/reportincident.domain/src/main/resources/wsdl/report_incident.wsdl");
} catch (MalformedURLException e) {
System.err.println("Can not initialize the default wsdl from
file:/c:/workspace/osgi/reportincident.domain/src/main/resources/wsdl/report_incident.wsdl");
// e.printStackTrace();
}
WSDL_LOCATION = url;
}
Regards,
-----
Charles Moulliard
SOA Architect
My Blog : http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/
--
View this message in context: http://www.nabble.com/How-to-avoid-to-generate-hard-coded-wsdl-file-reference---wsdl2java-tp22349214p22349214.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: How to avoid to generate hard coded wsdl file reference - wsdl2java
Posted by Daniel Kulp <dk...@apache.org>.
This looks like a bug in the xmlbeans databinding (not sure why, bit bizarre).
I've logged it:
https://issues.apache.org/jira/browse/CXF-2107
Dan
On Wed March 11 2009 11:26:00 am RayKnight wrote:
> dkulp wrote:
> > On Tue March 10 2009 3:10:20 pm RayKnight wrote:
> >> Using CXF 2.1.4 and the maven plugin for wsdl2java I add the
> >> wsdlLocation flag with a value of META-INF/wsdl. This causes a BUILD
> >> ERROR with a java.lang.NullPointerException. Removing the wsdlLocation
> >> flag and the client builds correctly. I also tried using a value of
> >> META-INF/wsdl/BpsReport.wsdl which results in the same error. Is there
> >> a bug in 2.1.4 that causes this? Or am I missing something here?
> >
> > Can you show your plugin config as well as the stack trace on the
> > NullPointerException?
> >
> > Thanks!
> > Dan
> >
> >
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://www.dankulp.com/blog
>
> Plug config is as follows:
>
>
>
> <plugin>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-codegen-plugin</artifactId>
> <version>2.1.4</version>
> <executions>
> <execution>
> <id>generate-sources</id>
> <phase>generate-sources</phase>
> <configuration>
> <sourceRoot>${project.build.outputDirectory}</sourceRoot>
> <wsdlOptions>
> <wsdlOption>
> <wsdl>${basedir}/src/main/resources/BpsReport.wsdl</wsdl>
> <dataBinding>xmlbeans</dataBinding>
> <wsdlLocation>META-INF/wsdl</wsdlLocation>
> <extraargs>
> <extraarg>-client</extraarg>
> <extraarg>-verbose</extraarg>
> <extraarg>-p</extraarg>
>
> <extraarg>com.seisint.webservices.wsAccurint</extraarg>
> </extraargs>
> </wsdlOption>
> </wsdlOptions>
> </configuration>
> <goals>
> <goal>wsdl2java</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
>
>
>
> Ouput from mvn -X install
>
>
> [DEBUG] Calling wsdl2java with args: [-verbose, -d, C:\Documents and
> Settings\euyqd30\Workspaces\MyEclipse
> 7.0\cds-accurint-bpsreport-ws-client\target\classes, -db, xmlbeans,
> -client, -p, com.seisint.webservices.wsAccurint, -wsdlLocation,
> META-INF/wsdl,
> file:/C:/Documents%20and%20Settings/euyqd30/Workspaces/MyEclipse%207.0/cds-
>accurint-bpsreport-ws-client/src/main/resources/BpsReport.wsdl] Loading
> FrontEnd jaxws ...
> Loading DataBinding xmlbeans ...
> wsdl2java -verbose -d C:\Documents and
> Settings\euyqd30\Workspaces\MyEclipse
> 7.0\cds-accurint-bpsreport-ws-client\target\classes -db xmlbeans -client -p
> com.seisint.webservices.wsAccurint -wsdlLocation META-INF/wsdl
> file:/C:/Documents%20and%20Settings/euyqd30/Workspaces/MyEclipse%207.0/cds-
>accurint-bpsreport-ws-client/src/main/resources/BpsReport.wsdl wsdl2java -
> Apache CXF 2.1.4
>
> Mar 11, 2009 11:16:45 AM
> org.springframework.context.support.AbstractApplicationContext
> prepareRefresh
> INFO: Refreshing org.apache.cxf.bus.spring.BusApplicationContext@1d9e5ad:
> display name [org.apache.cxf.bus.spring.BusApplicationContext@1d9e5ad];
> startup date [Wed Mar 11 11:16:45 EDT 2009]; root of context hierarchy
> Mar 11, 2009 11:16:45 AM org.apache.cxf.bus.spring.BusApplicationContext
> getConfigResources
> INFO: No cxf.xml configuration file detected, relying on defaults.
> Mar 11, 2009 11:16:45 AM
> org.springframework.context.support.AbstractApplicationContext
> obtainFreshBeanFactory
> INFO: Bean factory for application context
> [org.apache.cxf.bus.spring.BusApplicationContext@1d9e5ad]:
> org.springframework.beans.factory.support.DefaultListableBeanFactory@1412b6
>1 Mar 11, 2009 11:16:45 AM
> org.springframework.context.support.AbstractApplicationContext$BeanPostProc
>essorChecker postProcessAfterInitialization
> INFO: Bean 'org.apache.cxf.bus.spring.Jsr250BeanPostProcessor' is not
> eligible for getting processed by all BeanPostProcessors (for example: not
> eligible for auto-proxying)
> Mar 11, 2009 11:16:45 AM
> org.springframework.context.support.AbstractApplicationContext$BeanPostProc
>essorChecker postProcessAfterInitialization
> INFO: Bean 'org.apache.cxf.bus.spring.BusExtensionPostProcessor' is not
> eligible for getting processed by all BeanPostProcessors (for example: not
> eligible for auto-proxying)
> Mar 11, 2009 11:16:45 AM
> org.springframework.beans.factory.support.DefaultListableBeanFactory
> preInstantiateSingletons
> INFO: Pre-instantiating singletons in
> org.springframework.beans.factory.support.DefaultListableBeanFactory@1412b6
>1: defining beans
> [cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.sp
>ring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanP
>ostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.
>cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apa
>che.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFa
>ctoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf
>.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue
>.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache
>.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,
>org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.htt
>p.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.
>apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,
>org.apache.cxf.endpoint.ServiceContractResolverRegistry]; root of factory
> hierarchy
> Mar 11, 2009 11:16:47 AM
> org.springframework.context.support.AbstractApplicationContext doClose
> INFO: Closing org.apache.cxf.bus.spring.BusApplicationContext@1d9e5ad:
> display name [org.apache.cxf.bus.spring.BusApplicationContext@1d9e5ad];
> startup date [Wed Mar 11 11:16:45 EDT 2009]; root of context hierarchy
> Mar 11, 2009 11:16:47 AM
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
> destroySingletons
> INFO: Destroying singletons in
> org.springframework.beans.factory.support.DefaultListableBeanFactory@1412b6
>1: defining beans
> [cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.sp
>ring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanP
>ostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.
>cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apa
>che.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFa
>ctoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf
>.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue
>.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache
>.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,
>org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.htt
>p.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.
>apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,
>org.apache.cxf.endpoint.ServiceContractResolverRegistry]; root of factory
> hierarchy
> [DEBUG]
> org.apache.cxf.tools.common.ToolException: java.lang.NullPointerException
> at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>.java:240) at
> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
> at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
> at
> org.apache.cxf.maven_plugin.WSDL2JavaMojo.processWsdl(WSDL2JavaMojo.java:36
>0) at
> org.apache.cxf.maven_plugin.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:257)
> at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManag
>er.java:451) at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLif
>ecycleExecutor.java:558) at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycl
>e(DefaultLifecycleExecutor.java:499) at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLife
>cycleExecutor.java:478) at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFai
>lures(DefaultLifecycleExecutor.java:330) at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Def
>aultLifecycleExecutor.java:291) at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycl
>eExecutor.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(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> 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: java.lang.NullPointerException
> at org.apache.xmlbeans.impl.schema.StscState.addError(StscState.java:387)
> at
> org.apache.cxf.xmlbeans.tools.XMLBeansToolingDataBinding.loadTypeSystem(XML
>BeansToolingDataBinding.java:259) at
> org.apache.cxf.xmlbeans.tools.XMLBeansToolingDataBinding.initialize(XMLBean
>sToolingDataBinding.java:100) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaCon
>tainer.java:536) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>.java:187) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>.java:232) ... 22 more
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] java.lang.NullPointerException
>
> [INFO]
> ------------------------------------------------------------------------
--
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog
Re: How to avoid to generate hard coded wsdl file reference -
wsdl2java
Posted by RayKnight <ra...@lexisnexis.com>.
dkulp wrote:
>
> On Tue March 10 2009 3:10:20 pm RayKnight wrote:
>> Using CXF 2.1.4 and the maven plugin for wsdl2java I add the wsdlLocation
>> flag with a value of META-INF/wsdl. This causes a BUILD ERROR with a
>> java.lang.NullPointerException. Removing the wsdlLocation flag and the
>> client builds correctly. I also tried using a value of
>> META-INF/wsdl/BpsReport.wsdl which results in the same error. Is there a
>> bug in 2.1.4 that causes this? Or am I missing something here?
>>
>
> Can you show your plugin config as well as the stack trace on the
> NullPointerException?
>
> Thanks!
> Dan
>
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>
>
Plug config is as follows:
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.1.4</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.outputDirectory}</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/BpsReport.wsdl</wsdl>
<dataBinding>xmlbeans</dataBinding>
<wsdlLocation>META-INF/wsdl</wsdlLocation>
<extraargs>
<extraarg>-client</extraarg>
<extraarg>-verbose</extraarg>
<extraarg>-p</extraarg>
<extraarg>com.seisint.webservices.wsAccurint</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
Ouput from mvn -X install
[DEBUG] Calling wsdl2java with args: [-verbose, -d, C:\Documents and
Settings\euyqd30\Workspaces\MyEclipse
7.0\cds-accurint-bpsreport-ws-client\target\classes, -db, xmlbeans, -client,
-p, com.seisint.webservices.wsAccurint, -wsdlLocation, META-INF/wsdl,
file:/C:/Documents%20and%20Settings/euyqd30/Workspaces/MyEclipse%207.0/cds-accurint-bpsreport-ws-client/src/main/resources/BpsReport.wsdl]
Loading FrontEnd jaxws ...
Loading DataBinding xmlbeans ...
wsdl2java -verbose -d C:\Documents and Settings\euyqd30\Workspaces\MyEclipse
7.0\cds-accurint-bpsreport-ws-client\target\classes -db xmlbeans -client -p
com.seisint.webservices.wsAccurint -wsdlLocation META-INF/wsdl
file:/C:/Documents%20and%20Settings/euyqd30/Workspaces/MyEclipse%207.0/cds-accurint-bpsreport-ws-client/src/main/resources/BpsReport.wsdl
wsdl2java - Apache CXF 2.1.4
Mar 11, 2009 11:16:45 AM
org.springframework.context.support.AbstractApplicationContext
prepareRefresh
INFO: Refreshing org.apache.cxf.bus.spring.BusApplicationContext@1d9e5ad:
display name [org.apache.cxf.bus.spring.BusApplicationContext@1d9e5ad];
startup date [Wed Mar 11 11:16:45 EDT 2009]; root of context hierarchy
Mar 11, 2009 11:16:45 AM org.apache.cxf.bus.spring.BusApplicationContext
getConfigResources
INFO: No cxf.xml configuration file detected, relying on defaults.
Mar 11, 2009 11:16:45 AM
org.springframework.context.support.AbstractApplicationContext
obtainFreshBeanFactory
INFO: Bean factory for application context
[org.apache.cxf.bus.spring.BusApplicationContext@1d9e5ad]:
org.springframework.beans.factory.support.DefaultListableBeanFactory@1412b61
Mar 11, 2009 11:16:45 AM
org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker
postProcessAfterInitialization
INFO: Bean 'org.apache.cxf.bus.spring.Jsr250BeanPostProcessor' is not
eligible for getting processed by all BeanPostProcessors (for example: not
eligible for auto-proxying)
Mar 11, 2009 11:16:45 AM
org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker
postProcessAfterInitialization
INFO: Bean 'org.apache.cxf.bus.spring.BusExtensionPostProcessor' is not
eligible for getting processed by all BeanPostProcessors (for example: not
eligible for auto-proxying)
Mar 11, 2009 11:16:45 AM
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons
INFO: Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@1412b61:
defining beans
[cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry];
root of factory hierarchy
Mar 11, 2009 11:16:47 AM
org.springframework.context.support.AbstractApplicationContext doClose
INFO: Closing org.apache.cxf.bus.spring.BusApplicationContext@1d9e5ad:
display name [org.apache.cxf.bus.spring.BusApplicationContext@1d9e5ad];
startup date [Wed Mar 11 11:16:45 EDT 2009]; root of context hierarchy
Mar 11, 2009 11:16:47 AM
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
destroySingletons
INFO: Destroying singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@1412b61:
defining beans
[cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry];
root of factory hierarchy
[DEBUG]
org.apache.cxf.tools.common.ToolException: java.lang.NullPointerException
at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:240)
at
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
at
org.apache.cxf.maven_plugin.WSDL2JavaMojo.processWsdl(WSDL2JavaMojo.java:360)
at
org.apache.cxf.maven_plugin.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:257)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
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(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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: java.lang.NullPointerException
at org.apache.xmlbeans.impl.schema.StscState.addError(StscState.java:387)
at
org.apache.cxf.xmlbeans.tools.XMLBeansToolingDataBinding.loadTypeSystem(XMLBeansToolingDataBinding.java:259)
at
org.apache.cxf.xmlbeans.tools.XMLBeansToolingDataBinding.initialize(XMLBeansToolingDataBinding.java:100)
at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:536)
at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:187)
at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:232)
... 22 more
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] java.lang.NullPointerException
[INFO]
------------------------------------------------------------------------
--
View this message in context: http://www.nabble.com/How-to-avoid-to-generate-hard-coded-wsdl-file-reference---wsdl2java-tp22349214p22457536.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: How to avoid to generate hard coded wsdl file reference - wsdl2java
Posted by Daniel Kulp <dk...@apache.org>.
On Tue March 10 2009 3:10:20 pm RayKnight wrote:
> Using CXF 2.1.4 and the maven plugin for wsdl2java I add the wsdlLocation
> flag with a value of META-INF/wsdl. This causes a BUILD ERROR with a
> java.lang.NullPointerException. Removing the wsdlLocation flag and the
> client builds correctly. I also tried using a value of
> META-INF/wsdl/BpsReport.wsdl which results in the same error. Is there a
> bug in 2.1.4 that causes this? Or am I missing something here?
>
Can you show your plugin config as well as the stack trace on the
NullPointerException?
Thanks!
Dan
> dkulp wrote:
> > There is a wsdlLocation flag on the code generator to specify the
> > location that is spit into the code. The two common things to stick in
> > there are:
> >
> > 1) META-INF/wsdl/..... to resolve it from the war/classpath type thing
> >
> > 2) Some location that a catalog is then used to fully resolve.
> >
> > Dan
> >
> > On Thu March 5 2009 5:42:41 am cmoulliard wrote:
> >> Hi,
> >>
> >> I would like to know if it is possible to have local reference of the
> >> wsdl
> >> file in the SEI instead of the hard coding generated by wsdl2java using
> >> the
> >> maven plugin cxf-codegen :
> >>
> >> Here is a snapshot :
> >>
> >> @WebServiceClient(name = "ReportIncidentEndpointService",
> >> wsdlLocation =
> >> "file:/c:/workspace/osgi/reportincident.domain/src/main/resources/wsdl/r
> >>epo rt_incident.wsdl", targetNamespace =
> >> "http://reportincident.example.camel.apache.org")
> >> public class ReportIncidentEndpointService extends Service {
> >>
> >> public final static URL WSDL_LOCATION;
> >> public final static QName SERVICE = new
> >> QName("http://reportincident.example.camel.apache.org",
> >> "ReportIncidentEndpointService");
> >> public final static QName ReportIncidentService = new
> >> QName("http://reportincident.example.camel.apache.org",
> >> "ReportIncidentService");
> >> static {
> >> URL url = null;
> >> try {
> >> url = new
> >> URL("file:/c:/workspace/osgi/reportincident.domain/src/main/resources/ws
> >>dl/ report_incident.wsdl"); } catch (MalformedURLException e) {
> >> System.err.println("Can not initialize the default wsdl from
> >> file:/c:/workspace/osgi/reportincident.domain/src/main/resources/wsdl/re
> >>por t_incident.wsdl"); // e.printStackTrace();
> >> }
> >> WSDL_LOCATION = url;
> >> }
> >>
> >> Regards,
> >>
> >>
> >>
> >> -----
> >> Charles Moulliard
> >> SOA Architect
> >>
> >> My Blog : http://cmoulliard.blogspot.com/
> >> http://cmoulliard.blogspot.com/
> >
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://www.dankulp.com/blog
--
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog
Re: How to avoid to generate hard coded wsdl file reference -
wsdl2java
Posted by RayKnight <ra...@lexisnexis.com>.
Using CXF 2.1.4 and the maven plugin for wsdl2java I add the wsdlLocation
flag with a value of META-INF/wsdl. This causes a BUILD ERROR with a
java.lang.NullPointerException. Removing the wsdlLocation flag and the
client builds correctly. I also tried using a value of
META-INF/wsdl/BpsReport.wsdl which results in the same error. Is there a
bug in 2.1.4 that causes this? Or am I missing something here?
dkulp wrote:
>
>
> There is a wsdlLocation flag on the code generator to specify the location
> that is spit into the code. The two common things to stick in there are:
>
> 1) META-INF/wsdl/..... to resolve it from the war/classpath type thing
>
> 2) Some location that a catalog is then used to fully resolve.
>
> Dan
>
> On Thu March 5 2009 5:42:41 am cmoulliard wrote:
>> Hi,
>>
>> I would like to know if it is possible to have local reference of the
>> wsdl
>> file in the SEI instead of the hard coding generated by wsdl2java using
>> the
>> maven plugin cxf-codegen :
>>
>> Here is a snapshot :
>>
>> @WebServiceClient(name = "ReportIncidentEndpointService",
>> wsdlLocation =
>> "file:/c:/workspace/osgi/reportincident.domain/src/main/resources/wsdl/repo
>>rt_incident.wsdl", targetNamespace =
>> "http://reportincident.example.camel.apache.org")
>> public class ReportIncidentEndpointService extends Service {
>>
>> public final static URL WSDL_LOCATION;
>> public final static QName SERVICE = new
>> QName("http://reportincident.example.camel.apache.org",
>> "ReportIncidentEndpointService");
>> public final static QName ReportIncidentService = new
>> QName("http://reportincident.example.camel.apache.org",
>> "ReportIncidentService");
>> static {
>> URL url = null;
>> try {
>> url = new
>> URL("file:/c:/workspace/osgi/reportincident.domain/src/main/resources/wsdl/
>>report_incident.wsdl"); } catch (MalformedURLException e) {
>> System.err.println("Can not initialize the default wsdl from
>> file:/c:/workspace/osgi/reportincident.domain/src/main/resources/wsdl/repor
>>t_incident.wsdl"); // e.printStackTrace();
>> }
>> WSDL_LOCATION = url;
>> }
>>
>> Regards,
>>
>>
>>
>> -----
>> Charles Moulliard
>> SOA Architect
>>
>> My Blog : http://cmoulliard.blogspot.com/
>> http://cmoulliard.blogspot.com/
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>
>
--
View this message in context: http://www.nabble.com/How-to-avoid-to-generate-hard-coded-wsdl-file-reference---wsdl2java-tp22349214p22441432.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: How to avoid to generate hard coded wsdl file reference - wsdl2java
Posted by Daniel Kulp <dk...@apache.org>.
There is a wsdlLocation flag on the code generator to specify the location
that is spit into the code. The two common things to stick in there are:
1) META-INF/wsdl/..... to resolve it from the war/classpath type thing
2) Some location that a catalog is then used to fully resolve.
Dan
On Thu March 5 2009 5:42:41 am cmoulliard wrote:
> Hi,
>
> I would like to know if it is possible to have local reference of the wsdl
> file in the SEI instead of the hard coding generated by wsdl2java using the
> maven plugin cxf-codegen :
>
> Here is a snapshot :
>
> @WebServiceClient(name = "ReportIncidentEndpointService",
> wsdlLocation =
> "file:/c:/workspace/osgi/reportincident.domain/src/main/resources/wsdl/repo
>rt_incident.wsdl", targetNamespace =
> "http://reportincident.example.camel.apache.org")
> public class ReportIncidentEndpointService extends Service {
>
> public final static URL WSDL_LOCATION;
> public final static QName SERVICE = new
> QName("http://reportincident.example.camel.apache.org",
> "ReportIncidentEndpointService");
> public final static QName ReportIncidentService = new
> QName("http://reportincident.example.camel.apache.org",
> "ReportIncidentService");
> static {
> URL url = null;
> try {
> url = new
> URL("file:/c:/workspace/osgi/reportincident.domain/src/main/resources/wsdl/
>report_incident.wsdl"); } catch (MalformedURLException e) {
> System.err.println("Can not initialize the default wsdl from
> file:/c:/workspace/osgi/reportincident.domain/src/main/resources/wsdl/repor
>t_incident.wsdl"); // e.printStackTrace();
> }
> WSDL_LOCATION = url;
> }
>
> Regards,
>
>
>
> -----
> Charles Moulliard
> SOA Architect
>
> My Blog : http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/
--
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog
Re: How to avoid to generate hard coded wsdl file reference - wsdl2java
Posted by Bryan Kearney <bk...@redhat.com>.
cmoulliard wrote:
> Hi,
>
> I would like to know if it is possible to have local reference of the wsdl
> file in the SEI instead of the hard coding generated by wsdl2java using the
> maven plugin cxf-codegen :
>
> Here is a snapshot :
>
> @WebServiceClient(name = "ReportIncidentEndpointService",
> wsdlLocation =
> "file:/c:/workspace/osgi/reportincident.domain/src/main/resources/wsdl/report_incident.wsdl",
> targetNamespace =
> "http://reportincident.example.camel.apache.org")
> public class ReportIncidentEndpointService extends Service {
You should be able to put it into the META-INF directory and do
something like:
wsdlLocation = "META-INF/fooo"
-- bk