Lombrera,

The first step before you can run ant generate is to deploy muse to the tomcat container.

To do it you should copy muse dir fom the snapshot distribution and copy it to Tomcat/webapps.

I am assuming that you do all this in your local machine and localhost can be used as it is defined in build.properties file.

If CATALINA_HOME is defined, you should be OK to run ant generate.

You should be OK – without any modifications to the host.wsdl.

Ant generate will generate the classes to your newservice directory. Then you should modify HostHome.java, HostResource.java to add missing pieces.

If you thinkl that at this point you will copy/past the code from examples services/host I would like to warn you that mechanically it will work, but practicly it will not give you what you are looking for. You will have to make changes to the HostHome.java class to make it usable. Below I explain why.

Did you read Muse_example.html file – on the root of examples. This page explains the example application and how it works. From this page you will learn that the example is build on the basis of the factory pattern, in the sense that it is dedicated resource (resourceadmin) which is responsible for creation for any other resources in this application. It has exposed “create” operation which will create the resource instances for you. The host itsself do not exposes the create operation as WSDM available operation and if you copy paste the current code from HostHome to your generated HostHome you will have no way to create an instance of HostrRsources.

You have two options:

  1. use the idea of resources factory – it is a powerfull mechanism allowing dynamically add/remove the resources from the managed model – and add to your new app resourceadmin.wsdl and use example to populate your classes.
  2. Change the code in HostHome to create  HostResource – it will be static picture – the resources you will create will be there.

 

Saying all this I would like to warn you that the new version of muse is just released and few things has been changed. I know that it will be a little painful to start over but unfortunately this is the case. At this same time new version has many bug fixed, has better documentation and is simply a more mature version of the muse that the initial pain will quickly go away….

If you have any problems please ask for help.

I will suggest taking the new release, going through documentation, reading Muse_example.html and trying again.

 

Kinga

 

 

 

 

Kinga Dziembowski

Hewlett-Packard Company

Applied Technology Office (ATO)

856.638.6065

[EMAIL PROTECTED]

 


From: Lombrera Lombrera [mailto:[EMAIL PROTECTED]
Sent: Friday, August 05, 2005 2:54 PM
To: [email protected]
Subject: trying to build my own service in Muse

 

Hi all,
after some days in off, I re-started to enjoy MUSE.

 

Well,
I have been trying to created my own service in MUSE but I am having some trouble.

 

First, trying to make things easy, I tried to build a new service based on the host.wsdl that comes with the snapshot distribution.

 

What I did so far was:

 

 - edited the build.xml file and changed the out.dir to "newservice";

 

 - uncommented the "generate" target;

 

 - in the targets "all", "compile_all", "compile_*" and "deploy_*", I left only

the "logic" and "host" uncommented;

 

 - in the D:\muse-1.0-SNAPSHOT\docs\example\src\wsdl directory, I left only the files host.wsdl, host.xsd, muws-ext-1.xsd, muws-ext-topics-1.xml and shared.xsd;

 
After this, I executed the "ant generate" command and received the following message:

 

>D:\muse-1.0-SNAPSHOT\docs\example\build.xml:65: WSDLException (at /definitions/import[1]/wsdl:definitions/wsdl:types/xsd:
>schema/xsd:schema): faultCode=PARSER_ERROR: Problem parsing 'file:/D:/Tomcat 4.1/webapps/muse/spec/xml/XML-Namespace-1998
>.xsd'.: D:\Tomcat 4.1\webapps\muse\spec\xml\XMLSchema.dtd (The system cannot find the file specified): java.io.FileNotFou
>ndException: D:\Tomcat 4.1\webapps\muse\spec\xml\XMLSchema.dtd (The system cannot find the file specified)

 

 

So, I placed the "XMLSchema.dtd" file in the "D:\Tomcat 4.1\webapps\muse\spec\xml\" dir.
I tried to execute the "ant generate" command again. The output now is:

 

>D:\muse-1.0-SNAPSHOT\docs\example\build.xml:65: WSDLException (at /definitions/import[1]/wsdl:definitions/wsdl:types/xsd:
>schema/xsd:schema): faultCode=PARSER_ERROR: Problem parsing 'file:/D:/Tomcat 4.1/webapps/muse/spec/xml/XML-Namespace-1998
>.xsd'.: D:\Tomcat 4.1\webapps\muse\spec\xml\datatypes.dtd (The system cannot find the file specified): java.io.FileNotFou
>ndException: D:\Tomcat 4.1\webapps\muse\spec\xml\datatypes.dtd (The system cannot find the file specified)
 
So, I placed the "datatypes.dtd " file in the "D:\Tomcat 4.1\webapps\muse\spec\xml\" dir, and executed the "ant generate" again.
The output message now is:

 

 

>BUILD FAILED
>D:\muse-1.0-SNAPSHOT\docs\example\build.xml:65: org.apache.ws.resource.InvalidWsrfWsdlException: Unable to locate the Res
>ourceProperties document element with QName {http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-0
>1.xsd}ScheduledResourceTerminationRP

 

Now, I edited the host.wsdl file and added an element definition for each of the custom resource properties:

 

         <!-- *** Add an element definition here for each of your custom resource properties *** -->
         <!-- *** e.g.: <element name="MyProperty" type="xsd:string" /> *** -->
        
         <element name="NumberOfProcesses" type="xsd:string"/>
         <element name="AvailableMemory" type="xsd:string"/>
         <element name="CpuUsage" type="xsd:string"/>
        

Here, I executed "ant generate" again. The output message now is:

 

>BUILD FAILED
>D:\muse-1.0-SNAPSHOT\docs\example\build.xml:65: org.apache.ws.resource.InvalidWsrfWsdlException: Unable to locate the Res
>ourceProperties document element with QName {http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd}Manageabili
>tyCharacteristicsProperties


 

From now on, I really don't know what to do. I really don't know also if I am going in the rigth direction.. but this is the way I am trying.

Can someone give some help???

Does someone have the filesystem example that comes with Apollo and Pubscribe working in agreement with Muse?
Or does someone have a more simple example to share that the one that comes with the SNAPSHOT distribution? So I could build my one service based on this one?

 

Excuse me for the big message.

 

Really thanks again,
Lombrera.

 

 


Yahoo! Acesso Grátis: Internet rápida e grátis. Instale o discador agora!

Reply via email to