Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Creation of Webservice error
Creation of Webservice error [message #232298] Wed, 10 June 2009 15:28 Go to next message
Tony Visconti is currently offline Tony ViscontiFriend
Messages: 3
Registered: July 2009
Junior Member
I am trying to create a web service from the following java class:

import com.corda.cvserver.admin.AdminBean;
import com.corda.cvserver.CordaDataStore;
import java.rmi.*;
import java.rmi.registry.*;

public class CVPassword {

private static String registryAddress = "localhost";
private static int registryPort = 1234;
private static String adminUsername = "Admin";
private static String
adminPassword=CordaDataStore.encryptPassword("admin");

public String heyprint(){
return "hey";
}

public static AdminBean getAdminBean()
{
Remote object = null;

Registry registry = null;
try
{
registry = LocateRegistry.getRegistry(registryAddress, registryPort);
System.out.println("I was able to locate the registry! maybe...");
System.out.println("registry.toString(): " +registry.toString());
System.out.println("AdminBean.RMI_OBJECT_NAME: " +
AdminBean.RMI_OBJECT_NAME);

object = registry.lookup(AdminBean.RMI_OBJECT_NAME);
}
catch(RemoteException e)
{
System.out.println("the Remote Exception caught me");
e.printStackTrace();
}
catch(NotBoundException e)
{
System.out.println("the Not Bound Exception caught me");
e.printStackTrace();
}

if(object == null)
{
System.out.println("The registy returned a null object!");
}
AdminBean remoteAdmin = null;
if(object != null && object instanceof AdminBean)
{
remoteAdmin = (AdminBean)object;
}
else
{
System.out.println("Unable to retrieve object from remote registry");
}
return remoteAdmin;
}

}

// end of class

While creating the web service and I first get this warning:
The service class "CVPassword" does not comply to one or more requirements
of the JAX-RPC 1.1 specification, and may not deploy or function correctly.
The value type "com.corda.cvserver.admin.AdminBean" used via the service
class "CVPassword" does not have a public default constructor. Chapter 5.4
of the JAX-RPC 1.1 specification requires a value type to have a public
default constructor, otherwise a JAX-RPC 1.1 compliant Web service engine
may be unable to construct an instance of the value type during
deserialization.

I dont think this would cause a problem because I am not returning an
instance
adminBean from any function.

The webservice starts up fine and just for testing purpose i want to see
if my heyprint method could be invoke, but when I try to do so I get this
error:

Jun 10, 2009 10:24:22 AM org.apache.axis.transport.http.AxisServlet
logException
INFO: Exception:
java.lang.NoClassDefFoundError: com/corda/cvserver/admin/AdminBean
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getDeclaredMethod(Unknown Source)
at
org.apache.axis.description.JavaServiceDesc.loadServiceDescB yIntrospection(JavaServiceDesc.java:874)
at
org.apache.axis.providers.java.JavaProvider.initServiceDesc( JavaProvider.java:477)
at
org.apache.axis.handlers.soap.SOAPService.getInitializedServ iceDesc(SOAPService.java:286)
at
org.apache.axis.deployment.wsdd.WSDDService.makeNewInstance( WSDDService.java:500)
at
org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewIns tance(WSDDDeployableItem.java:274)
at
org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstan ce(WSDDDeployableItem.java:260)
at
org.apache.axis.deployment.wsdd.WSDDDeployment.getService(WS DDDeployment.java:427)
at
org.apache.axis.configuration.FileProvider.getService(FilePr ovider.java:231)
at org.apache.axis.AxisEngine.getService(AxisEngine.java:311)
at
org.apache.axis.MessageContext.setTargetService(MessageConte xt.java:756)
at org.apache.axis.handlers.http.URLMapper.invoke(URLMapper.jav a:50)
at
org.apache.axis.strategies.InvocationStrategy.visit(Invocati onStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:239 )
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServle t.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at
org.apache.axis.transport.http.AxisServletBase.service(AxisS ervletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:263)
at
org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHand ler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoin t.java:447)
at java.lang.Thread.run(Unknown Source)

