MUSEME wrote:
>
> Hi Bogdan. Here are the answers to your questions:
> 1) No errors were found in the catalina.log file, just the foll. INFO
> items, not sure if they mean anything
> INFO: Jk running ID=0 time=0/30 config=null
> INFO: The Apache Tomcat Native library which allows optimal performance
> in production environments was not found on the java.library.path:
>
That should not be a problem.
MUSEME wrote:
>
> 2) Here is how I call initialize from my client:
> // create EPR for test resource
> URI address =
> URI.create("http://localhost:8080/http-management/services/http-server");
> EndpointReference epr = new EndpointReference(address);
> MyCapability http = new MyCapability(epr);
> //http.setTrace(true);
> try
> { http.initialize();}
> catch (Throwable error)
> {error.printStackTrace();}
>
> And here is the code snippet of MyCapability
> public class MyCapability extends AbstractWsResourceCapability
> implements IMyCapability {
> public MyCapability (EndpointReference arg0) {
> new WsResourceClient(arg0);
> }
> public void initialize()
> throws SoapFault
> { //super.initialize(); - Commented out as this does not work
> // Commented out getInitializationParameter as I get the foll.
> exception
> // java.lang.NullPointerException at
> //org.apache.muse.core.AbstractCapability.getInitializationParameter
> //(AbstractCapability.java:105)
> //String installDir =
> getInitializationParameter("httpd-install-dir");
> String installDir = "C:\\Program Files\\Apache Software
> Foundation\\Apache2.2";
> Map configParams = null;
> try
> { configParams = readConfigFile(installDir+"\\conf\\httpd.conf");}
> catch (IOException error)
> { throw new SoapFault("Error while reading httpd.conf.", error);
> //throw new IOException("Error while reading httpd.conf.",
> error); }
> _ServerName = (String)configParams.get("ServerName");
> String portString = (String)configParams.get("Listen");
> String threadsString = (String)configParams.get("ThreadsPerChild");
> _PortNumber = Integer.valueOf(portString);
> _ThreadsPerChild = Integer.valueOf(threadsString);
>
> // The following statement fails with
> java.lang.NullPointerException
> ResourceManager manager = getResource().getResourceManager();
> ..}
>
That looks wrong, as mentioned by Vinh. The way Muse works is that you have
your resource on the server, which has some capabilities. You can not call
initialize by yourself, as that should be done by the Axis2 container and
the Muse container your resource is running in. The resource basically gets
initialized the first time it receives an invocation. What you need to do is
this:
1. Build your resource and capabilities. Normally you start with the .wsdl
file and you pass it through Muse's wsdl2java. You then implement your
capabilites, make the .war and deploy it (this should be possible via the
build.xml generated by muse.
2. You than take your wsdl file and use wsdl2java to generate a proxy for
it. Make a small tester program that generates a proxy based on your epr,and
than make an invocation for one of the capabilities. When something connects
for the first time to the resource, it will initialize it and its
capabilities. You should not be able to call initialize from your client.
Also you will need the super.initialize() as without it, the capability will
not be initialized correctly.
MUSEME wrote:
>
> 3) The application is built on Axis2.
>
> Not sure if this is relevant but when I list "http-server" URI services
> from Axis2, I see the foll:
>
> http-server
> Service EPR : http://localhost:8080/http-management/services/http-server
> Service REST epr : http://localhost:8080/http-management/rest/http-server
>
> I then click on the http-server hyperlink and get the foll. error:
>
> <error>
> <description>Unable to generate WSDL for this service</description>
> −
> <reason>
> If you wish Axis2 to automatically generate the WSDL, then please use one
> of the RPC message receivers for the service(s)/operation(s) in
> services.xml. If you have added a custom WSDL in the META-INF directory,
> then please make sure that the name of the service in services.xml
> (/serviceGroup/service/@name) is the same as in the custom wsdl's service
> name (/wsdl:definitions/wsdl:service/@name).
> </reason>
> </error>
>
That looks correct. It's not an error, just the behaviour of the Axis2
container I assume.
--
View this message in context:
http://www.nabble.com/Muse-Resource-not-initialized-tf3907854.html#a11099105
Sent from the Muse User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]