views:

622

answers:

2

I have a CXF service service that I created WSDL first and when I deploy the WAR into glassfish app server 2.1.1, I get the following exception:

java.io.FileNotFoundException: C:\Sun\AppServer\domains\domain1\config\TestService.wsdl

If I put the WSDL in that location, everything works fine. How do I setup my WAR so that the TestService.wsdl gets put into the config folder?

Thanks!

UPDATE: I am still having problems deploying this service to Glassfish. As is it deploys and runs fine in Tomcat.

I set the -wsdlLocation property during the build to "WEB-INF/wsdl/TestService.wsdl" but now when I deploy the application in glassifish I get the following exceptions in the server.log

[#|2010-02-01T10:47:06.164-0500|SEVERE|sun-        
appserver2.1|javax.enterprise.system.tools.deployment|_ThreadID=23;_ThreadName=Thread-  
501;_RequestID=d3a3f49b-9329-477d-b6fc-24e0f4e4f3fa;|wsdl file 
file:/C:/development/wexlink/FileUploadService/wsdl/FileUploadService.wsdl does not 
exist for web service FileUploadService|#]

[#|2010-02-01T10:47:06.977-0500|SEVERE|sun     
appserver2.1|javax.enterprise.system.tools.deployment|_ThreadID=23;_ThreadName=Thread-  
501;_RequestID=d3a3f49b-9329-477d-b6fc-24e0f4e4f3fa;|Exception occured in J2EEC 
Phasejava.lang.RuntimeException: wsdl file 
file:/C:/development/wexlink/FileUploadService/wsdl/FileUploadService.wsdl does not 
exist for web service FileUploadService
com.sun.enterprise.deployment.backend.IASDeploymentException: Error loading deployment   
descriptors for module [FileUploadService] -- wsdl file 
file:/C:/development/wexlink/FileUploadService/wsdl/FileUploadService.wsdl does not 
exist for web service FileUploadService
    at   com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:406)
    at com.sun.enterprise.deployment.backend.ModuleDeployer.loadDescriptors(ModuleDeployer.java:426)
    at com.sun.enterprise.deployment.backend.WebModuleDeployer.deploy(WebModuleDeployer.java:160)
    at com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(ModuleDeployer.java:182)
at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:208)
at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:966)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:283)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:835)
at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:187)
at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:225)

Caused by: java.lang.RuntimeException: wsdl file file:/C:/development/wexlink/FileUploadService/wsdl/FileUploadService.wsdl does not exist for web service FileUploadService at com.sun.enterprise.deployment.util.ModuleContentValidator.accept(ModuleContentValidator.java:187) at com.sun.enterprise.deployment.WebBundleDescriptor.visit(WebBundleDescriptor.java:1410) at com.sun.enterprise.deployment.archivist.WebArchivist.postOpen(WebArchivist.java:171) at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:215) at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openArchive(ApplicationArchivist.java:813) at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openArchive(ApplicationArchivist.java:794) at com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:365) ... 10 more |#]

A: 

Normally, you would put it in WEB-INF someplace. Then, when you generate code with wsdl2java or the maven plugin, you pass in a -wsdlLocation flag with WEB-INF/TestService.wsdl or similar so that get's generated into the code.

That said, with CXF, in your jaxws:endpoint config, you can override the wsdlLocation with an attribute on the jaxws:endpoint to specify something like "WEB-INF/TestService.wsdl".

Daniel Kulp
I am placing my wsdl at WEB-INF/wsdl/TestService.wsdl. With that information, should I be giving that to -wsdlLocation when I generate the code as well as specifying that location in the jaxws:endpoint config?
Casey
Yep. That should work perfectly.
Daniel Kulp
A: 

If you put the WSDL file in WEB-INF/wsdl/TestService.wsdl

Your code should be

@WebService(wsdlLocation="TestService.wsdl")

Also you have something in the logs that state

file:/C:/development/wexlink/FileUploadService/wsdl/FileUploadService.wsdl does not exist for web service FileUploadService

This seems to be hard coded in one of your files do a file scan to make sure you don't have it hard coded.

Archimedes Trajano