Why does adminBean have anything to do with my heyprint method?
Re: Creation of Webservice error [message #232315 is a reply to message #232298] Wed, 10 June 2009 16:07 Go to previous messageGo to next message
Tony Visconti is currently offline Tony ViscontiFriend
Messages: 3
Registered: July 2009
Junior Member
here is the wsdl, if that matters

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://DefaultNamespace"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://DefaultNamespace" xmlns:intf="http://DefaultNamespace"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
<wsdl:types>
<schema elementFormDefault="qualified"
targetNamespace="http://DefaultNamespace"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="changePassword">
<complexType>
<sequence>
<element name="username" type="xsd:string"/>
<element name="newPassword" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="changePasswordResponse">
<complexType/>
</element>
<element name="heyprint">
<complexType/>
</element>
<element name="heyprintResponse">
<complexType>
<sequence>
<element name="heyprintReturn" type="xsd:string"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>

<wsdl:message name="changePasswordResponse">

<wsdl:part element="impl:changePasswordResponse" name="parameters"/>

</wsdl:message>

<wsdl:message name="heyprintResponse">

<wsdl:part element="impl:heyprintResponse" name="parameters"/>

</wsdl:message>

<wsdl:message name="changePasswordRequest">

<wsdl:part element="impl:changePassword" name="parameters"/>

</wsdl:message>

<wsdl:message name="heyprintRequest">

<wsdl:part element="impl:heyprint" name="parameters"/>

</wsdl:message>

<wsdl:portType name="CVPassword">

<wsdl:operation name="changePassword">

<wsdl:input message="impl:changePasswordRequest"
name="changePasswordRequest"/>

<wsdl:output message="impl:changePasswordResponse"
name="changePasswordResponse"/>

</wsdl:operation>

<wsdl:operation name="heyprint">

<wsdl:input message="impl:heyprintRequest"
name="heyprintRequest"/>

<wsdl:output message="impl:heyprintResponse"
name="heyprintResponse"/>

</wsdl:operation>

</wsdl:portType>

<wsdl:binding name="CVPasswordSoapBinding" type="impl:CVPassword">

<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>

<wsdl:operation name="changePassword">

<wsdlsoap:operation soapAction=""/>

<wsdl:input name="changePasswordRequest">

<wsdlsoap:body use="literal"/>

</wsdl:input>

<wsdl:output name="changePasswordResponse">

<wsdlsoap:body use="literal"/>

</wsdl:output>

</wsdl:operation>

<wsdl:operation name="heyprint">

<wsdlsoap:operation soapAction=""/>

<wsdl:input name="heyprintRequest">

<wsdlsoap:body use="literal"/>

</wsdl:input>

<wsdl:output name="heyprintResponse">

<wsdlsoap:body use="literal"/>

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

<wsdl:service name="CVPasswordService">

<wsdl:port binding="impl:CVPasswordSoapBinding" name="CVPassword">

<wsdlsoap:address
location="http://localhost:2020/CordaPwdMgmt/services/CVPassword"/>

</wsdl:port>

</wsdl:service>

</wsdl:definitions>
Re: Creation of Webservice error Resolved [message #232349 is a reply to message #232315] Wed, 10 June 2009 20:23 Go to previous message
Tony Visconti is currently offline Tony ViscontiFriend
Messages: 3
Registered: July 2009
Junior Member
I checked the errors and found under warnings:

Classpath entry C:/Documents …/CenterViewServer.jar will not be exported
or published. Runtime ClassNotFoundExceptions may result.

Fell like this should have gone under errors...

This lead to quick fix that solved my problems:
Mark the associated raw classpath entry as a publish/export dependency.
Previous Topic:Problem with Ant task <xsl.xinclude>
Next Topic:WTP and static resources in utility projects
Goto Forum:
  


Current Time: Thu Nov 27 04:58:05 GMT 2014

Powered by FUDForum. Page generated in 0.01673 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software