You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-user@ws.apache.org by dulbirakan <ie...@gmail.com> on 2008/04/27 23:18:48 UTC

Re: trouble with WsnTestClient after new wsn-producer.war file

I had the same problem, infact I still have it.

I used muse 2.2.0's wsdl2java in ubuntu linux (7.10 and 8.04) both to no
avail but it worked under windows XP in my advisors computer. 

First I change the binding in sample-wsn-producer.wsdl to point to my
producer (wsn-srv) then I change the source of wsn-consumers test class to
point to my producer. Then I issue wsdl2java command and deploy services. I
get the same error message you are getting (the one with HR). I also
deployed one with default settings, it was a no go also.

I issue:

$ sudo sh /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl
sample-wsn-producer.wsdl -output wsn-srv/ -overwrite

I get a :
[: 38: cygwin: unexpected operator

but everything seems to be in place and I run ant and copy the resulting war
files to my tomcat webapps folder. These war files however, once deployed do
not act as axis2 services. When I click on one in tomcat manager I see the
following message instead of the usual axis2 web interface:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

org.apache.jasper.JasperException: java.lang.NullPointerException

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:356)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
	org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

java.lang.NullPointerException

org.apache.jsp.axis2_002dweb.include.httpbase_jsp.jspInit(httpbase_jsp.java:22)
	org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:51)

org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:159)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
	org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

note The full stack trace of the root cause is available in the Apache
Tomcat/6.0.16 logs.
Apache Tomcat/6.0.16


I really would appreciate if it would just run under ubuntu.

I guess the problem might be related to the cygwin problem I stated earlier.
Does any one have any clue?


dchou wrote:
> 
> Hello,
> 
> I am able to drop the sample wsn-producer.war and wsn-consumer.war files
> into my Tomcat and they run fine when I run the WsnTestClient. However,
> when I do a wsdl2java build in the wsn-producer directory then build a new
> war using Ant. I get an error message with this newly created
> wsn-producer.war. I have changed no code. Only performed wsdl2java and
> ant. The steps and error I get when I run the WsnTestClient is as follows:
> 
> $wsdl2java -j2ee axis2 -overwrite -wsdl wsdl/WsResource.wsdl 
> 
> $ ant-1.6.5/bin/ant  
> 
> I then run the test client, WsnTestClient and get the following output: 
> 
> [CLIENT TRACE] SOAP envelope contents (outgoing):
> 
> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
>     <soap:Header>
>         <wsa:To
> xmlns:wsa="http://www.w3.org/2005/08/addressing">http://166.21.9.161:8080/wsn-producer/services/WsResource</wsa:To>
>         <wsa:Action
> xmlns:wsa="http://www.w3.org/2005/08/addressing">http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeRequest</wsa:Action>
>         <wsa:MessageID
> xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:f6255f7a-9b73-1057-4620-a4ec2be5ff0a</wsa:MessageID>
>         <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
>            
> <wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
>         </wsa:From>
>     </soap:Header>
>     <soap:Body>
>         <wsnt:Subscribe xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
>             <wsnt:ConsumerReference>
>                 <wsa:Address
> xmlns:wsa="http://www.w3.org/2005/08/addressing">http://166.21.9.175:8060/wsn-consumer/services/consumer</wsa:Address>
>             </wsnt:ConsumerReference>
>         </wsnt:Subscribe>
>     </soap:Body>
> </soap:Envelope>
> 
> [Fatal Error] :1:1040: The element type "HR" must be terminated by the
> matching end-tag "</HR>".
> org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR" must
> be terminated by the matching end-tag "</HR>".
>         at
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:298)
>         at
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:254)
>         at
> org.apache.muse.ws.notification.remote.NotificationProducerClient.subscribe(NotificationProducerClient.java:97)
>         at org.apache.muse.test.wsn.WsnTestClient.main(Unknown Source)
> 
> Does anyone have any idea what I am doing wrong? I have changed no code. I
> just wanted to try and build a new war with the method outlined in the
> tutorial. Any help would be appreciated.
> 
> Thanks,
> Dave
> 

-- 
View this message in context: http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.war-file-tp10191599p16928534.html
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


Re: trouble with WsnTestClient after new wsn-producer.war file

Posted by Irfan Emrah Kanat <ie...@gmail.com>.
I finally managed to workout what was wrong. I was using JDK 1.6 and it was
the culprit. Installing JDK 1.5 solved the problem.

What a bummer....

Thanks to all for help

On Mon, Apr 28, 2008 at 11:58 PM, Vinh Nguyen (vinguye2) <vi...@cisco.com>
wrote:

> If you ran wsdl2java on your sample-wsn-producer.wsdl and deployed the
> generated muse.xml as-is, that's probably why you're getting errors.
> For example, the Tomcat logs would show this during
> initialization/testing:
>
> java.lang.RuntimeException: [ID = 'IncorrectCapabilityRoot']
> org.apache.ws.muse.test.wsrf.MyCapability does not implement
> org.apache.muse.core.Capability, which is a required interface for all
> capability classes.
>        at
> org.apache.muse.core.descriptor.CapabilityDefinition.setImplementationCl
> ass(CapabilityDefinition.java:110)
>        at
> org.apache.muse.core.descriptor.SimpleCapabilityDescriptor.load(SimpleCa
> pabilityDescriptor.java:104)
>        at
> org.apache.muse.core.descriptor.SimpleResourceDescriptor.createCapabilit
> yDefinitions(SimpleResourceDescriptor.java:99)
>        at
> org.apache.muse.core.descriptor.SimpleResourceDescriptor.load(SimpleReso
> urceDescriptor.java:401)
>        at
> org.apache.muse.core.descriptor.SimpleDeploymentDescriptor.createResourc
> eDefinitions(SimpleDeploymentDescriptor.java:78)
>        at
> org.apache.muse.core.descriptor.SimpleDeploymentDescriptor.load(SimpleDe
> ploymentDescriptor.java:177)
>        at
> org.apache.muse.core.platform.AbstractIsolationLayer.initialize(Abstract
> IsolationLayer.java:152)
>        at
> org.apache.muse.core.platform.mini.MiniServlet.createIsolationLayer(Mini
> Servlet.java:55)
>        at
> org.apache.muse.core.platform.mini.MiniServlet.doPost(MiniServlet.java:6
> 9)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
> tionFilterChain.java:252)
>        ...
>
> You need to manually review and update the generated muse.xml first:
>
> 1) In the WsResource definition, change the <wsdl-file> value to
> "wsdl/sample-wsn-producer.wsdl".
> 2) Change the capability reference from MyCapability to
> MyCapabilityImpl.
> 3) In the SubscriptionManager definition, change the <wsdl-file> value
> to "wsdl/WS-BaseNotification-1_3.wsdl".
>
> Redeploy and test, and everything should be fine now.
> -Vinh
>
>
> -----Original Message-----
> From: Vinh Nguyen (vinguye2)
> Sent: Monday, April 28, 2008 1:43 PM
> To: muse-user@ws.apache.org
> Subject: RE: trouble with WsnTestClient after new wsn-producer.war file
>
> Can you paste your muse.xml and services.xml configurations?  I suspect
> the problems are here.
>
>
>
> -----Original Message-----
> From: Irfan Emrah Kanat [mailto:iekanat@gmail.com]
> Sent: Monday, April 28, 2008 1:18 PM
> To: muse-user@ws.apache.org
> Subject: Re: trouble with WsnTestClient after new wsn-producer.war file
>
> Thanks, but my problem is a bit different.
>
> I can deploy the samples in ubuntu, no problem.
>
> But when I try to build the sample wsn producer from the wsdl file via
> wsdl2java provided with muse 2.2.0 in ubuntu I have some problems. I can
> build the same file in windows without any problems though... So I guess
> it is a linux specific problem. I am writing a tutorial for next years
> Web Services Class I am providing the last section which I have the
> problems so that you can see what steps I have taken so far... It is not
> completed yet...
>
>

RE: trouble with WsnTestClient after new wsn-producer.war file

Posted by "Vinh Nguyen (vinguye2)" <vi...@cisco.com>.
If you ran wsdl2java on your sample-wsn-producer.wsdl and deployed the
generated muse.xml as-is, that's probably why you're getting errors.
For example, the Tomcat logs would show this during
initialization/testing:

java.lang.RuntimeException: [ID = 'IncorrectCapabilityRoot']
org.apache.ws.muse.test.wsrf.MyCapability does not implement
org.apache.muse.core.Capability, which is a required interface for all
capability classes.
	at
org.apache.muse.core.descriptor.CapabilityDefinition.setImplementationCl
ass(CapabilityDefinition.java:110)
	at
org.apache.muse.core.descriptor.SimpleCapabilityDescriptor.load(SimpleCa
pabilityDescriptor.java:104)
	at
org.apache.muse.core.descriptor.SimpleResourceDescriptor.createCapabilit
yDefinitions(SimpleResourceDescriptor.java:99)
	at
org.apache.muse.core.descriptor.SimpleResourceDescriptor.load(SimpleReso
urceDescriptor.java:401)
	at
org.apache.muse.core.descriptor.SimpleDeploymentDescriptor.createResourc
eDefinitions(SimpleDeploymentDescriptor.java:78)
	at
org.apache.muse.core.descriptor.SimpleDeploymentDescriptor.load(SimpleDe
ploymentDescriptor.java:177)
	at
org.apache.muse.core.platform.AbstractIsolationLayer.initialize(Abstract
IsolationLayer.java:152)
	at
org.apache.muse.core.platform.mini.MiniServlet.createIsolationLayer(Mini
Servlet.java:55)
	at
org.apache.muse.core.platform.mini.MiniServlet.doPost(MiniServlet.java:6
9)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:252)
	...

You need to manually review and update the generated muse.xml first:

1) In the WsResource definition, change the <wsdl-file> value to
"wsdl/sample-wsn-producer.wsdl".
2) Change the capability reference from MyCapability to
MyCapabilityImpl.
3) In the SubscriptionManager definition, change the <wsdl-file> value
to "wsdl/WS-BaseNotification-1_3.wsdl".

Redeploy and test, and everything should be fine now.
-Vinh


-----Original Message-----
From: Vinh Nguyen (vinguye2) 
Sent: Monday, April 28, 2008 1:43 PM
To: muse-user@ws.apache.org
Subject: RE: trouble with WsnTestClient after new wsn-producer.war file

Can you paste your muse.xml and services.xml configurations?  I suspect
the problems are here.

 

-----Original Message-----
From: Irfan Emrah Kanat [mailto:iekanat@gmail.com]
Sent: Monday, April 28, 2008 1:18 PM
To: muse-user@ws.apache.org
Subject: Re: trouble with WsnTestClient after new wsn-producer.war file

Thanks, but my problem is a bit different.

I can deploy the samples in ubuntu, no problem.

But when I try to build the sample wsn producer from the wsdl file via
wsdl2java provided with muse 2.2.0 in ubuntu I have some problems. I can
build the same file in windows without any problems though... So I guess
it is a linux specific problem. I am writing a tutorial for next years
Web Services Class I am providing the last section which I have the
problems so that you can see what steps I have taken so far... It is not
completed yet...

That is it about the environment, we now have the Muse to build our WSs
and
AXIS2 to deploy them. It would have been nice if we had Eclipse WTP in
place but everything has its time. We will be using the samples from the
tutorial and deploy the WS Notification producer and WS Notification
consumer that come with Muse to test our environment. I assume you have
a basic understanding of what a WSDL file describes, like the types,
port types and bindings.

* Get to the samples:

    The samples are in muse folder.

    "cd /opt/muse-2.2.0-bin/samples/j2ee"

* First comes the producer:

    Let's build the producer first

    "cd /opt/muse-2.2.0-bin/samples/j2ee/wsn-producer"
    "sudo ant"

    You should see a 'BUILD SUCCESSFUL' and we should now have
wsn-producer.war in build folder.

    Deploy the service into the container, Tomcat comes preconfigured to
deploy any war files copied into its webapps folder.

    "sudo cp build/wsn-producer.war /opt/apache-tomcat-6.0.16/webapps/"

    Browse to the localhost:8080/manager to see if it is deployed, its
display name should read 'Apache Muse Servlet'. Muse servlets have no
interface to reach through your browser.

* Now the consumer:

    Build the consumer

    "cd /opt/muse-2.2.0-bin/samples/j2ee/wsn-consumer"
    "sudo ant"

    Deploy the service into the container.
    "sudo cp build/wsn-consumer.war /opt/apache-tomcat-6.0.16/webapps/"

    Browse to the localhost:8080/manager to see if it is deployed.

* Test:

    Run the command below to test the services you just deployed:

    "ant run -Dmain=org.apache.muse.test.wsn.WsnTestClient"

    The stdout should read:


    Buildfile: build.xml

    init:

    run:
         [java] [CLIENT TRACE] SOAP envelope contents (outgoing):
         [java]
         [java] <soap:Envelope xmlns:soap="
http://www.w3.org/2003/05/soap-envelope">
         [java]     <soap:Header>
         [java]         <wsa:To xmlns:wsa="
http://www.w3.org/2005/08/addressing">
http://127.0.1.1:8080/wsn-producer/services/WsResource</wsa:To>
         [java]         <wsa:Action xmlns:wsa="
http://www.w3.org/2005/08/addressing">
http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/
        .
        .
        .
         [java]     </soap:Body>
         [java] </soap:Envelope>
         [java]
         [java] [CLIENT TRACE] SOAP envelope contents (incoming):
         [java]
         [java] <soap:Envelope xmlns:soap="
http://www.w3.org/2003/05/soap-envelope">
         [java]     <soap:Header>
         [java]         <wsa:To xmlns:wsa="
http://www.w3.org/2005/08/addressing">
http://www.w3.org/2005/08/addressing/role/anonymous</wsa:To>
         [java]         <wsa:Action xmlns:wsa="
http://www.w3.org/2005/08/addressing">
http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/
        .
        .
        .
         [java]     </soap:Body>
         [java] </soap:Envelope>
         [java]

    BUILD SUCCESSFUL
    Total time: 4 seconds

13: First Cover Song

In the previous section we tested our environment but did not use muse
much.
Now we will be covering the famous wsn-producer from the MUSE. This
section will cover the use of wsdl2java tool and we will be editing some
source code here as well. I used Apache Muse tutorial on
http://ws.apache.org/muse/docs/2.2.0/tutorial/index.html it has some
errors but is more detailed than this one here.

* Get the sample WSDL file:
    Preparing a wsdl file is a tedious process, with only a text editor
as tool it is a total nightmare, that is why we will be using the WSDL
file provided in muse tutorial. We will test our environment with this
sample WS.

    "cd ~"
    "wget
http://ws.apache.org/muse/docs/2.2.0/tutorial/artifacts/sample-wsn-produ
cer.wsdl
"

* Lets get this sample file to someplace cosy

    "cd Desktop"
    "mkdir samp"
    "cd samp"
    "cp ~/sample-wsn-producer ."

* Generate the skeleton code
    We need war files that can be deployed into AXIS2 so we will stick
with the J2EE.
    sudo sh /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl
sample-wsn-producer.wsdl

    Huh? What happened you say? Uh, I should have guessed... You see the
wsdl file we placed there refers to other xml documents and the tool
can't find them, so let's get them in place first. We don't have to look
too hard as they are kindly provided with muse...

    "cp /opt/muse-2.2.0-bin/samples/j2ee/wsn-producer/wsdl/* ."

    We probably won't need all of them but it is simpler to just get
them all in any case.
    Let's see what we have in the directory now:

    "ls"

    You should see a bunch of xsd and wsdl files, these should be the
same with the files included in sample-wsn-producer.wsdl.
    We will create the server side of the code in a seperate folder, the
name of the war file and thus the service will be same as the name of
this folder.

* At this point I must point to a critical issue; if you create your
service in any folder except wsn-producer you should change the binding
in WSDL file.

    Edit the sample-wsn-producer.wsdl:

    "gedit sample-wsn-producer.wsdl"

    At the very end of the file there is a binding that goes like

    <wsdl:port name="WsResourcePort" binding="tns:WsResourceBinding">
            <wsdl-soap:address location="
http://localhost:8080/wsn-producer/services/WsResource" />
    </wsdl:port>

    Replace the wsn-producer part with your directory address. I will
use 'wsn-srv' as directory name so I would use:

    <wsdl:port name="WsResourcePort" binding="tns:WsResourceBinding">
            <wsdl-soap:address location="
http://localhost:8080/wsn-srv/services/WsResource" />
    </wsdl:port>

* Let's create the server code.

    "mkdir wsn-srv"
    "sudo sh /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl
sample-wsn-producer.wsdl -output wsn-srv"

!AT THIS POINT I AM GETTING A CYGWIN ERROR!

    There should be two folders (JavaSource and WebContent) and an
build.xml file for ANT in wsn-srv directory now. Before running ANT we
have a few stuff to clear though, the java files in JavaSource folder
(yes I know there is a train of empty folders under those classes, that
is the namespace URI defined in WSDL file) are only the skeleton classes
and they need to be fleshed. At this stage I recommend you to see Apache
Muse tutorial's Deployment Descriptor section to find out about the
Resource URI:

    From what I found out my resource URI's context paths would be
WsResource and SubscriptionManager. So the URI would be:
    "http://localhost:8080/wsn-srv/services/SubscriptionManager"

* Get to Coding
    As I have been mentioning for a while we have to inject the business
logic to the skeleton classes. Muse can only help us so far to generate
the code, but it will help us once more in packaging the code before
this tutorial is through.

    Muse samples already include the code we need to implement, so if
you want to have a look just browse to the samples folder under the muse
deployment and have a look at the source of wsn-producer. In my setup
the address was
"/opt/muse-2.2.0-bin/samples/j2ee/wsn-producer/src/org/apache/ws/muse/te
st/wsrf/"

    "sudo gedit
~/Desktop/samp/wsn-srv/JavaSource/org/apache/ws/muse/test/wsrf/MyCapabil
ity.java"

    In the end my source code ended up something like:

    //
    // MyCapability.java
    // Tue Apr 22 16:45:01 EEST 2008
    // Generated by the Apache Muse Code Generation Tool
    //
    package org.apache.ws.muse.test.wsrf;

    import javax.xml.namespace.QName;

    import org.w3c.dom.Element;

    import org.apache.muse.util.xml.XmlUtils;
    import org.apache.muse.ws.addressing.soap.SoapFault;
    import org.apache.muse.ws.notification.NotificationProducer;
    import org.apache.muse.ws.notification.WsnConstants;
    import
org.apache.muse.ws.resource.impl.AbstractWsResourceCapability;

    public class MyCapability extends AbstractWsResourceCapability
implements IMyCapability
    {
        private static final QName[] _PROPERTIES = new QName[] {
                new QName(NAMESPACE_URI, "MessageInterval", PREFIX),
                new QName(NAMESPACE_URI, "ServerName", PREFIX)
        };

        private static final QName _TOPIC_NAME = new
QName(NAMESPACE_URI, "MyTopic", PREFIX);

        public QName[] getPropertyNames()
        {
            return _PROPERTIES;
        }

    // You can assign any value you may want to the two variables below.
        private int _MessageInterval = 10;

        private String _ServerName = "muse-test.apache.org";

        public int getMessageInterval()
        {
            return _MessageInterval;
        }

        public void setMessageInterval(int param0)
        {
            _MessageInterval = param0;
        }

        public String getServerName()
        {
            return _ServerName;
        }

        public void setServerName(String param0)
        {
            _ServerName = param0;
        }

        public void initializeCompleted()
            throws SoapFault
        {
            super.initializeCompleted();

            //
            // access resource's WSN capability and create a new topic
            //
            final NotificationProducer wsn =
(NotificationProducer)getResource().getCapability(WsnConstants.PRODUCER_
URI);

            wsn.addTopic(_TOPIC_NAME);

            Thread producer = new Thread() {
                public void run()
                {
                    //
                    // for this example, reuse one payload for every
notification
                    //
                    QName messageName = new QName(NAMESPACE_URI,
"MyMessage", PREFIX);
                    String message = "This is a message from " +
getServerName();
                    Element payload =
XmlUtils.createElement(messageName,
message);

                    while (true)
                    {
                        try
                        {
                            //
                            // read current value - property is mutable
                            //
                            int currentInterval = getMessageInterval();

                            getLog().info("Waiting " + currentInterval +
"
seconds before sending message...");
                            Thread.currentThread().sleep(currentInterval
* 1000);

                            //
                            // use WSN capability to send message to any
subscribers
                            //
                            getLog().info("Sending message to
consumers...");
                            wsn.publish(_TOPIC_NAME, payload);
                        }

                        catch (Throwable error)
                        {
                            error.printStackTrace();
                        }
                    }
                }
            };
            producer.start();
        }
    }

    It is almost identical to the source code given with muse.

* Wrap it up
    We will use Apache Ant tool once more to create our war package.

    "cd ~/Desktop/samp/wsn-srv/"
    "sudo ant"

* Deploy it
    You can either deploy the service through web interface of your
server or through command line. If you choose to deploy it through web
interface just make sure the server is running.

    "sudo cp wsn-srv.war /opt/apache-tomcat-6.0.16/webapps"

   THE SERVICE IS NOT DEPLOYED CORRECTLY I AM GETTING A HTTP STATUS 500
ERROR


On Mon, Apr 28, 2008 at 11:03 PM, Vinh Nguyen (vinguye2)
<vi...@cisco.com>
wrote:

> Hi,
> I just redeployed the Muse 2.2.0 wsn-consumer and wsn-producer samples

> to a local Tomcat 5.5 server on Windows XP.  Then I ran the 
> WsnTestClient in wsn-consumer.  Everything works fine for me, and 
> notifictions are being received properly every 10 seconds.
>
> You shouldn't need to modify anything since the samples should be 
> runnable "out of the box".
>
> Here's the steps to reproduce the test
> 1) In the wsn-producer project, do "ant".
>   Then manually deploy the wsn-producer.war to C:\tomcat\webapps\
> 2) In the wsn-consumer project, do "ant".
>   Then manually deploy the wsn-consumer.war to C:\tomcat\webapps\
> 3) Start your Tomcat.
> 4) In the wsn-consumer project, do "ant 
> -Dmain=org.apache.muse.test.wsn.WsnTestClient run".
>   The console should show the SOAP trace for the Subscribe 
> request/response.
> 5) Check for notifications in
> C:\tomcat\webapps\wsn-consumer\WEB-INF\classes\log\muse.log
>
> Hope this helps...
> -Vinh
>
>
> -----Original Message-----
> From: Lenni Madsen [mailto:l.madsen@mil.dk]
> Sent: Monday, April 28, 2008 6:51 AM
> To: muse-user@ws.apache.org
> Subject: SV: trouble with WsnTestClient after new wsn-producer.war 
> file
>
> Hmm... this issue warrants a bit more exploring from my side, for some

> reason I seem to have problems with the subscription manager for 
> muse-2.3.0-2008-04-07-02-00-bin, it keeps reporting:
>
> [Fatal Error] :12:184: The element type "HR" must be terminated by the

> matching end-tag "</HR>".
> org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR" 
> must be terminated by the matching end-tag "</HR>".
>        at
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceCli
> en
> t.ja
> va:298)
>        at
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceCli
> en
> t.ja
> va:254)
>        at
> org.apache.muse.ws.notification.remote.NotificationProducerClient.subs
> cr
> ibe(
> NotificationProducerClient.java:97)
>        at
> org.apache.muse.test.wsn.WsnTestClient.main(WsnTestClient.java:79)
>
> yet the subscription mechanism seems to work:
>
> *#*# message accepted #*#*
> 2008-04-28 15:47:28
> org.apache.muse.test.wsn.impl.ConsumerCapabilityImpl
> process
>
> INFO: Received message:
>
> <wsnt:NotificationMessage
>    xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
>    xmlns:muse-wsa="http://ws.apache.org/muse/addressing"
>    xmlns:tns="http://ws.apache.org/muse/test/wsrf"
> xmlns:wsa="http://www.w3.org
> /2005/08/addressing">
>    <wsnt:SubscriptionReference>
>        <wsa:Address
> xmlns:wsa="http://www.w3.org/2005/08/addressing">http://10.
> 0.19.16:8080/wsn-producer/services/SubscriptionManager</wsa:Address>
>        <wsa:ReferenceParameters
> xmlns:wsa="http://www.w3.org/2005/08/addressing
> ">
>            <muse-wsa:ResourceId
> xmlns:muse-wsa="http://ws.apache.org/muse/addre
> ssing">MuseResource-1</muse-wsa:ResourceId>
>        </wsa:ReferenceParameters>
>    </wsnt:SubscriptionReference>
>    <wsnt:Topic
>
> Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Concrete" 
> xm
lns:tns="http://ws.apache.org/muse/test/wsrf">tns:MyTopic</wsnt:Topic>
>    <wsnt:ProducerReference>
>        <wsa:ReferenceParameters
> xmlns:wsa="http://www.w3.org/2005/08/addressing
> "/>
>        <wsa:Address
> xmlns:wsa="http://www.w3.org/2005/08/addressing">http://10.
> 0.19.16:8080/wsn-producer/services/WsResource</wsa:Address>
>    </wsnt:ProducerReference>
>    <wsnt:Message>
>        <tns:MyMessage
> xmlns:tns="http://ws.apache.org/muse/test/wsrf">This
> is a
>  message from muse-test.apache.org</tns:MyMessage>
>    </wsnt:Message>
> </wsnt:NotificationMessage>
>
> [Fatal Error] :12:184: The element type "HR" must be terminated by the

> matching end-tag "</HR>".
> 2008-04-28 15:47:29 org.apache.muse.util.LoggingUtils logError
> INFO: There was an error while processing a request:
>
> The element type "HR" must be terminated by the matching end-tag 
> "</HR>".
>
>
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceCli
> en
> t.java:298)
>
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceCli
> en
> t.java:254)
>
> org.apache.muse.ws.notification.remote.NotificationConsumerClient.noti
> fy
> (NotificationConsumerClient.java:99)
>
> org.apache.muse.ws.notification.impl.SimpleSubscriptionManager.publish
> (S
> impleSubscriptionManager.java:267)
>
> org.apache.muse.ws.notification.impl.SimpleNotificationProducer.publis
> h(
> SimpleNotificationProducer.java:525)
>
> org.apache.muse.ws.notification.impl.SimpleNotificationProducer.publis
> h(
> SimpleNotificationProducer.java:500)
>
> org.apache.ws.muse.test.wsrf.MyCapabilityImpl$1.run(MyCapabilityImpl.j
> av
> a:104)
>
> ------------------------------------------
>
> I think I need to revert to a earlier version of my setup to make sure

> that it's not just a fault in my setup.
>
> FYI: if you use tomcat 6.0.16 you'll run into some warnings regarding 
> listeners already registered
> http://forum.springframework.org/showthread.php?p=175433
>
>
> -----Oprindelig meddelelse-----
> Fra: Irfan Emrah Kanat [mailto:iekanat@gmail.com]
> Sendt: 28. april 2008 11:48
> Til: muse-user@ws.apache.org
> Emne: Re: trouble with WsnTestClient after new wsn-producer.war file
>
> Thanks for your prompt reply Mr. Madsen
>
> The below approach does not fit me as I modified the MyCapability.java

> as given below:
>
> //
>    // MyCapability.java
>    // Tue Apr 22 16:45:01 EEST 2008
>    // Generated by the Apache Muse Code Generation Tool
>    //
>    package org.apache.ws.muse.test.wsrf;
>
>    import javax.xml.namespace.QName;
>
>    import org.w3c.dom.Element;
>
>    import org.apache.muse.util.xml.XmlUtils;
>    import org.apache.muse.ws.addressing.soap.SoapFault;
>    import org.apache.muse.ws.notification.NotificationProducer;
>    import org.apache.muse.ws.notification.WsnConstants;
>    import
> org.apache.muse.ws.resource.impl.AbstractWsResourceCapability;
>
>    public class MyCapability extends AbstractWsResourceCapability 
> implements IMyCapability
>    {
>        private static final QName[] _PROPERTIES = new QName[] {
>                new QName(NAMESPACE_URI, "MessageInterval", PREFIX),
>                new QName(NAMESPACE_URI, "ServerName", PREFIX)
>        };
>
>        private static final QName _TOPIC_NAME = new 
> QName(NAMESPACE_URI, "MyTopic", PREFIX);
>
>        public QName[] getPropertyNames()
>        {
>            return _PROPERTIES;
>        }
>
>    // You can assign any value you may want to the two variables
below.
>        private int _MessageInterval = 10;
>
>        private String _ServerName = "muse-test.apache.org";
>
>        public int getMessageInterval()
>        {
>            return _MessageInterval;
>        }
>
>        public void setMessageInterval(int param0)
>        {
>            _MessageInterval = param0;
>        }
>
>        public String getServerName()
>        {
>            return _ServerName;
>        }
>
>        public void setServerName(String param0)
>        {
>            _ServerName = param0;
>        }
>
>        public void initializeCompleted()
>            throws SoapFault
>        {
>            super.initializeCompleted();
>
>            //
>            // access resource's WSN capability and create a new topic
>            //
>            final NotificationProducer wsn = 
> (NotificationProducer)getResource().getCapability(WsnConstants.PRODUCE
> R_
> URI)
> ;
>
>            wsn.addTopic(_TOPIC_NAME);
>
>            Thread producer = new Thread() {
>                public void run()
>                {
>                    //
>                    // for this example, reuse one payload for every 
> notification
>                    //
>                    QName messageName = new QName(NAMESPACE_URI, 
> "MyMessage", PREFIX);
>                    String message = "This is a message from " + 
> getServerName();
>                    Element payload =
> XmlUtils.createElement(messageName,
> message);
>
>                    while (true)
>                    {
>                        try
>                        {
>                            //
>                            // read current value - property is mutable
>                            //
>                            int currentInterval = getMessageInterval();
>
>                            getLog().info("Waiting " + currentInterval
> + "
> seconds before sending message...");
>                            
> Thread.currentThread().sleep(currentInterval
> * 1000);
>
>                            //
>                            // use WSN capability to send message to 
> any subscribers
>                            //
>                            getLog().info("Sending message to 
> consumers...");
>                            wsn.publish(_TOPIC_NAME, payload);
>                        }
>
>                        catch (Throwable error)
>                        {
>                            error.printStackTrace();
>                        }
>                    }
>                }
>            };
>            producer.start();
>        }
>    }
>
>    It is almost identical to the source code given with muse.
>
> On Mon, Apr 28, 2008 at 12:43 PM, Lenni Madsen <l....@mil.dk>
wrote:
>
> > A thing just occurred to me, the people affected by this issue seems

> > to follow the following approach (please correct me when/if I'm 
> > wrong,
>
> > I'll assume this is correctly understood until further notice):
> >
> >
> >
> > 1)       wsdl2java is called on one or more wsdl's from the
sample-wsn
> > project
> >
> > 2)       no code is edited after wsdl2java is called (no files are
> copied
> > to
> > the project after wsdl2java is called either)
> >
> > 3)       the war file is deployed
> >
> > 4)       the project experiences one or more errors
> >
> >
> >
> > from my past experiences with the sample-wsn project and indeed any 
> > further development issues I have had with wsn, one needs to make 
> > sure
>
> > that the generated code is edited to be up to spec, for one thing 
> > some
>
> > important wsn-producer code is not put in the MyCapability.java 
> > (might
>
> > have another name if you're using the more advance naming options) 
> > initialize function.
> >
> >
> >
> > *** what you get ***
> >
> > public void initialize() throws SoapFault
> >
> >    {
> >
> >        //
> >
> >        //The following call is necessary to property initialize the 
> > resource
> >
> >        //
> >
> >        super.initialize();
> >
> >
> >
> >        //
> >
> >        //TODO perform intitialization of the following non-primitive

> > properties
> >
> >        //
> >
> >        // ServerName
> >
> >        //
> >
> >
> >
> >        throw new RuntimeException("User needs to update 
> > initialization
>
> > code");
> >
> > }
> >
> >
> >
> > *** what you need for the sample-wsn ***
> >
> > public void initialize() throws SoapFault
> >
> >    {
> >
> >        //
> >
> >        //The following call is necessary to property initialize the 
> > resource
> >
> >        //
> >
> >        super.initialize();
> >
> >
> >
> >        //
> >
> >        //TODO perform intitialization of the following non-primitive

> > properties
> >
> >        //
> >
> >        // ServerName
> >
> >        //
> >
> >
> >
> > //        throw new RuntimeException("User needs to update
> initialization
> > code");
> >
> >        _ServerName = "sample-wsn-producer";
> >
> >        wsn =
> >
> >
> (NotificationProducer)getResource().getCapability(WsnConstants.PRODUCE
> R_
> URI)
> > ;
> >
> >        // move this code below to a function if you wish to use it 
> > when called and not continuously
> >
> >        QName topicName = new
> > QName("http://example.com/server-product",
> > "ServerUpdates");
> >
> >        wsn.addTopic(topicName);
> >
> >        QName messageName = new
> > QName("http://example.com/server-product",
> > "UpdateMessage");
> >
> >        String updateMessage = "Something important happened!";
> >
> >        Element payload = XmlUtils.createElement(messageName,
> > updateMessage);
> >
> >        wsn.publish(topicName, payload);
> >
> >    }
> >
> >
> >
> > Not sure if it helps at all, but at least it closes one possible 
> > issue
>
> > related to starting up the application and initialization of the
> producer.
> >
> >
> >
> > Mr. Kanat, please don't worry about replying to the mail group 
> > message
>
> > it's here for questions and debate regarding the use of the Muse 
> > framework and I find I learn new things every time I have a look at 
> > other peoples issues with Muse. sometimes a solution for a problems 
> > ends up enhancing my own projects.
> >
> >
> >
> > /Lenni
> >
> >  _____
> >
> > Fra: Irfan Emrah Kanat [mailto:iekanat@gmail.com]
> > Sendt: 28. april 2008 10:56
> > Til: muse-user@ws.apache.org
> > Emne: Re: trouble with WsnTestClient after new wsn-producer.war file
> >
> >
> >
> > I am not sure if this is the right way to reply to a mail group 
> > message but it is my first time so forgive me just this once.
> >
> > I set the binding in wsdl file as I stated earlier but here, I am 
> > attaching my wsdl file here.
> >
> > There is also another problem. I guess Mr. Nguyen is right as my app

> > does not seem to be starting up. As I posted in my previous post, I 
> > build it as an axis2 app. but in tomcat manager I can not see the 
> > usual web interface of axis2. I get an HTTP Status 500 error. It 
> > seems
>
> > to me that my app is not built correctly. The fact that I am getting

> > a
>
> > cygwin error alleviates my belief.
> >
> > Here is the command I issue and the error message I get:
> >
> > dulbirakan@chibi:~/Desktop/samp$ sudo sh 
> > /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl 
> > sample-wsn-producer.wsdl -output wsn-srv/ -overwrite
> > [: 38: cygwin: unexpected operator
> > dulbirakan@chibi:~/Desktop/samp$
> >
> > If there is anything else I can provide please let me know...
> >
> >
> >
> >
> >
> >
> >
> > On Mon, Apr 28, 2008 at 9:08 AM, Lenni Madsen <l....@mil.dk>
wrote:
> >
> > Hi there
> >
> > Could you attach your wsdl file? It might be something fairly simple

> > and therefore easy to overlook in the wsdl, I know I've missed small

> > important stuff time and time again.
> >
> >
> > [Fatal Error] :1:1040: The element type "HR" must be terminated by 
> > the
> > > matching end-tag "</HR>".
> > > org.apache.muse.ws.addressing.soap.SoapFault: The element type
"HR"
> > > must be terminated by the matching end-tag "</HR>".
> >
> > This error comes when you're trying to use a wrong or incomplete 
> > EndpointReference. The error message is very generic.
> >
> > /Lenni
> >
> >
> > -----Oprindelig meddelelse-----
> > Fra: dulbirakan [mailto:iekanat@gmail.com]
> > Sendt: 27. april 2008 23:19
> > Til: muse-user@ws.apache.org
> > Emne: Re: trouble with WsnTestClient after new wsn-producer.war file
> >
> >
> >
> > I had the same problem, infact I still have it.
> >
> > I used muse 2.2.0's wsdl2java in ubuntu linux (7.10 and 8.04) both 
> > to no avail but it worked under windows XP in my advisors computer.
> >
> > First I change the binding in sample-wsn-producer.wsdl to point to 
> > my producer (wsn-srv) then I change the source of wsn-consumers test

> > class to point to my producer. Then I issue wsdl2java command and
> deploy services.
> > I
> > get the same error message you are getting (the one with HR). I also

> > deployed one with default settings, it was a no go also.
> >
> > I issue:
> >
> > $ sudo sh /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl 
> > sample-wsn-producer.wsdl -output wsn-srv/ -overwrite
> >
> > I get a :
> > [: 38: cygwin: unexpected operator
> >
> > but everything seems to be in place and I run ant and copy the 
> > resulting war files to my tomcat webapps folder. These war files 
> > however, once deployed do not act as axis2 services. When I click on

> > one in tomcat manager I see the following message instead of the 
> > usual
>
> > axis2 web interface:
> >
> > HTTP Status 500 -
> >
> > type Exception report
> >
> > message
> >
> > description The server encountered an internal error () that 
> > prevented
>
> > it from fulfilling this request.
> >
> > exception
> >
> > org.apache.jasper.JasperException: java.lang.NullPointerException
> >
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServ
> le
> tWra
> > pper.java:522)
> >
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
> ja
> va:3
> > 56)
> >
> >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:33
> 7)
> >
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> >
> >
> org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.
> ja
> va:9
> > 68)
> >
> > org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78
> > )
> >
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
> ja
> va:3
> > 74)
> >
> >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:33
> 7)
> >
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> > root cause
> >
> > java.lang.NullPointerException
> >
> >
> >
> org.apache.jsp.axis2_002dweb.include.httpbase_jsp.jspInit(httpbase_jsp
> .j
> ava:
> > 22)
> >       
> > org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:51)
> >
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapp
> er
> .jav
> > a:159)
> >
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
> ja
> va:3
> > 29)
> >
> >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:33
> 7)
> >
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> >
> >
> org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.
> ja
> va:9
> > 68)
> >
> > org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78
> > )
> >
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
> ja
> va:3
> > 74)
> >
> >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:33
> 7)
> >
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> > note The full stack trace of the root cause is available in the 
> > Apache
> > Tomcat/6.0.16 logs.
> > Apache Tomcat/6.0.16
> >
> >
> > I really would appreciate if it would just run under ubuntu.
> >
> > I guess the problem might be related to the cygwin problem I stated 
> > earlier.
> > Does any one have any clue?
> >
> >
> > dchou wrote:
> > >
> > > Hello,
> > >
> > > I am able to drop the sample wsn-producer.war and wsn-consumer.war

> > > files into my Tomcat and they run fine when I run the
WsnTestClient.
>
> > > However, when I do a wsdl2java build in the wsn-producer directory

> > > then build a
> > new
> > > war using Ant. I get an error message with this newly created 
> > > wsn-producer.war. I have changed no code. Only performed wsdl2java

> > > and ant. The steps and error I get when I run the WsnTestClient is

> > > as
> > follows:
> > >
> > > $wsdl2java -j2ee axis2 -overwrite -wsdl wsdl/WsResource.wsdl
> > >
> > > $ ant-1.6.5/bin/ant
> > >
> > > I then run the test client, WsnTestClient and get the following
> output:
> > >
> > > [CLIENT TRACE] SOAP envelope contents (outgoing):
> > >
> > > <soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
> > >     <soap:Header>
> > >         <wsa:To
> > >
> > xmlns:wsa="http://www.w3.org/2005/08/addressing">
> > http://166.21.9.161:8080/ws
> > <http://166.21.9.161:8080/wsn-producer/services/WsResource>
> > n-producer/services/WsResource</wsa:To>
> > >         <wsa:Action
> > >
> > xmlns:wsa="http://www.w3.org/2005/08/addressing">
> > http://docs.oasis-open.org/
> > <http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeR
> > eq
> > uest
> > >
> > wsn/bw-2/NotificationProducer/SubscribeRequest</wsa:Action>
> > >         <wsa:MessageID
> > >
> > xmlns:wsa="http://www.w3.org/2005/08/addressing
> > ">uuid:f6255f7a-9b73-1057-462
> > 0-a4ec2be5ff0a</wsa:MessageID>
> > >         <wsa:From
> > > xmlns:wsa="http://www.w3.org/2005/08/addressing">
> > >
> > >
> > <wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous
> > </wsa:Addres
> > s>
> > >         </wsa:From>
> > >     </soap:Header>
> > >     <soap:Body>
> > >         <wsnt:Subscribe
> xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
> > >             <wsnt:ConsumerReference>
> > >                 <wsa:Address
> > >
> > xmlns:wsa="http://www.w3.org/2005/08/addressing">
> > http://166.21.9.175:8060/ws
> > <http://166.21.9.175:8060/wsn-consumer/services/consumer>
> > n-consumer/services/consumer</wsa:Address>
> > >             </wsnt:ConsumerReference>
> > >         </wsnt:Subscribe>
> > >     </soap:Body>
> > > </soap:Envelope>
> > >
> > > [Fatal Error] :1:1040: The element type "HR" must be terminated by

> > > the matching end-tag "</HR>".
> > > org.apache.muse.ws.addressing.soap.SoapFault: The element type
"HR"
> > > must be terminated by the matching end-tag "</HR>".
> > >         at
> > >
> >
> >
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceCli
> en
> t.ja
> > va:298)
> > >         at
> > >
> >
> >
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceCli
> en
> t.ja
> > va:254)
> > >         at
> > >
> >
> >
> org.apache.muse.ws.notification.remote.NotificationProducerClient.subs
> cr
> ibe(
> > NotificationProducerClient.java:97)
> > >         at org.apache.muse.test.wsn.WsnTestClient.main(Unknown
> > > Source)
> > >
> > > Does anyone have any idea what I am doing wrong? I have changed no
> code.
> > I
> > > just wanted to try and build a new war with the method outlined in

> > > the tutorial. Any help would be appreciated.
> > >
> > > Thanks,
> > > Dave
> > >
> >
> > --
> > View this message in context:
> >
> >
>
http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.
> war-
> > <
> >
>
http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.
> war
> >
> -file-tp10191599p16928534.html<http://www.nabble.com/trouble-with-WsnT
> es
> tCli
> ent-after-new-wsn-producer.war-file-tp10191599p16928534.html>
> > >
> > file-tp10191599p16928534.html
> > Sent from the Muse User mailing list archive at Nabble.com.
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: muse-user-help@ws.apache.org
> >
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: muse-user-help@ws.apache.org
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


RE: trouble with WsnTestClient after new wsn-producer.war file

Posted by "Vinh Nguyen (vinguye2)" <vi...@cisco.com>.
Can you paste your muse.xml and services.xml configurations?  I suspect
the problems are here.

 

-----Original Message-----
From: Irfan Emrah Kanat [mailto:iekanat@gmail.com] 
Sent: Monday, April 28, 2008 1:18 PM
To: muse-user@ws.apache.org
Subject: Re: trouble with WsnTestClient after new wsn-producer.war file

Thanks, but my problem is a bit different.

I can deploy the samples in ubuntu, no problem.

But when I try to build the sample wsn producer from the wsdl file via
wsdl2java provided with muse 2.2.0 in ubuntu I have some problems. I can
build the same file in windows without any problems though... So I guess
it is a linux specific problem. I am writing a tutorial for next years
Web Services Class I am providing the last section which I have the
problems so that you can see what steps I have taken so far... It is not
completed yet...

That is it about the environment, we now have the Muse to build our WSs
and
AXIS2 to deploy them. It would have been nice if we had Eclipse WTP in
place but everything has its time. We will be using the samples from the
tutorial and deploy the WS Notification producer and WS Notification
consumer that come with Muse to test our environment. I assume you have
a basic understanding of what a WSDL file describes, like the types,
port types and bindings.

* Get to the samples:

    The samples are in muse folder.

    "cd /opt/muse-2.2.0-bin/samples/j2ee"

* First comes the producer:

    Let's build the producer first

    "cd /opt/muse-2.2.0-bin/samples/j2ee/wsn-producer"
    "sudo ant"

    You should see a 'BUILD SUCCESSFUL' and we should now have
wsn-producer.war in build folder.

    Deploy the service into the container, Tomcat comes preconfigured to
deploy any war files copied into its webapps folder.

    "sudo cp build/wsn-producer.war /opt/apache-tomcat-6.0.16/webapps/"

    Browse to the localhost:8080/manager to see if it is deployed, its
display name should read 'Apache Muse Servlet'. Muse servlets have no
interface to reach through your browser.

* Now the consumer:

    Build the consumer

    "cd /opt/muse-2.2.0-bin/samples/j2ee/wsn-consumer"
    "sudo ant"

    Deploy the service into the container.
    "sudo cp build/wsn-consumer.war /opt/apache-tomcat-6.0.16/webapps/"

    Browse to the localhost:8080/manager to see if it is deployed.

* Test:

    Run the command below to test the services you just deployed:

    "ant run -Dmain=org.apache.muse.test.wsn.WsnTestClient"

    The stdout should read:


    Buildfile: build.xml

    init:

    run:
         [java] [CLIENT TRACE] SOAP envelope contents (outgoing):
         [java]
         [java] <soap:Envelope xmlns:soap="
http://www.w3.org/2003/05/soap-envelope">
         [java]     <soap:Header>
         [java]         <wsa:To xmlns:wsa="
http://www.w3.org/2005/08/addressing">
http://127.0.1.1:8080/wsn-producer/services/WsResource</wsa:To>
         [java]         <wsa:Action xmlns:wsa="
http://www.w3.org/2005/08/addressing">
http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/
        .
        .
        .
         [java]     </soap:Body>
         [java] </soap:Envelope>
         [java]
         [java] [CLIENT TRACE] SOAP envelope contents (incoming):
         [java]
         [java] <soap:Envelope xmlns:soap="
http://www.w3.org/2003/05/soap-envelope">
         [java]     <soap:Header>
         [java]         <wsa:To xmlns:wsa="
http://www.w3.org/2005/08/addressing">
http://www.w3.org/2005/08/addressing/role/anonymous</wsa:To>
         [java]         <wsa:Action xmlns:wsa="
http://www.w3.org/2005/08/addressing">
http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/
        .
        .
        .
         [java]     </soap:Body>
         [java] </soap:Envelope>
         [java]

    BUILD SUCCESSFUL
    Total time: 4 seconds

13: First Cover Song

In the previous section we tested our environment but did not use muse
much.
Now we will be covering the famous wsn-producer from the MUSE. This
section will cover the use of wsdl2java tool and we will be editing some
source code here as well. I used Apache Muse tutorial on
http://ws.apache.org/muse/docs/2.2.0/tutorial/index.html it has some
errors but is more detailed than this one here.

* Get the sample WSDL file:
    Preparing a wsdl file is a tedious process, with only a text editor
as tool it is a total nightmare, that is why we will be using the WSDL
file provided in muse tutorial. We will test our environment with this
sample WS.

    "cd ~"
    "wget
http://ws.apache.org/muse/docs/2.2.0/tutorial/artifacts/sample-wsn-produ
cer.wsdl
"

* Lets get this sample file to someplace cosy

    "cd Desktop"
    "mkdir samp"
    "cd samp"
    "cp ~/sample-wsn-producer ."

* Generate the skeleton code
    We need war files that can be deployed into AXIS2 so we will stick
with the J2EE.
    sudo sh /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl
sample-wsn-producer.wsdl

    Huh? What happened you say? Uh, I should have guessed... You see the
wsdl file we placed there refers to other xml documents and the tool
can't find them, so let's get them in place first. We don't have to look
too hard as they are kindly provided with muse...

    "cp /opt/muse-2.2.0-bin/samples/j2ee/wsn-producer/wsdl/* ."

    We probably won't need all of them but it is simpler to just get
them all in any case.
    Let's see what we have in the directory now:

    "ls"

    You should see a bunch of xsd and wsdl files, these should be the
same with the files included in sample-wsn-producer.wsdl.
    We will create the server side of the code in a seperate folder, the
name of the war file and thus the service will be same as the name of
this folder.

* At this point I must point to a critical issue; if you create your
service in any folder except wsn-producer you should change the binding
in WSDL file.

    Edit the sample-wsn-producer.wsdl:

    "gedit sample-wsn-producer.wsdl"

    At the very end of the file there is a binding that goes like

    <wsdl:port name="WsResourcePort" binding="tns:WsResourceBinding">
            <wsdl-soap:address location="
http://localhost:8080/wsn-producer/services/WsResource" />
    </wsdl:port>

    Replace the wsn-producer part with your directory address. I will
use 'wsn-srv' as directory name so I would use:

    <wsdl:port name="WsResourcePort" binding="tns:WsResourceBinding">
            <wsdl-soap:address location="
http://localhost:8080/wsn-srv/services/WsResource" />
    </wsdl:port>

* Let's create the server code.

    "mkdir wsn-srv"
    "sudo sh /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl
sample-wsn-producer.wsdl -output wsn-srv"

!AT THIS POINT I AM GETTING A CYGWIN ERROR!

    There should be two folders (JavaSource and WebContent) and an
build.xml file for ANT in wsn-srv directory now. Before running ANT we
have a few stuff to clear though, the java files in JavaSource folder
(yes I know there is a train of empty folders under those classes, that
is the namespace URI defined in WSDL file) are only the skeleton classes
and they need to be fleshed. At this stage I recommend you to see Apache
Muse tutorial's Deployment Descriptor section to find out about the
Resource URI:

    From what I found out my resource URI's context paths would be
WsResource and SubscriptionManager. So the URI would be:
    "http://localhost:8080/wsn-srv/services/SubscriptionManager"

* Get to Coding
    As I have been mentioning for a while we have to inject the business
logic to the skeleton classes. Muse can only help us so far to generate
the code, but it will help us once more in packaging the code before
this tutorial is through.

    Muse samples already include the code we need to implement, so if
you want to have a look just browse to the samples folder under the muse
deployment and have a look at the source of wsn-producer. In my setup
the address was
"/opt/muse-2.2.0-bin/samples/j2ee/wsn-producer/src/org/apache/ws/muse/te
st/wsrf/"

    "sudo gedit
~/Desktop/samp/wsn-srv/JavaSource/org/apache/ws/muse/test/wsrf/MyCapabil
ity.java"

    In the end my source code ended up something like:

    //
    // MyCapability.java
    // Tue Apr 22 16:45:01 EEST 2008
    // Generated by the Apache Muse Code Generation Tool
    //
    package org.apache.ws.muse.test.wsrf;

    import javax.xml.namespace.QName;

    import org.w3c.dom.Element;

    import org.apache.muse.util.xml.XmlUtils;
    import org.apache.muse.ws.addressing.soap.SoapFault;
    import org.apache.muse.ws.notification.NotificationProducer;
    import org.apache.muse.ws.notification.WsnConstants;
    import
org.apache.muse.ws.resource.impl.AbstractWsResourceCapability;

    public class MyCapability extends AbstractWsResourceCapability
implements IMyCapability
    {
        private static final QName[] _PROPERTIES = new QName[] {
                new QName(NAMESPACE_URI, "MessageInterval", PREFIX),
                new QName(NAMESPACE_URI, "ServerName", PREFIX)
        };

        private static final QName _TOPIC_NAME = new
QName(NAMESPACE_URI, "MyTopic", PREFIX);

        public QName[] getPropertyNames()
        {
            return _PROPERTIES;
        }

    // You can assign any value you may want to the two variables below.
        private int _MessageInterval = 10;

        private String _ServerName = "muse-test.apache.org";

        public int getMessageInterval()
        {
            return _MessageInterval;
        }

        public void setMessageInterval(int param0)
        {
            _MessageInterval = param0;
        }

        public String getServerName()
        {
            return _ServerName;
        }

        public void setServerName(String param0)
        {
            _ServerName = param0;
        }

        public void initializeCompleted()
            throws SoapFault
        {
            super.initializeCompleted();

            //
            // access resource's WSN capability and create a new topic
            //
            final NotificationProducer wsn =
(NotificationProducer)getResource().getCapability(WsnConstants.PRODUCER_
URI);

            wsn.addTopic(_TOPIC_NAME);

            Thread producer = new Thread() {
                public void run()
                {
                    //
                    // for this example, reuse one payload for every
notification
                    //
                    QName messageName = new QName(NAMESPACE_URI,
"MyMessage", PREFIX);
                    String message = "This is a message from " +
getServerName();
                    Element payload =
XmlUtils.createElement(messageName,
message);

                    while (true)
                    {
                        try
                        {
                            //
                            // read current value - property is mutable
                            //
                            int currentInterval = getMessageInterval();

                            getLog().info("Waiting " + currentInterval +
"
seconds before sending message...");
                            Thread.currentThread().sleep(currentInterval
* 1000);

                            //
                            // use WSN capability to send message to any
subscribers
                            //
                            getLog().info("Sending message to
consumers...");
                            wsn.publish(_TOPIC_NAME, payload);
                        }

                        catch (Throwable error)
                        {
                            error.printStackTrace();
                        }
                    }
                }
            };
            producer.start();
        }
    }

    It is almost identical to the source code given with muse.

* Wrap it up
    We will use Apache Ant tool once more to create our war package.

    "cd ~/Desktop/samp/wsn-srv/"
    "sudo ant"

* Deploy it
    You can either deploy the service through web interface of your
server or through command line. If you choose to deploy it through web
interface just make sure the server is running.

    "sudo cp wsn-srv.war /opt/apache-tomcat-6.0.16/webapps"

   THE SERVICE IS NOT DEPLOYED CORRECTLY I AM GETTING A HTTP STATUS 500
ERROR


On Mon, Apr 28, 2008 at 11:03 PM, Vinh Nguyen (vinguye2)
<vi...@cisco.com>
wrote:

> Hi,
> I just redeployed the Muse 2.2.0 wsn-consumer and wsn-producer samples

> to a local Tomcat 5.5 server on Windows XP.  Then I ran the 
> WsnTestClient in wsn-consumer.  Everything works fine for me, and 
> notifictions are being received properly every 10 seconds.
>
> You shouldn't need to modify anything since the samples should be 
> runnable "out of the box".
>
> Here's the steps to reproduce the test
> 1) In the wsn-producer project, do "ant".
>   Then manually deploy the wsn-producer.war to C:\tomcat\webapps\
> 2) In the wsn-consumer project, do "ant".
>   Then manually deploy the wsn-consumer.war to C:\tomcat\webapps\
> 3) Start your Tomcat.
> 4) In the wsn-consumer project, do "ant 
> -Dmain=org.apache.muse.test.wsn.WsnTestClient run".
>   The console should show the SOAP trace for the Subscribe 
> request/response.
> 5) Check for notifications in
> C:\tomcat\webapps\wsn-consumer\WEB-INF\classes\log\muse.log
>
> Hope this helps...
> -Vinh
>
>
> -----Original Message-----
> From: Lenni Madsen [mailto:l.madsen@mil.dk]
> Sent: Monday, April 28, 2008 6:51 AM
> To: muse-user@ws.apache.org
> Subject: SV: trouble with WsnTestClient after new wsn-producer.war 
> file
>
> Hmm... this issue warrants a bit more exploring from my side, for some

> reason I seem to have problems with the subscription manager for 
> muse-2.3.0-2008-04-07-02-00-bin, it keeps reporting:
>
> [Fatal Error] :12:184: The element type "HR" must be terminated by the

> matching end-tag "</HR>".
> org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR" 
> must be terminated by the matching end-tag "</HR>".
>        at
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceCli
> en
> t.ja
> va:298)
>        at
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceCli
> en
> t.ja
> va:254)
>        at
> org.apache.muse.ws.notification.remote.NotificationProducerClient.subs
> cr
> ibe(
> NotificationProducerClient.java:97)
>        at
> org.apache.muse.test.wsn.WsnTestClient.main(WsnTestClient.java:79)
>
> yet the subscription mechanism seems to work:
>
> *#*# message accepted #*#*
> 2008-04-28 15:47:28 
> org.apache.muse.test.wsn.impl.ConsumerCapabilityImpl
> process
>
> INFO: Received message:
>
> <wsnt:NotificationMessage
>    xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
>    xmlns:muse-wsa="http://ws.apache.org/muse/addressing"
>    xmlns:tns="http://ws.apache.org/muse/test/wsrf"
> xmlns:wsa="http://www.w3.org
> /2005/08/addressing">
>    <wsnt:SubscriptionReference>
>        <wsa:Address
> xmlns:wsa="http://www.w3.org/2005/08/addressing">http://10.
> 0.19.16:8080/wsn-producer/services/SubscriptionManager</wsa:Address>
>        <wsa:ReferenceParameters
> xmlns:wsa="http://www.w3.org/2005/08/addressing
> ">
>            <muse-wsa:ResourceId
> xmlns:muse-wsa="http://ws.apache.org/muse/addre
> ssing">MuseResource-1</muse-wsa:ResourceId>
>        </wsa:ReferenceParameters>
>    </wsnt:SubscriptionReference>
>    <wsnt:Topic
>
> Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Concrete" 
> xm
lns:tns="http://ws.apache.org/muse/test/wsrf">tns:MyTopic</wsnt:Topic>
>    <wsnt:ProducerReference>
>        <wsa:ReferenceParameters
> xmlns:wsa="http://www.w3.org/2005/08/addressing
> "/>
>        <wsa:Address
> xmlns:wsa="http://www.w3.org/2005/08/addressing">http://10.
> 0.19.16:8080/wsn-producer/services/WsResource</wsa:Address>
>    </wsnt:ProducerReference>
>    <wsnt:Message>
>        <tns:MyMessage
> xmlns:tns="http://ws.apache.org/muse/test/wsrf">This
> is a
>  message from muse-test.apache.org</tns:MyMessage>
>    </wsnt:Message>
> </wsnt:NotificationMessage>
>
> [Fatal Error] :12:184: The element type "HR" must be terminated by the

> matching end-tag "</HR>".
> 2008-04-28 15:47:29 org.apache.muse.util.LoggingUtils logError
> INFO: There was an error while processing a request:
>
> The element type "HR" must be terminated by the matching end-tag 
> "</HR>".
>
>
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceCli
> en
> t.java:298)
>
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceCli
> en
> t.java:254)
>
> org.apache.muse.ws.notification.remote.NotificationConsumerClient.noti
> fy
> (NotificationConsumerClient.java:99)
>
> org.apache.muse.ws.notification.impl.SimpleSubscriptionManager.publish
> (S
> impleSubscriptionManager.java:267)
>
> org.apache.muse.ws.notification.impl.SimpleNotificationProducer.publis
> h(
> SimpleNotificationProducer.java:525)
>
> org.apache.muse.ws.notification.impl.SimpleNotificationProducer.publis
> h(
> SimpleNotificationProducer.java:500)
>
> org.apache.ws.muse.test.wsrf.MyCapabilityImpl$1.run(MyCapabilityImpl.j
> av
> a:104)
>
> ------------------------------------------
>
> I think I need to revert to a earlier version of my setup to make sure

> that it's not just a fault in my setup.
>
> FYI: if you use tomcat 6.0.16 you'll run into some warnings regarding 
> listeners already registered
> http://forum.springframework.org/showthread.php?p=175433
>
>
> -----Oprindelig meddelelse-----
> Fra: Irfan Emrah Kanat [mailto:iekanat@gmail.com]
> Sendt: 28. april 2008 11:48
> Til: muse-user@ws.apache.org
> Emne: Re: trouble with WsnTestClient after new wsn-producer.war file
>
> Thanks for your prompt reply Mr. Madsen
>
> The below approach does not fit me as I modified the MyCapability.java

> as given below:
>
> //
>    // MyCapability.java
>    // Tue Apr 22 16:45:01 EEST 2008
>    // Generated by the Apache Muse Code Generation Tool
>    //
>    package org.apache.ws.muse.test.wsrf;
>
>    import javax.xml.namespace.QName;
>
>    import org.w3c.dom.Element;
>
>    import org.apache.muse.util.xml.XmlUtils;
>    import org.apache.muse.ws.addressing.soap.SoapFault;
>    import org.apache.muse.ws.notification.NotificationProducer;
>    import org.apache.muse.ws.notification.WsnConstants;
>    import
> org.apache.muse.ws.resource.impl.AbstractWsResourceCapability;
>
>    public class MyCapability extends AbstractWsResourceCapability 
> implements IMyCapability
>    {
>        private static final QName[] _PROPERTIES = new QName[] {
>                new QName(NAMESPACE_URI, "MessageInterval", PREFIX),
>                new QName(NAMESPACE_URI, "ServerName", PREFIX)
>        };
>
>        private static final QName _TOPIC_NAME = new 
> QName(NAMESPACE_URI, "MyTopic", PREFIX);
>
>        public QName[] getPropertyNames()
>        {
>            return _PROPERTIES;
>        }
>
>    // You can assign any value you may want to the two variables
below.
>        private int _MessageInterval = 10;
>
>        private String _ServerName = "muse-test.apache.org";
>
>        public int getMessageInterval()
>        {
>            return _MessageInterval;
>        }
>
>        public void setMessageInterval(int param0)
>        {
>            _MessageInterval = param0;
>        }
>
>        public String getServerName()
>        {
>            return _ServerName;
>        }
>
>        public void setServerName(String param0)
>        {
>            _ServerName = param0;
>        }
>
>        public void initializeCompleted()
>            throws SoapFault
>        {
>            super.initializeCompleted();
>
>            //
>            // access resource's WSN capability and create a new topic
>            //
>            final NotificationProducer wsn = 
> (NotificationProducer)getResource().getCapability(WsnConstants.PRODUCE
> R_
> URI)
> ;
>
>            wsn.addTopic(_TOPIC_NAME);
>
>            Thread producer = new Thread() {
>                public void run()
>                {
>                    //
>                    // for this example, reuse one payload for every 
> notification
>                    //
>                    QName messageName = new QName(NAMESPACE_URI, 
> "MyMessage", PREFIX);
>                    String message = "This is a message from " + 
> getServerName();
>                    Element payload =
> XmlUtils.createElement(messageName,
> message);
>
>                    while (true)
>                    {
>                        try
>                        {
>                            //
>                            // read current value - property is mutable
>                            //
>                            int currentInterval = getMessageInterval();
>
>                            getLog().info("Waiting " + currentInterval 
> + "
> seconds before sending message...");
>                            
> Thread.currentThread().sleep(currentInterval
> * 1000);
>
>                            //
>                            // use WSN capability to send message to 
> any subscribers
>                            //
>                            getLog().info("Sending message to 
> consumers...");
>                            wsn.publish(_TOPIC_NAME, payload);
>                        }
>
>                        catch (Throwable error)
>                        {
>                            error.printStackTrace();
>                        }
>                    }
>                }
>            };
>            producer.start();
>        }
>    }
>
>    It is almost identical to the source code given with muse.
>
> On Mon, Apr 28, 2008 at 12:43 PM, Lenni Madsen <l....@mil.dk>
wrote:
>
> > A thing just occurred to me, the people affected by this issue seems

> > to follow the following approach (please correct me when/if I'm 
> > wrong,
>
> > I'll assume this is correctly understood until further notice):
> >
> >
> >
> > 1)       wsdl2java is called on one or more wsdl's from the
sample-wsn
> > project
> >
> > 2)       no code is edited after wsdl2java is called (no files are
> copied
> > to
> > the project after wsdl2java is called either)
> >
> > 3)       the war file is deployed
> >
> > 4)       the project experiences one or more errors
> >
> >
> >
> > from my past experiences with the sample-wsn project and indeed any 
> > further development issues I have had with wsn, one needs to make 
> > sure
>
> > that the generated code is edited to be up to spec, for one thing 
> > some
>
> > important wsn-producer code is not put in the MyCapability.java 
> > (might
>
> > have another name if you're using the more advance naming options) 
> > initialize function.
> >
> >
> >
> > *** what you get ***
> >
> > public void initialize() throws SoapFault
> >
> >    {
> >
> >        //
> >
> >        //The following call is necessary to property initialize the 
> > resource
> >
> >        //
> >
> >        super.initialize();
> >
> >
> >
> >        //
> >
> >        //TODO perform intitialization of the following non-primitive

> > properties
> >
> >        //
> >
> >        // ServerName
> >
> >        //
> >
> >
> >
> >        throw new RuntimeException("User needs to update 
> > initialization
>
> > code");
> >
> > }
> >
> >
> >
> > *** what you need for the sample-wsn ***
> >
> > public void initialize() throws SoapFault
> >
> >    {
> >
> >        //
> >
> >        //The following call is necessary to property initialize the 
> > resource
> >
> >        //
> >
> >        super.initialize();
> >
> >
> >
> >        //
> >
> >        //TODO perform intitialization of the following non-primitive

> > properties
> >
> >        //
> >
> >        // ServerName
> >
> >        //
> >
> >
> >
> > //        throw new RuntimeException("User needs to update
> initialization
> > code");
> >
> >        _ServerName = "sample-wsn-producer";
> >
> >        wsn =
> >
> >
> (NotificationProducer)getResource().getCapability(WsnConstants.PRODUCE
> R_
> URI)
> > ;
> >
> >        // move this code below to a function if you wish to use it 
> > when called and not continuously
> >
> >        QName topicName = new
> > QName("http://example.com/server-product",
> > "ServerUpdates");
> >
> >        wsn.addTopic(topicName);
> >
> >        QName messageName = new
> > QName("http://example.com/server-product",
> > "UpdateMessage");
> >
> >        String updateMessage = "Something important happened!";
> >
> >        Element payload = XmlUtils.createElement(messageName,
> > updateMessage);
> >
> >        wsn.publish(topicName, payload);
> >
> >    }
> >
> >
> >
> > Not sure if it helps at all, but at least it closes one possible 
> > issue
>
> > related to starting up the application and initialization of the
> producer.
> >
> >
> >
> > Mr. Kanat, please don't worry about replying to the mail group 
> > message
>
> > it's here for questions and debate regarding the use of the Muse 
> > framework and I find I learn new things every time I have a look at 
> > other peoples issues with Muse. sometimes a solution for a problems 
> > ends up enhancing my own projects.
> >
> >
> >
> > /Lenni
> >
> >  _____
> >
> > Fra: Irfan Emrah Kanat [mailto:iekanat@gmail.com]
> > Sendt: 28. april 2008 10:56
> > Til: muse-user@ws.apache.org
> > Emne: Re: trouble with WsnTestClient after new wsn-producer.war file
> >
> >
> >
> > I am not sure if this is the right way to reply to a mail group 
> > message but it is my first time so forgive me just this once.
> >
> > I set the binding in wsdl file as I stated earlier but here, I am 
> > attaching my wsdl file here.
> >
> > There is also another problem. I guess Mr. Nguyen is right as my app

> > does not seem to be starting up. As I posted in my previous post, I 
> > build it as an axis2 app. but in tomcat manager I can not see the 
> > usual web interface of axis2. I get an HTTP Status 500 error. It 
> > seems
>
> > to me that my app is not built correctly. The fact that I am getting

> > a
>
> > cygwin error alleviates my belief.
> >
> > Here is the command I issue and the error message I get:
> >
> > dulbirakan@chibi:~/Desktop/samp$ sudo sh 
> > /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl 
> > sample-wsn-producer.wsdl -output wsn-srv/ -overwrite
> > [: 38: cygwin: unexpected operator
> > dulbirakan@chibi:~/Desktop/samp$
> >
> > If there is anything else I can provide please let me know...
> >
> >
> >
> >
> >
> >
> >
> > On Mon, Apr 28, 2008 at 9:08 AM, Lenni Madsen <l....@mil.dk>
wrote:
> >
> > Hi there
> >
> > Could you attach your wsdl file? It might be something fairly simple

> > and therefore easy to overlook in the wsdl, I know I've missed small

> > important stuff time and time again.
> >
> >
> > [Fatal Error] :1:1040: The element type "HR" must be terminated by 
> > the
> > > matching end-tag "</HR>".
> > > org.apache.muse.ws.addressing.soap.SoapFault: The element type
"HR"
> > > must be terminated by the matching end-tag "</HR>".
> >
> > This error comes when you're trying to use a wrong or incomplete 
> > EndpointReference. The error message is very generic.
> >
> > /Lenni
> >
> >
> > -----Oprindelig meddelelse-----
> > Fra: dulbirakan [mailto:iekanat@gmail.com]
> > Sendt: 27. april 2008 23:19
> > Til: muse-user@ws.apache.org
> > Emne: Re: trouble with WsnTestClient after new wsn-producer.war file
> >
> >
> >
> > I had the same problem, infact I still have it.
> >
> > I used muse 2.2.0's wsdl2java in ubuntu linux (7.10 and 8.04) both 
> > to no avail but it worked under windows XP in my advisors computer.
> >
> > First I change the binding in sample-wsn-producer.wsdl to point to 
> > my producer (wsn-srv) then I change the source of wsn-consumers test

> > class to point to my producer. Then I issue wsdl2java command and
> deploy services.
> > I
> > get the same error message you are getting (the one with HR). I also

> > deployed one with default settings, it was a no go also.
> >
> > I issue:
> >
> > $ sudo sh /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl 
> > sample-wsn-producer.wsdl -output wsn-srv/ -overwrite
> >
> > I get a :
> > [: 38: cygwin: unexpected operator
> >
> > but everything seems to be in place and I run ant and copy the 
> > resulting war files to my tomcat webapps folder. These war files 
> > however, once deployed do not act as axis2 services. When I click on

> > one in tomcat manager I see the following message instead of the 
> > usual
>
> > axis2 web interface:
> >
> > HTTP Status 500 -
> >
> > type Exception report
> >
> > message
> >
> > description The server encountered an internal error () that 
> > prevented
>
> > it from fulfilling this request.
> >
> > exception
> >
> > org.apache.jasper.JasperException: java.lang.NullPointerException
> >
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServ
> le
> tWra
> > pper.java:522)
> >
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
> ja
> va:3
> > 56)
> >
> >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:33
> 7)
> >
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> >
> >
> org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.
> ja
> va:9
> > 68)
> >
> > org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78
> > )
> >
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
> ja
> va:3
> > 74)
> >
> >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:33
> 7)
> >
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> > root cause
> >
> > java.lang.NullPointerException
> >
> >
> >
> org.apache.jsp.axis2_002dweb.include.httpbase_jsp.jspInit(httpbase_jsp
> .j
> ava:
> > 22)
> >       
> > org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:51)
> >
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapp
> er
> .jav
> > a:159)
> >
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
> ja
> va:3
> > 29)
> >
> >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:33
> 7)
> >
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> >
> >
> org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.
> ja
> va:9
> > 68)
> >
> > org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78
> > )
> >
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
> ja
> va:3
> > 74)
> >
> >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:33
> 7)
> >
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> > note The full stack trace of the root cause is available in the 
> > Apache
> > Tomcat/6.0.16 logs.
> > Apache Tomcat/6.0.16
> >
> >
> > I really would appreciate if it would just run under ubuntu.
> >
> > I guess the problem might be related to the cygwin problem I stated 
> > earlier.
> > Does any one have any clue?
> >
> >
> > dchou wrote:
> > >
> > > Hello,
> > >
> > > I am able to drop the sample wsn-producer.war and wsn-consumer.war

> > > files into my Tomcat and they run fine when I run the
WsnTestClient.
>
> > > However, when I do a wsdl2java build in the wsn-producer directory

> > > then build a
> > new
> > > war using Ant. I get an error message with this newly created 
> > > wsn-producer.war. I have changed no code. Only performed wsdl2java

> > > and ant. The steps and error I get when I run the WsnTestClient is

> > > as
> > follows:
> > >
> > > $wsdl2java -j2ee axis2 -overwrite -wsdl wsdl/WsResource.wsdl
> > >
> > > $ ant-1.6.5/bin/ant
> > >
> > > I then run the test client, WsnTestClient and get the following
> output:
> > >
> > > [CLIENT TRACE] SOAP envelope contents (outgoing):
> > >
> > > <soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
> > >     <soap:Header>
> > >         <wsa:To
> > >
> > xmlns:wsa="http://www.w3.org/2005/08/addressing">
> > http://166.21.9.161:8080/ws
> > <http://166.21.9.161:8080/wsn-producer/services/WsResource>
> > n-producer/services/WsResource</wsa:To>
> > >         <wsa:Action
> > >
> > xmlns:wsa="http://www.w3.org/2005/08/addressing">
> > http://docs.oasis-open.org/
> > <http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeR
> > eq
> > uest
> > >
> > wsn/bw-2/NotificationProducer/SubscribeRequest</wsa:Action>
> > >         <wsa:MessageID
> > >
> > xmlns:wsa="http://www.w3.org/2005/08/addressing
> > ">uuid:f6255f7a-9b73-1057-462
> > 0-a4ec2be5ff0a</wsa:MessageID>
> > >         <wsa:From 
> > > xmlns:wsa="http://www.w3.org/2005/08/addressing">
> > >
> > >
> > <wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous
> > </wsa:Addres
> > s>
> > >         </wsa:From>
> > >     </soap:Header>
> > >     <soap:Body>
> > >         <wsnt:Subscribe
> xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
> > >             <wsnt:ConsumerReference>
> > >                 <wsa:Address
> > >
> > xmlns:wsa="http://www.w3.org/2005/08/addressing">
> > http://166.21.9.175:8060/ws
> > <http://166.21.9.175:8060/wsn-consumer/services/consumer>
> > n-consumer/services/consumer</wsa:Address>
> > >             </wsnt:ConsumerReference>
> > >         </wsnt:Subscribe>
> > >     </soap:Body>
> > > </soap:Envelope>
> > >
> > > [Fatal Error] :1:1040: The element type "HR" must be terminated by

> > > the matching end-tag "</HR>".
> > > org.apache.muse.ws.addressing.soap.SoapFault: The element type
"HR"
> > > must be terminated by the matching end-tag "</HR>".
> > >         at
> > >
> >
> >
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceCli
> en
> t.ja
> > va:298)
> > >         at
> > >
> >
> >
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceCli
> en
> t.ja
> > va:254)
> > >         at
> > >
> >
> >
> org.apache.muse.ws.notification.remote.NotificationProducerClient.subs
> cr
> ibe(
> > NotificationProducerClient.java:97)
> > >         at org.apache.muse.test.wsn.WsnTestClient.main(Unknown
> > > Source)
> > >
> > > Does anyone have any idea what I am doing wrong? I have changed no
> code.
> > I
> > > just wanted to try and build a new war with the method outlined in

> > > the tutorial. Any help would be appreciated.
> > >
> > > Thanks,
> > > Dave
> > >
> >
> > --
> > View this message in context:
> >
> >
>
http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.
> war-
> > <
> >
>
http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.
> war
> >
> -file-tp10191599p16928534.html<http://www.nabble.com/trouble-with-WsnT
> es
> tCli
> ent-after-new-wsn-producer.war-file-tp10191599p16928534.html>
> > >
> > file-tp10191599p16928534.html
> > Sent from the Muse User mailing list archive at Nabble.com.
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: muse-user-help@ws.apache.org
> >
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: muse-user-help@ws.apache.org
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


Re: trouble with WsnTestClient after new wsn-producer.war file

Posted by Irfan Emrah Kanat <ie...@gmail.com>.
Thanks, but my problem is a bit different.

I can deploy the samples in ubuntu, no problem.

But when I try to build the sample wsn producer from the wsdl file via
wsdl2java provided with muse 2.2.0 in ubuntu I have some problems. I can
build the same file in windows without any problems though... So I guess it
is a linux specific problem. I am writing a tutorial for next years Web
Services Class I am providing the last section which I have the problems so
that you can see what steps I have taken so far... It is not completed
yet...

That is it about the environment, we now have the Muse to build our WSs and
AXIS2 to deploy them. It would have been nice if we had Eclipse WTP in place
but everything has its time. We will be using the samples from the tutorial
and deploy the WS Notification producer and WS Notification consumer that
come with Muse to test our environment. I assume you have a basic
understanding of what a WSDL file describes, like the types, port types and
bindings.

* Get to the samples:

    The samples are in muse folder.

    "cd /opt/muse-2.2.0-bin/samples/j2ee"

* First comes the producer:

    Let's build the producer first

    "cd /opt/muse-2.2.0-bin/samples/j2ee/wsn-producer"
    "sudo ant"

    You should see a 'BUILD SUCCESSFUL' and we should now have
wsn-producer.war in build folder.

    Deploy the service into the container, Tomcat comes preconfigured to
deploy any war files copied into its webapps folder.

    "sudo cp build/wsn-producer.war /opt/apache-tomcat-6.0.16/webapps/"

    Browse to the localhost:8080/manager to see if it is deployed, its
display name should read 'Apache Muse Servlet'. Muse servlets have no
interface to reach through your browser.

* Now the consumer:

    Build the consumer

    "cd /opt/muse-2.2.0-bin/samples/j2ee/wsn-consumer"
    "sudo ant"

    Deploy the service into the container.
    "sudo cp build/wsn-consumer.war /opt/apache-tomcat-6.0.16/webapps/"

    Browse to the localhost:8080/manager to see if it is deployed.

* Test:

    Run the command below to test the services you just deployed:

    "ant run -Dmain=org.apache.muse.test.wsn.WsnTestClient"

    The stdout should read:


    Buildfile: build.xml

    init:

    run:
         [java] [CLIENT TRACE] SOAP envelope contents (outgoing):
         [java]
         [java] <soap:Envelope xmlns:soap="
http://www.w3.org/2003/05/soap-envelope">
         [java]     <soap:Header>
         [java]         <wsa:To xmlns:wsa="
http://www.w3.org/2005/08/addressing">
http://127.0.1.1:8080/wsn-producer/services/WsResource</wsa:To>
         [java]         <wsa:Action xmlns:wsa="
http://www.w3.org/2005/08/addressing">
http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/
        .
        .
        .
         [java]     </soap:Body>
         [java] </soap:Envelope>
         [java]
         [java] [CLIENT TRACE] SOAP envelope contents (incoming):
         [java]
         [java] <soap:Envelope xmlns:soap="
http://www.w3.org/2003/05/soap-envelope">
         [java]     <soap:Header>
         [java]         <wsa:To xmlns:wsa="
http://www.w3.org/2005/08/addressing">
http://www.w3.org/2005/08/addressing/role/anonymous</wsa:To>
         [java]         <wsa:Action xmlns:wsa="
http://www.w3.org/2005/08/addressing">
http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/
        .
        .
        .
         [java]     </soap:Body>
         [java] </soap:Envelope>
         [java]

    BUILD SUCCESSFUL
    Total time: 4 seconds

13: First Cover Song

In the previous section we tested our environment but did not use muse much.
Now we will be covering the famous wsn-producer from the MUSE. This section
will cover the use of wsdl2java tool and we will be editing some source code
here as well. I used Apache Muse tutorial on
http://ws.apache.org/muse/docs/2.2.0/tutorial/index.html it has some errors
but is more detailed than this one here.

* Get the sample WSDL file:
    Preparing a wsdl file is a tedious process, with only a text editor as
tool it is a total nightmare, that is why we will be using the WSDL file
provided in muse tutorial. We will test our environment with this sample WS.

    "cd ~"
    "wget
http://ws.apache.org/muse/docs/2.2.0/tutorial/artifacts/sample-wsn-producer.wsdl
"

* Lets get this sample file to someplace cosy

    "cd Desktop"
    "mkdir samp"
    "cd samp"
    "cp ~/sample-wsn-producer ."

* Generate the skeleton code
    We need war files that can be deployed into AXIS2 so we will stick with
the J2EE.
    sudo sh /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl
sample-wsn-producer.wsdl

    Huh? What happened you say? Uh, I should have guessed... You see the
wsdl file we placed there refers to other xml documents and the tool can't
find them, so let's get them in place first. We don't have to look too hard
as they are kindly provided with muse...

    "cp /opt/muse-2.2.0-bin/samples/j2ee/wsn-producer/wsdl/* ."

    We probably won't need all of them but it is simpler to just get them
all in any case.
    Let's see what we have in the directory now:

    "ls"

    You should see a bunch of xsd and wsdl files, these should be the same
with the files included in sample-wsn-producer.wsdl.
    We will create the server side of the code in a seperate folder, the
name of the war file and thus the service will be same as the name of this
folder.

* At this point I must point to a critical issue; if you create your service
in any folder except wsn-producer you should change the binding in WSDL
file.

    Edit the sample-wsn-producer.wsdl:

    "gedit sample-wsn-producer.wsdl"

    At the very end of the file there is a binding that goes like

    <wsdl:port name="WsResourcePort" binding="tns:WsResourceBinding">
            <wsdl-soap:address location="
http://localhost:8080/wsn-producer/services/WsResource" />
    </wsdl:port>

    Replace the wsn-producer part with your directory address. I will use
'wsn-srv' as directory name so I would use:

    <wsdl:port name="WsResourcePort" binding="tns:WsResourceBinding">
            <wsdl-soap:address location="
http://localhost:8080/wsn-srv/services/WsResource" />
    </wsdl:port>

* Let's create the server code.

    "mkdir wsn-srv"
    "sudo sh /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl
sample-wsn-producer.wsdl -output wsn-srv"

!AT THIS POINT I AM GETTING A CYGWIN ERROR!

    There should be two folders (JavaSource and WebContent) and an build.xml
file for ANT in wsn-srv directory now. Before running ANT we have a few
stuff to clear though, the java files in JavaSource folder (yes I know there
is a train of empty folders under those classes, that is the namespace URI
defined in WSDL file) are only the skeleton classes and they need to be
fleshed. At this stage I recommend you to see Apache Muse tutorial's
Deployment Descriptor section to find out about the Resource URI:

    From what I found out my resource URI's context paths would be
WsResource and SubscriptionManager. So the URI would be:
    "http://localhost:8080/wsn-srv/services/SubscriptionManager"

* Get to Coding
    As I have been mentioning for a while we have to inject the business
logic to the skeleton classes. Muse can only help us so far to generate the
code, but it will help us once more in packaging the code before this
tutorial is through.

    Muse samples already include the code we need to implement, so if you
want to have a look just browse to the samples folder under the muse
deployment and have a look at the source of wsn-producer. In my setup the
address was
"/opt/muse-2.2.0-bin/samples/j2ee/wsn-producer/src/org/apache/ws/muse/test/wsrf/"

    "sudo gedit
~/Desktop/samp/wsn-srv/JavaSource/org/apache/ws/muse/test/wsrf/MyCapability.java"

    In the end my source code ended up something like:

    //
    // MyCapability.java
    // Tue Apr 22 16:45:01 EEST 2008
    // Generated by the Apache Muse Code Generation Tool
    //
    package org.apache.ws.muse.test.wsrf;

    import javax.xml.namespace.QName;

    import org.w3c.dom.Element;

    import org.apache.muse.util.xml.XmlUtils;
    import org.apache.muse.ws.addressing.soap.SoapFault;
    import org.apache.muse.ws.notification.NotificationProducer;
    import org.apache.muse.ws.notification.WsnConstants;
    import org.apache.muse.ws.resource.impl.AbstractWsResourceCapability;

    public class MyCapability extends AbstractWsResourceCapability
implements IMyCapability
    {
        private static final QName[] _PROPERTIES = new QName[] {
                new QName(NAMESPACE_URI, "MessageInterval", PREFIX),
                new QName(NAMESPACE_URI, "ServerName", PREFIX)
        };

        private static final QName _TOPIC_NAME = new QName(NAMESPACE_URI,
"MyTopic", PREFIX);

        public QName[] getPropertyNames()
        {
            return _PROPERTIES;
        }

    // You can assign any value you may want to the two variables below.
        private int _MessageInterval = 10;

        private String _ServerName = "muse-test.apache.org";

        public int getMessageInterval()
        {
            return _MessageInterval;
        }

        public void setMessageInterval(int param0)
        {
            _MessageInterval = param0;
        }

        public String getServerName()
        {
            return _ServerName;
        }

        public void setServerName(String param0)
        {
            _ServerName = param0;
        }

        public void initializeCompleted()
            throws SoapFault
        {
            super.initializeCompleted();

            //
            // access resource's WSN capability and create a new topic
            //
            final NotificationProducer wsn =
(NotificationProducer)getResource().getCapability(WsnConstants.PRODUCER_URI);

            wsn.addTopic(_TOPIC_NAME);

            Thread producer = new Thread() {
                public void run()
                {
                    //
                    // for this example, reuse one payload for every
notification
                    //
                    QName messageName = new QName(NAMESPACE_URI,
"MyMessage", PREFIX);
                    String message = "This is a message from " +
getServerName();
                    Element payload = XmlUtils.createElement(messageName,
message);

                    while (true)
                    {
                        try
                        {
                            //
                            // read current value - property is mutable
                            //
                            int currentInterval = getMessageInterval();

                            getLog().info("Waiting " + currentInterval + "
seconds before sending message...");
                            Thread.currentThread().sleep(currentInterval *
1000);

                            //
                            // use WSN capability to send message to any
subscribers
                            //
                            getLog().info("Sending message to
consumers...");
                            wsn.publish(_TOPIC_NAME, payload);
                        }

                        catch (Throwable error)
                        {
                            error.printStackTrace();
                        }
                    }
                }
            };
            producer.start();
        }
    }

    It is almost identical to the source code given with muse.

* Wrap it up
    We will use Apache Ant tool once more to create our war package.

    "cd ~/Desktop/samp/wsn-srv/"
    "sudo ant"

* Deploy it
    You can either deploy the service through web interface of your server
or through command line. If you choose to deploy it through web interface
just make sure the server is running.

    "sudo cp wsn-srv.war /opt/apache-tomcat-6.0.16/webapps"

   THE SERVICE IS NOT DEPLOYED CORRECTLY I AM GETTING A HTTP STATUS 500
ERROR


On Mon, Apr 28, 2008 at 11:03 PM, Vinh Nguyen (vinguye2) <vi...@cisco.com>
wrote:

> Hi,
> I just redeployed the Muse 2.2.0 wsn-consumer and wsn-producer samples
> to a local Tomcat 5.5 server on Windows XP.  Then I ran the
> WsnTestClient in wsn-consumer.  Everything works fine for me, and
> notifictions are being received properly every 10 seconds.
>
> You shouldn't need to modify anything since the samples should be
> runnable "out of the box".
>
> Here's the steps to reproduce the test
> 1) In the wsn-producer project, do "ant".
>   Then manually deploy the wsn-producer.war to C:\tomcat\webapps\
> 2) In the wsn-consumer project, do "ant".
>   Then manually deploy the wsn-consumer.war to C:\tomcat\webapps\
> 3) Start your Tomcat.
> 4) In the wsn-consumer project, do "ant
> -Dmain=org.apache.muse.test.wsn.WsnTestClient run".
>   The console should show the SOAP trace for the Subscribe
> request/response.
> 5) Check for notifications in
> C:\tomcat\webapps\wsn-consumer\WEB-INF\classes\log\muse.log
>
> Hope this helps...
> -Vinh
>
>
> -----Original Message-----
> From: Lenni Madsen [mailto:l.madsen@mil.dk]
> Sent: Monday, April 28, 2008 6:51 AM
> To: muse-user@ws.apache.org
> Subject: SV: trouble with WsnTestClient after new wsn-producer.war file
>
> Hmm... this issue warrants a bit more exploring from my side, for some
> reason I seem to have problems with the subscription manager for
> muse-2.3.0-2008-04-07-02-00-bin, it keeps reporting:
>
> [Fatal Error] :12:184: The element type "HR" must be terminated by the
> matching end-tag "</HR>".
> org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR" must
> be terminated by the matching end-tag "</HR>".
>        at
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
> t.ja
> va:298)
>        at
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
> t.ja
> va:254)
>        at
> org.apache.muse.ws.notification.remote.NotificationProducerClient.subscr
> ibe(
> NotificationProducerClient.java:97)
>        at
> org.apache.muse.test.wsn.WsnTestClient.main(WsnTestClient.java:79)
>
> yet the subscription mechanism seems to work:
>
> *#*# message accepted #*#*
> 2008-04-28 15:47:28 org.apache.muse.test.wsn.impl.ConsumerCapabilityImpl
> process
>
> INFO: Received message:
>
> <wsnt:NotificationMessage
>    xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
>    xmlns:muse-wsa="http://ws.apache.org/muse/addressing"
>    xmlns:tns="http://ws.apache.org/muse/test/wsrf"
> xmlns:wsa="http://www.w3.org
> /2005/08/addressing">
>    <wsnt:SubscriptionReference>
>        <wsa:Address
> xmlns:wsa="http://www.w3.org/2005/08/addressing">http://10.
> 0.19.16:8080/wsn-producer/services/SubscriptionManager</wsa:Address>
>        <wsa:ReferenceParameters
> xmlns:wsa="http://www.w3.org/2005/08/addressing
> ">
>            <muse-wsa:ResourceId
> xmlns:muse-wsa="http://ws.apache.org/muse/addre
> ssing">MuseResource-1</muse-wsa:ResourceId>
>        </wsa:ReferenceParameters>
>    </wsnt:SubscriptionReference>
>    <wsnt:Topic
>
> Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Concrete" xm
> lns:tns="http://ws.apache.org/muse/test/wsrf">tns:MyTopic</wsnt:Topic>
>    <wsnt:ProducerReference>
>        <wsa:ReferenceParameters
> xmlns:wsa="http://www.w3.org/2005/08/addressing
> "/>
>        <wsa:Address
> xmlns:wsa="http://www.w3.org/2005/08/addressing">http://10.
> 0.19.16:8080/wsn-producer/services/WsResource</wsa:Address>
>    </wsnt:ProducerReference>
>    <wsnt:Message>
>        <tns:MyMessage
> xmlns:tns="http://ws.apache.org/muse/test/wsrf">This
> is a
>  message from muse-test.apache.org</tns:MyMessage>
>    </wsnt:Message>
> </wsnt:NotificationMessage>
>
> [Fatal Error] :12:184: The element type "HR" must be terminated by the
> matching end-tag "</HR>".
> 2008-04-28 15:47:29 org.apache.muse.util.LoggingUtils logError
> INFO: There was an error while processing a request:
>
> The element type "HR" must be terminated by the matching end-tag
> "</HR>".
>
>
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
> t.java:298)
>
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
> t.java:254)
>
> org.apache.muse.ws.notification.remote.NotificationConsumerClient.notify
> (NotificationConsumerClient.java:99)
>
> org.apache.muse.ws.notification.impl.SimpleSubscriptionManager.publish(S
> impleSubscriptionManager.java:267)
>
> org.apache.muse.ws.notification.impl.SimpleNotificationProducer.publish(
> SimpleNotificationProducer.java:525)
>
> org.apache.muse.ws.notification.impl.SimpleNotificationProducer.publish(
> SimpleNotificationProducer.java:500)
>
> org.apache.ws.muse.test.wsrf.MyCapabilityImpl$1.run(MyCapabilityImpl.jav
> a:104)
>
> ------------------------------------------
>
> I think I need to revert to a earlier version of my setup to make sure
> that it's not just a fault in my setup.
>
> FYI: if you use tomcat 6.0.16 you'll run into some warnings regarding
> listeners already registered
> http://forum.springframework.org/showthread.php?p=175433
>
>
> -----Oprindelig meddelelse-----
> Fra: Irfan Emrah Kanat [mailto:iekanat@gmail.com]
> Sendt: 28. april 2008 11:48
> Til: muse-user@ws.apache.org
> Emne: Re: trouble with WsnTestClient after new wsn-producer.war file
>
> Thanks for your prompt reply Mr. Madsen
>
> The below approach does not fit me as I modified the MyCapability.java
> as given below:
>
> //
>    // MyCapability.java
>    // Tue Apr 22 16:45:01 EEST 2008
>    // Generated by the Apache Muse Code Generation Tool
>    //
>    package org.apache.ws.muse.test.wsrf;
>
>    import javax.xml.namespace.QName;
>
>    import org.w3c.dom.Element;
>
>    import org.apache.muse.util.xml.XmlUtils;
>    import org.apache.muse.ws.addressing.soap.SoapFault;
>    import org.apache.muse.ws.notification.NotificationProducer;
>    import org.apache.muse.ws.notification.WsnConstants;
>    import
> org.apache.muse.ws.resource.impl.AbstractWsResourceCapability;
>
>    public class MyCapability extends AbstractWsResourceCapability
> implements IMyCapability
>    {
>        private static final QName[] _PROPERTIES = new QName[] {
>                new QName(NAMESPACE_URI, "MessageInterval", PREFIX),
>                new QName(NAMESPACE_URI, "ServerName", PREFIX)
>        };
>
>        private static final QName _TOPIC_NAME = new
> QName(NAMESPACE_URI, "MyTopic", PREFIX);
>
>        public QName[] getPropertyNames()
>        {
>            return _PROPERTIES;
>        }
>
>    // You can assign any value you may want to the two variables below.
>        private int _MessageInterval = 10;
>
>        private String _ServerName = "muse-test.apache.org";
>
>        public int getMessageInterval()
>        {
>            return _MessageInterval;
>        }
>
>        public void setMessageInterval(int param0)
>        {
>            _MessageInterval = param0;
>        }
>
>        public String getServerName()
>        {
>            return _ServerName;
>        }
>
>        public void setServerName(String param0)
>        {
>            _ServerName = param0;
>        }
>
>        public void initializeCompleted()
>            throws SoapFault
>        {
>            super.initializeCompleted();
>
>            //
>            // access resource's WSN capability and create a new topic
>            //
>            final NotificationProducer wsn =
> (NotificationProducer)getResource().getCapability(WsnConstants.PRODUCER_
> URI)
> ;
>
>            wsn.addTopic(_TOPIC_NAME);
>
>            Thread producer = new Thread() {
>                public void run()
>                {
>                    //
>                    // for this example, reuse one payload for every
> notification
>                    //
>                    QName messageName = new QName(NAMESPACE_URI,
> "MyMessage", PREFIX);
>                    String message = "This is a message from " +
> getServerName();
>                    Element payload =
> XmlUtils.createElement(messageName,
> message);
>
>                    while (true)
>                    {
>                        try
>                        {
>                            //
>                            // read current value - property is mutable
>                            //
>                            int currentInterval = getMessageInterval();
>
>                            getLog().info("Waiting " + currentInterval +
> "
> seconds before sending message...");
>                            Thread.currentThread().sleep(currentInterval
> * 1000);
>
>                            //
>                            // use WSN capability to send message to any
> subscribers
>                            //
>                            getLog().info("Sending message to
> consumers...");
>                            wsn.publish(_TOPIC_NAME, payload);
>                        }
>
>                        catch (Throwable error)
>                        {
>                            error.printStackTrace();
>                        }
>                    }
>                }
>            };
>            producer.start();
>        }
>    }
>
>    It is almost identical to the source code given with muse.
>
> On Mon, Apr 28, 2008 at 12:43 PM, Lenni Madsen <l....@mil.dk> wrote:
>
> > A thing just occurred to me, the people affected by this issue seems
> > to follow the following approach (please correct me when/if I'm wrong,
>
> > I'll assume this is correctly understood until further notice):
> >
> >
> >
> > 1)       wsdl2java is called on one or more wsdl's from the sample-wsn
> > project
> >
> > 2)       no code is edited after wsdl2java is called (no files are
> copied
> > to
> > the project after wsdl2java is called either)
> >
> > 3)       the war file is deployed
> >
> > 4)       the project experiences one or more errors
> >
> >
> >
> > from my past experiences with the sample-wsn project and indeed any
> > further development issues I have had with wsn, one needs to make sure
>
> > that the generated code is edited to be up to spec, for one thing some
>
> > important wsn-producer code is not put in the MyCapability.java (might
>
> > have another name if you're using the more advance naming options)
> > initialize function.
> >
> >
> >
> > *** what you get ***
> >
> > public void initialize() throws SoapFault
> >
> >    {
> >
> >        //
> >
> >        //The following call is necessary to property initialize the
> > resource
> >
> >        //
> >
> >        super.initialize();
> >
> >
> >
> >        //
> >
> >        //TODO perform intitialization of the following non-primitive
> > properties
> >
> >        //
> >
> >        // ServerName
> >
> >        //
> >
> >
> >
> >        throw new RuntimeException("User needs to update initialization
>
> > code");
> >
> > }
> >
> >
> >
> > *** what you need for the sample-wsn ***
> >
> > public void initialize() throws SoapFault
> >
> >    {
> >
> >        //
> >
> >        //The following call is necessary to property initialize the
> > resource
> >
> >        //
> >
> >        super.initialize();
> >
> >
> >
> >        //
> >
> >        //TODO perform intitialization of the following non-primitive
> > properties
> >
> >        //
> >
> >        // ServerName
> >
> >        //
> >
> >
> >
> > //        throw new RuntimeException("User needs to update
> initialization
> > code");
> >
> >        _ServerName = "sample-wsn-producer";
> >
> >        wsn =
> >
> >
> (NotificationProducer)getResource().getCapability(WsnConstants.PRODUCER_
> URI)
> > ;
> >
> >        // move this code below to a function if you wish to use it
> > when called and not continuously
> >
> >        QName topicName = new
> > QName("http://example.com/server-product",
> > "ServerUpdates");
> >
> >        wsn.addTopic(topicName);
> >
> >        QName messageName = new
> > QName("http://example.com/server-product",
> > "UpdateMessage");
> >
> >        String updateMessage = "Something important happened!";
> >
> >        Element payload = XmlUtils.createElement(messageName,
> > updateMessage);
> >
> >        wsn.publish(topicName, payload);
> >
> >    }
> >
> >
> >
> > Not sure if it helps at all, but at least it closes one possible issue
>
> > related to starting up the application and initialization of the
> producer.
> >
> >
> >
> > Mr. Kanat, please don't worry about replying to the mail group message
>
> > it's here for questions and debate regarding the use of the Muse
> > framework and I find I learn new things every time I have a look at
> > other peoples issues with Muse. sometimes a solution for a problems
> > ends up enhancing my own projects.
> >
> >
> >
> > /Lenni
> >
> >  _____
> >
> > Fra: Irfan Emrah Kanat [mailto:iekanat@gmail.com]
> > Sendt: 28. april 2008 10:56
> > Til: muse-user@ws.apache.org
> > Emne: Re: trouble with WsnTestClient after new wsn-producer.war file
> >
> >
> >
> > I am not sure if this is the right way to reply to a mail group
> > message but it is my first time so forgive me just this once.
> >
> > I set the binding in wsdl file as I stated earlier but here, I am
> > attaching my wsdl file here.
> >
> > There is also another problem. I guess Mr. Nguyen is right as my app
> > does not seem to be starting up. As I posted in my previous post, I
> > build it as an axis2 app. but in tomcat manager I can not see the
> > usual web interface of axis2. I get an HTTP Status 500 error. It seems
>
> > to me that my app is not built correctly. The fact that I am getting a
>
> > cygwin error alleviates my belief.
> >
> > Here is the command I issue and the error message I get:
> >
> > dulbirakan@chibi:~/Desktop/samp$ sudo sh
> > /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl
> > sample-wsn-producer.wsdl -output wsn-srv/ -overwrite
> > [: 38: cygwin: unexpected operator
> > dulbirakan@chibi:~/Desktop/samp$
> >
> > If there is anything else I can provide please let me know...
> >
> >
> >
> >
> >
> >
> >
> > On Mon, Apr 28, 2008 at 9:08 AM, Lenni Madsen <l....@mil.dk> wrote:
> >
> > Hi there
> >
> > Could you attach your wsdl file? It might be something fairly simple
> > and therefore easy to overlook in the wsdl, I know I've missed small
> > important stuff time and time again.
> >
> >
> > [Fatal Error] :1:1040: The element type "HR" must be terminated by the
> > > matching end-tag "</HR>".
> > > org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR"
> > > must be terminated by the matching end-tag "</HR>".
> >
> > This error comes when you're trying to use a wrong or incomplete
> > EndpointReference. The error message is very generic.
> >
> > /Lenni
> >
> >
> > -----Oprindelig meddelelse-----
> > Fra: dulbirakan [mailto:iekanat@gmail.com]
> > Sendt: 27. april 2008 23:19
> > Til: muse-user@ws.apache.org
> > Emne: Re: trouble with WsnTestClient after new wsn-producer.war file
> >
> >
> >
> > I had the same problem, infact I still have it.
> >
> > I used muse 2.2.0's wsdl2java in ubuntu linux (7.10 and 8.04) both to
> > no avail but it worked under windows XP in my advisors computer.
> >
> > First I change the binding in sample-wsn-producer.wsdl to point to my
> > producer (wsn-srv) then I change the source of wsn-consumers test
> > class to point to my producer. Then I issue wsdl2java command and
> deploy services.
> > I
> > get the same error message you are getting (the one with HR). I also
> > deployed one with default settings, it was a no go also.
> >
> > I issue:
> >
> > $ sudo sh /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl
> > sample-wsn-producer.wsdl -output wsn-srv/ -overwrite
> >
> > I get a :
> > [: 38: cygwin: unexpected operator
> >
> > but everything seems to be in place and I run ant and copy the
> > resulting war files to my tomcat webapps folder. These war files
> > however, once deployed do not act as axis2 services. When I click on
> > one in tomcat manager I see the following message instead of the usual
>
> > axis2 web interface:
> >
> > HTTP Status 500 -
> >
> > type Exception report
> >
> > message
> >
> > description The server encountered an internal error () that prevented
>
> > it from fulfilling this request.
> >
> > exception
> >
> > org.apache.jasper.JasperException: java.lang.NullPointerException
> >
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServle
> tWra
> > pper.java:522)
> >
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
> va:3
> > 56)
> >
> >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
> >
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> >
> >
> org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.ja
> va:9
> > 68)
> >
> > org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78)
> >
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
> va:3
> > 74)
> >
> >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
> >
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> > root cause
> >
> > java.lang.NullPointerException
> >
> >
> >
> org.apache.jsp.axis2_002dweb.include.httpbase_jsp.jspInit(httpbase_jsp.j
> ava:
> > 22)
> >       org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:51)
> >
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper
> .jav
> > a:159)
> >
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
> va:3
> > 29)
> >
> >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
> >
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> >
> >
> org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.ja
> va:9
> > 68)
> >
> > org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78)
> >
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
> va:3
> > 74)
> >
> >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
> >
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> > note The full stack trace of the root cause is available in the Apache
> > Tomcat/6.0.16 logs.
> > Apache Tomcat/6.0.16
> >
> >
> > I really would appreciate if it would just run under ubuntu.
> >
> > I guess the problem might be related to the cygwin problem I stated
> > earlier.
> > Does any one have any clue?
> >
> >
> > dchou wrote:
> > >
> > > Hello,
> > >
> > > I am able to drop the sample wsn-producer.war and wsn-consumer.war
> > > files into my Tomcat and they run fine when I run the WsnTestClient.
>
> > > However, when I do a wsdl2java build in the wsn-producer directory
> > > then build a
> > new
> > > war using Ant. I get an error message with this newly created
> > > wsn-producer.war. I have changed no code. Only performed wsdl2java
> > > and ant. The steps and error I get when I run the WsnTestClient is
> > > as
> > follows:
> > >
> > > $wsdl2java -j2ee axis2 -overwrite -wsdl wsdl/WsResource.wsdl
> > >
> > > $ ant-1.6.5/bin/ant
> > >
> > > I then run the test client, WsnTestClient and get the following
> output:
> > >
> > > [CLIENT TRACE] SOAP envelope contents (outgoing):
> > >
> > > <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
> > >     <soap:Header>
> > >         <wsa:To
> > >
> > xmlns:wsa="http://www.w3.org/2005/08/addressing">
> > http://166.21.9.161:8080/ws
> > <http://166.21.9.161:8080/wsn-producer/services/WsResource>
> > n-producer/services/WsResource</wsa:To>
> > >         <wsa:Action
> > >
> > xmlns:wsa="http://www.w3.org/2005/08/addressing">
> > http://docs.oasis-open.org/
> > <http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeReq
> > uest
> > >
> > wsn/bw-2/NotificationProducer/SubscribeRequest</wsa:Action>
> > >         <wsa:MessageID
> > >
> > xmlns:wsa="http://www.w3.org/2005/08/addressing
> > ">uuid:f6255f7a-9b73-1057-462
> > 0-a4ec2be5ff0a</wsa:MessageID>
> > >         <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
> > >
> > >
> > <wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous
> > </wsa:Addres
> > s>
> > >         </wsa:From>
> > >     </soap:Header>
> > >     <soap:Body>
> > >         <wsnt:Subscribe
> xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
> > >             <wsnt:ConsumerReference>
> > >                 <wsa:Address
> > >
> > xmlns:wsa="http://www.w3.org/2005/08/addressing">
> > http://166.21.9.175:8060/ws
> > <http://166.21.9.175:8060/wsn-consumer/services/consumer>
> > n-consumer/services/consumer</wsa:Address>
> > >             </wsnt:ConsumerReference>
> > >         </wsnt:Subscribe>
> > >     </soap:Body>
> > > </soap:Envelope>
> > >
> > > [Fatal Error] :1:1040: The element type "HR" must be terminated by
> > > the matching end-tag "</HR>".
> > > org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR"
> > > must be terminated by the matching end-tag "</HR>".
> > >         at
> > >
> >
> >
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
> t.ja
> > va:298)
> > >         at
> > >
> >
> >
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
> t.ja
> > va:254)
> > >         at
> > >
> >
> >
> org.apache.muse.ws.notification.remote.NotificationProducerClient.subscr
> ibe(
> > NotificationProducerClient.java:97)
> > >         at org.apache.muse.test.wsn.WsnTestClient.main(Unknown
> > > Source)
> > >
> > > Does anyone have any idea what I am doing wrong? I have changed no
> code.
> > I
> > > just wanted to try and build a new war with the method outlined in
> > > the tutorial. Any help would be appreciated.
> > >
> > > Thanks,
> > > Dave
> > >
> >
> > --
> > View this message in context:
> >
> >
> http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.
> war-
> > <
> >
> http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.
> war
> >
> -file-tp10191599p16928534.html<http://www.nabble.com/trouble-with-WsnTes
> tCli
> ent-after-new-wsn-producer.war-file-tp10191599p16928534.html>
> > >
> > file-tp10191599p16928534.html
> > Sent from the Muse User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: muse-user-help@ws.apache.org
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: muse-user-help@ws.apache.org
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
>

RE: trouble with WsnTestClient after new wsn-producer.war file

Posted by "Vinh Nguyen (vinguye2)" <vi...@cisco.com>.
Hi,
I just redeployed the Muse 2.2.0 wsn-consumer and wsn-producer samples
to a local Tomcat 5.5 server on Windows XP.  Then I ran the
WsnTestClient in wsn-consumer.  Everything works fine for me, and
notifictions are being received properly every 10 seconds.

You shouldn't need to modify anything since the samples should be
runnable "out of the box".

Here's the steps to reproduce the test
1) In the wsn-producer project, do "ant".
   Then manually deploy the wsn-producer.war to C:\tomcat\webapps\
2) In the wsn-consumer project, do "ant".
   Then manually deploy the wsn-consumer.war to C:\tomcat\webapps\
3) Start your Tomcat.
4) In the wsn-consumer project, do "ant
-Dmain=org.apache.muse.test.wsn.WsnTestClient run".
   The console should show the SOAP trace for the Subscribe
request/response.
5) Check for notifications in
C:\tomcat\webapps\wsn-consumer\WEB-INF\classes\log\muse.log

Hope this helps...
-Vinh


-----Original Message-----
From: Lenni Madsen [mailto:l.madsen@mil.dk] 
Sent: Monday, April 28, 2008 6:51 AM
To: muse-user@ws.apache.org
Subject: SV: trouble with WsnTestClient after new wsn-producer.war file

Hmm... this issue warrants a bit more exploring from my side, for some
reason I seem to have problems with the subscription manager for
muse-2.3.0-2008-04-07-02-00-bin, it keeps reporting:

[Fatal Error] :12:184: The element type "HR" must be terminated by the
matching end-tag "</HR>".
org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR" must
be terminated by the matching end-tag "</HR>".
	at
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
t.ja
va:298)
	at
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
t.ja
va:254)
	at
org.apache.muse.ws.notification.remote.NotificationProducerClient.subscr
ibe(
NotificationProducerClient.java:97)
	at
org.apache.muse.test.wsn.WsnTestClient.main(WsnTestClient.java:79)

yet the subscription mechanism seems to work:

*#*# message accepted #*#*
2008-04-28 15:47:28 org.apache.muse.test.wsn.impl.ConsumerCapabilityImpl
process

INFO: Received message:

<wsnt:NotificationMessage
    xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
    xmlns:muse-wsa="http://ws.apache.org/muse/addressing"
    xmlns:tns="http://ws.apache.org/muse/test/wsrf"
xmlns:wsa="http://www.w3.org
/2005/08/addressing">
    <wsnt:SubscriptionReference>
        <wsa:Address
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://10.
0.19.16:8080/wsn-producer/services/SubscriptionManager</wsa:Address>
        <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addressing
">
            <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/addre
ssing">MuseResource-1</muse-wsa:ResourceId>
        </wsa:ReferenceParameters>
    </wsnt:SubscriptionReference>
    <wsnt:Topic
 
Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Concrete" xm
lns:tns="http://ws.apache.org/muse/test/wsrf">tns:MyTopic</wsnt:Topic>
    <wsnt:ProducerReference>
        <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addressing
"/>
        <wsa:Address
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://10.
0.19.16:8080/wsn-producer/services/WsResource</wsa:Address>
    </wsnt:ProducerReference>
    <wsnt:Message>
        <tns:MyMessage
xmlns:tns="http://ws.apache.org/muse/test/wsrf">This
is a
 message from muse-test.apache.org</tns:MyMessage>
    </wsnt:Message>
</wsnt:NotificationMessage>

[Fatal Error] :12:184: The element type "HR" must be terminated by the
matching end-tag "</HR>".
2008-04-28 15:47:29 org.apache.muse.util.LoggingUtils logError
INFO: There was an error while processing a request:

The element type "HR" must be terminated by the matching end-tag
"</HR>".

 
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
t.java:298)
 
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
t.java:254)
 
org.apache.muse.ws.notification.remote.NotificationConsumerClient.notify
(NotificationConsumerClient.java:99)
 
org.apache.muse.ws.notification.impl.SimpleSubscriptionManager.publish(S
impleSubscriptionManager.java:267)
 
org.apache.muse.ws.notification.impl.SimpleNotificationProducer.publish(
SimpleNotificationProducer.java:525)
 
org.apache.muse.ws.notification.impl.SimpleNotificationProducer.publish(
SimpleNotificationProducer.java:500)
 
org.apache.ws.muse.test.wsrf.MyCapabilityImpl$1.run(MyCapabilityImpl.jav
a:104)

------------------------------------------

I think I need to revert to a earlier version of my setup to make sure
that it's not just a fault in my setup.

FYI: if you use tomcat 6.0.16 you'll run into some warnings regarding
listeners already registered
http://forum.springframework.org/showthread.php?p=175433


-----Oprindelig meddelelse-----
Fra: Irfan Emrah Kanat [mailto:iekanat@gmail.com]
Sendt: 28. april 2008 11:48
Til: muse-user@ws.apache.org
Emne: Re: trouble with WsnTestClient after new wsn-producer.war file

Thanks for your prompt reply Mr. Madsen

The below approach does not fit me as I modified the MyCapability.java
as given below:

//
    // MyCapability.java
    // Tue Apr 22 16:45:01 EEST 2008
    // Generated by the Apache Muse Code Generation Tool
    //
    package org.apache.ws.muse.test.wsrf;

    import javax.xml.namespace.QName;

    import org.w3c.dom.Element;

    import org.apache.muse.util.xml.XmlUtils;
    import org.apache.muse.ws.addressing.soap.SoapFault;
    import org.apache.muse.ws.notification.NotificationProducer;
    import org.apache.muse.ws.notification.WsnConstants;
    import
org.apache.muse.ws.resource.impl.AbstractWsResourceCapability;

    public class MyCapability extends AbstractWsResourceCapability
implements IMyCapability
    {
        private static final QName[] _PROPERTIES = new QName[] {
                new QName(NAMESPACE_URI, "MessageInterval", PREFIX),
                new QName(NAMESPACE_URI, "ServerName", PREFIX)
        };

        private static final QName _TOPIC_NAME = new
QName(NAMESPACE_URI, "MyTopic", PREFIX);

        public QName[] getPropertyNames()
        {
            return _PROPERTIES;
        }

    // You can assign any value you may want to the two variables below.
        private int _MessageInterval = 10;

        private String _ServerName = "muse-test.apache.org";

        public int getMessageInterval()
        {
            return _MessageInterval;
        }

        public void setMessageInterval(int param0)
        {
            _MessageInterval = param0;
        }

        public String getServerName()
        {
            return _ServerName;
        }

        public void setServerName(String param0)
        {
            _ServerName = param0;
        }

        public void initializeCompleted()
            throws SoapFault
        {
            super.initializeCompleted();

            //
            // access resource's WSN capability and create a new topic
            //
            final NotificationProducer wsn =
(NotificationProducer)getResource().getCapability(WsnConstants.PRODUCER_
URI)
;

            wsn.addTopic(_TOPIC_NAME);

            Thread producer = new Thread() {
                public void run()
                {
                    //
                    // for this example, reuse one payload for every
notification
                    //
                    QName messageName = new QName(NAMESPACE_URI,
"MyMessage", PREFIX);
                    String message = "This is a message from " +
getServerName();
                    Element payload =
XmlUtils.createElement(messageName,
message);

                    while (true)
                    {
                        try
                        {
                            //
                            // read current value - property is mutable
                            //
                            int currentInterval = getMessageInterval();

                            getLog().info("Waiting " + currentInterval +
"
seconds before sending message...");
                            Thread.currentThread().sleep(currentInterval
* 1000);

                            //
                            // use WSN capability to send message to any
subscribers
                            //
                            getLog().info("Sending message to
consumers...");
                            wsn.publish(_TOPIC_NAME, payload);
                        }

                        catch (Throwable error)
                        {
                            error.printStackTrace();
                        }
                    }
                }
            };
            producer.start();
        }
    }

    It is almost identical to the source code given with muse.

On Mon, Apr 28, 2008 at 12:43 PM, Lenni Madsen <l....@mil.dk> wrote:

> A thing just occurred to me, the people affected by this issue seems 
> to follow the following approach (please correct me when/if I'm wrong,

> I'll assume this is correctly understood until further notice):
>
>
>
> 1)       wsdl2java is called on one or more wsdl's from the sample-wsn
> project
>
> 2)       no code is edited after wsdl2java is called (no files are
copied
> to
> the project after wsdl2java is called either)
>
> 3)       the war file is deployed
>
> 4)       the project experiences one or more errors
>
>
>
> from my past experiences with the sample-wsn project and indeed any 
> further development issues I have had with wsn, one needs to make sure

> that the generated code is edited to be up to spec, for one thing some

> important wsn-producer code is not put in the MyCapability.java (might

> have another name if you're using the more advance naming options) 
> initialize function.
>
>
>
> *** what you get ***
>
> public void initialize() throws SoapFault
>
>    {
>
>        //
>
>        //The following call is necessary to property initialize the 
> resource
>
>        //
>
>        super.initialize();
>
>
>
>        //
>
>        //TODO perform intitialization of the following non-primitive 
> properties
>
>        //
>
>        // ServerName
>
>        //
>
>
>
>        throw new RuntimeException("User needs to update initialization

> code");
>
> }
>
>
>
> *** what you need for the sample-wsn ***
>
> public void initialize() throws SoapFault
>
>    {
>
>        //
>
>        //The following call is necessary to property initialize the 
> resource
>
>        //
>
>        super.initialize();
>
>
>
>        //
>
>        //TODO perform intitialization of the following non-primitive 
> properties
>
>        //
>
>        // ServerName
>
>        //
>
>
>
> //        throw new RuntimeException("User needs to update
initialization
> code");
>
>        _ServerName = "sample-wsn-producer";
>
>        wsn =
>
>
(NotificationProducer)getResource().getCapability(WsnConstants.PRODUCER_
URI)
> ;
>
>        // move this code below to a function if you wish to use it 
> when called and not continuously
>
>        QName topicName = new 
> QName("http://example.com/server-product",
> "ServerUpdates");
>
>        wsn.addTopic(topicName);
>
>        QName messageName = new 
> QName("http://example.com/server-product",
> "UpdateMessage");
>
>        String updateMessage = "Something important happened!";
>
>        Element payload = XmlUtils.createElement(messageName,
> updateMessage);
>
>        wsn.publish(topicName, payload);
>
>    }
>
>
>
> Not sure if it helps at all, but at least it closes one possible issue

> related to starting up the application and initialization of the
producer.
>
>
>
> Mr. Kanat, please don't worry about replying to the mail group message

> it's here for questions and debate regarding the use of the Muse 
> framework and I find I learn new things every time I have a look at 
> other peoples issues with Muse. sometimes a solution for a problems 
> ends up enhancing my own projects.
>
>
>
> /Lenni
>
>  _____
>
> Fra: Irfan Emrah Kanat [mailto:iekanat@gmail.com]
> Sendt: 28. april 2008 10:56
> Til: muse-user@ws.apache.org
> Emne: Re: trouble with WsnTestClient after new wsn-producer.war file
>
>
>
> I am not sure if this is the right way to reply to a mail group 
> message but it is my first time so forgive me just this once.
>
> I set the binding in wsdl file as I stated earlier but here, I am 
> attaching my wsdl file here.
>
> There is also another problem. I guess Mr. Nguyen is right as my app 
> does not seem to be starting up. As I posted in my previous post, I 
> build it as an axis2 app. but in tomcat manager I can not see the 
> usual web interface of axis2. I get an HTTP Status 500 error. It seems

> to me that my app is not built correctly. The fact that I am getting a

> cygwin error alleviates my belief.
>
> Here is the command I issue and the error message I get:
>
> dulbirakan@chibi:~/Desktop/samp$ sudo sh 
> /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl 
> sample-wsn-producer.wsdl -output wsn-srv/ -overwrite
> [: 38: cygwin: unexpected operator
> dulbirakan@chibi:~/Desktop/samp$
>
> If there is anything else I can provide please let me know...
>
>
>
>
>
>
>
> On Mon, Apr 28, 2008 at 9:08 AM, Lenni Madsen <l....@mil.dk> wrote:
>
> Hi there
>
> Could you attach your wsdl file? It might be something fairly simple 
> and therefore easy to overlook in the wsdl, I know I've missed small 
> important stuff time and time again.
>
>
> [Fatal Error] :1:1040: The element type "HR" must be terminated by the
> > matching end-tag "</HR>".
> > org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR"
> > must be terminated by the matching end-tag "</HR>".
>
> This error comes when you're trying to use a wrong or incomplete 
> EndpointReference. The error message is very generic.
>
> /Lenni
>
>
> -----Oprindelig meddelelse-----
> Fra: dulbirakan [mailto:iekanat@gmail.com]
> Sendt: 27. april 2008 23:19
> Til: muse-user@ws.apache.org
> Emne: Re: trouble with WsnTestClient after new wsn-producer.war file
>
>
>
> I had the same problem, infact I still have it.
>
> I used muse 2.2.0's wsdl2java in ubuntu linux (7.10 and 8.04) both to 
> no avail but it worked under windows XP in my advisors computer.
>
> First I change the binding in sample-wsn-producer.wsdl to point to my 
> producer (wsn-srv) then I change the source of wsn-consumers test 
> class to point to my producer. Then I issue wsdl2java command and
deploy services.
> I
> get the same error message you are getting (the one with HR). I also 
> deployed one with default settings, it was a no go also.
>
> I issue:
>
> $ sudo sh /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl 
> sample-wsn-producer.wsdl -output wsn-srv/ -overwrite
>
> I get a :
> [: 38: cygwin: unexpected operator
>
> but everything seems to be in place and I run ant and copy the 
> resulting war files to my tomcat webapps folder. These war files 
> however, once deployed do not act as axis2 services. When I click on 
> one in tomcat manager I see the following message instead of the usual

> axis2 web interface:
>
> HTTP Status 500 -
>
> type Exception report
>
> message
>
> description The server encountered an internal error () that prevented

> it from fulfilling this request.
>
> exception
>
> org.apache.jasper.JasperException: java.lang.NullPointerException
>
>
>
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServle
tWra
> pper.java:522)
>
>
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:3
> 56)
>
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
>
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
>
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.ja
va:9
> 68)
>
> org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78)
>
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:3
> 74)
>
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
>
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> root cause
>
> java.lang.NullPointerException
>
>
>
org.apache.jsp.axis2_002dweb.include.httpbase_jsp.jspInit(httpbase_jsp.j
ava:
> 22)
>       org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:51)
>
>
>
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper
.jav
> a:159)
>
>
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:3
> 29)
>
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
>
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
>
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.ja
va:9
> 68)
>
> org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78)
>
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:3
> 74)
>
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
>
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> note The full stack trace of the root cause is available in the Apache
> Tomcat/6.0.16 logs.
> Apache Tomcat/6.0.16
>
>
> I really would appreciate if it would just run under ubuntu.
>
> I guess the problem might be related to the cygwin problem I stated 
> earlier.
> Does any one have any clue?
>
>
> dchou wrote:
> >
> > Hello,
> >
> > I am able to drop the sample wsn-producer.war and wsn-consumer.war 
> > files into my Tomcat and they run fine when I run the WsnTestClient.

> > However, when I do a wsdl2java build in the wsn-producer directory 
> > then build a
> new
> > war using Ant. I get an error message with this newly created 
> > wsn-producer.war. I have changed no code. Only performed wsdl2java 
> > and ant. The steps and error I get when I run the WsnTestClient is 
> > as
> follows:
> >
> > $wsdl2java -j2ee axis2 -overwrite -wsdl wsdl/WsResource.wsdl
> >
> > $ ant-1.6.5/bin/ant
> >
> > I then run the test client, WsnTestClient and get the following
output:
> >
> > [CLIENT TRACE] SOAP envelope contents (outgoing):
> >
> > <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
> >     <soap:Header>
> >         <wsa:To
> >
> xmlns:wsa="http://www.w3.org/2005/08/addressing">
> http://166.21.9.161:8080/ws
> <http://166.21.9.161:8080/wsn-producer/services/WsResource>
> n-producer/services/WsResource</wsa:To>
> >         <wsa:Action
> >
> xmlns:wsa="http://www.w3.org/2005/08/addressing">
> http://docs.oasis-open.org/
> <http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeReq
> uest
> >
> wsn/bw-2/NotificationProducer/SubscribeRequest</wsa:Action>
> >         <wsa:MessageID
> >
> xmlns:wsa="http://www.w3.org/2005/08/addressing
> ">uuid:f6255f7a-9b73-1057-462
> 0-a4ec2be5ff0a</wsa:MessageID>
> >         <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
> >
> >
> <wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous
> </wsa:Addres
> s>
> >         </wsa:From>
> >     </soap:Header>
> >     <soap:Body>
> >         <wsnt:Subscribe
xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
> >             <wsnt:ConsumerReference>
> >                 <wsa:Address
> >
> xmlns:wsa="http://www.w3.org/2005/08/addressing">
> http://166.21.9.175:8060/ws
> <http://166.21.9.175:8060/wsn-consumer/services/consumer>
> n-consumer/services/consumer</wsa:Address>
> >             </wsnt:ConsumerReference>
> >         </wsnt:Subscribe>
> >     </soap:Body>
> > </soap:Envelope>
> >
> > [Fatal Error] :1:1040: The element type "HR" must be terminated by 
> > the matching end-tag "</HR>".
> > org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR" 
> > must be terminated by the matching end-tag "</HR>".
> >         at
> >
>
>
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
t.ja
> va:298)
> >         at
> >
>
>
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
t.ja
> va:254)
> >         at
> >
>
>
org.apache.muse.ws.notification.remote.NotificationProducerClient.subscr
ibe(
> NotificationProducerClient.java:97)
> >         at org.apache.muse.test.wsn.WsnTestClient.main(Unknown 
> > Source)
> >
> > Does anyone have any idea what I am doing wrong? I have changed no
code.
> I
> > just wanted to try and build a new war with the method outlined in 
> > the tutorial. Any help would be appreciated.
> >
> > Thanks,
> > Dave
> >
>
> --
> View this message in context:
>
>
http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.
war-
> <
>
http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.
war
>
-file-tp10191599p16928534.html<http://www.nabble.com/trouble-with-WsnTes
tCli
ent-after-new-wsn-producer.war-file-tp10191599p16928534.html>
> >
> file-tp10191599p16928534.html
> Sent from the Muse User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


SV: trouble with WsnTestClient after new wsn-producer.war file

Posted by Lenni Madsen <l....@mil.dk>.
Hmm... this issue warrants a bit more exploring from my side, for some
reason I seem to have problems with the subscription manager for
muse-2.3.0-2008-04-07-02-00-bin, it keeps reporting:

[Fatal Error] :12:184: The element type "HR" must be terminated by the
matching end-tag "</HR>".
org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR" must be
terminated by the matching end-tag "</HR>".
	at
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.ja
va:298)
	at
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.ja
va:254)
	at
org.apache.muse.ws.notification.remote.NotificationProducerClient.subscribe(
NotificationProducerClient.java:97)
	at
org.apache.muse.test.wsn.WsnTestClient.main(WsnTestClient.java:79)

yet the subscription mechanism seems to work:

*#*# message accepted #*#*
2008-04-28 15:47:28 org.apache.muse.test.wsn.impl.ConsumerCapabilityImpl
process

INFO: Received message:

<wsnt:NotificationMessage
    xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
    xmlns:muse-wsa="http://ws.apache.org/muse/addressing"
    xmlns:tns="http://ws.apache.org/muse/test/wsrf"
xmlns:wsa="http://www.w3.org
/2005/08/addressing">
    <wsnt:SubscriptionReference>
        <wsa:Address
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://10.
0.19.16:8080/wsn-producer/services/SubscriptionManager</wsa:Address>
        <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addressing
">
            <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/addre
ssing">MuseResource-1</muse-wsa:ResourceId>
        </wsa:ReferenceParameters>
    </wsnt:SubscriptionReference>
    <wsnt:Topic
 
Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Concrete" xm
lns:tns="http://ws.apache.org/muse/test/wsrf">tns:MyTopic</wsnt:Topic>
    <wsnt:ProducerReference>
        <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addressing
"/>
        <wsa:Address
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://10.
0.19.16:8080/wsn-producer/services/WsResource</wsa:Address>
    </wsnt:ProducerReference>
    <wsnt:Message>
        <tns:MyMessage xmlns:tns="http://ws.apache.org/muse/test/wsrf">This
is a
 message from muse-test.apache.org</tns:MyMessage>
    </wsnt:Message>
</wsnt:NotificationMessage>

[Fatal Error] :12:184: The element type "HR" must be terminated by the
matching
end-tag "</HR>".
2008-04-28 15:47:29 org.apache.muse.util.LoggingUtils logError
INFO: There was an error while processing a request:

The element type "HR" must be terminated by the matching end-tag "</HR>".

 
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
t.java:298)
 
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
t.java:254)
 
org.apache.muse.ws.notification.remote.NotificationConsumerClient.notify
(NotificationConsumerClient.java:99)
 
org.apache.muse.ws.notification.impl.SimpleSubscriptionManager.publish(S
impleSubscriptionManager.java:267)
 
org.apache.muse.ws.notification.impl.SimpleNotificationProducer.publish(
SimpleNotificationProducer.java:525)
 
org.apache.muse.ws.notification.impl.SimpleNotificationProducer.publish(
SimpleNotificationProducer.java:500)
 
org.apache.ws.muse.test.wsrf.MyCapabilityImpl$1.run(MyCapabilityImpl.jav
a:104)

------------------------------------------

I think I need to revert to a earlier version of my setup to make sure that
it's not just a fault in my setup.

FYI: if you use tomcat 6.0.16 you'll run into some warnings regarding
listeners already registered
http://forum.springframework.org/showthread.php?p=175433


-----Oprindelig meddelelse-----
Fra: Irfan Emrah Kanat [mailto:iekanat@gmail.com] 
Sendt: 28. april 2008 11:48
Til: muse-user@ws.apache.org
Emne: Re: trouble with WsnTestClient after new wsn-producer.war file

Thanks for your prompt reply Mr. Madsen

The below approach does not fit me as I modified the MyCapability.java as
given below:

//
    // MyCapability.java
    // Tue Apr 22 16:45:01 EEST 2008
    // Generated by the Apache Muse Code Generation Tool
    //
    package org.apache.ws.muse.test.wsrf;

    import javax.xml.namespace.QName;

    import org.w3c.dom.Element;

    import org.apache.muse.util.xml.XmlUtils;
    import org.apache.muse.ws.addressing.soap.SoapFault;
    import org.apache.muse.ws.notification.NotificationProducer;
    import org.apache.muse.ws.notification.WsnConstants;
    import org.apache.muse.ws.resource.impl.AbstractWsResourceCapability;

    public class MyCapability extends AbstractWsResourceCapability
implements IMyCapability
    {
        private static final QName[] _PROPERTIES = new QName[] {
                new QName(NAMESPACE_URI, "MessageInterval", PREFIX),
                new QName(NAMESPACE_URI, "ServerName", PREFIX)
        };

        private static final QName _TOPIC_NAME = new QName(NAMESPACE_URI,
"MyTopic", PREFIX);

        public QName[] getPropertyNames()
        {
            return _PROPERTIES;
        }

    // You can assign any value you may want to the two variables below.
        private int _MessageInterval = 10;

        private String _ServerName = "muse-test.apache.org";

        public int getMessageInterval()
        {
            return _MessageInterval;
        }

        public void setMessageInterval(int param0)
        {
            _MessageInterval = param0;
        }

        public String getServerName()
        {
            return _ServerName;
        }

        public void setServerName(String param0)
        {
            _ServerName = param0;
        }

        public void initializeCompleted()
            throws SoapFault
        {
            super.initializeCompleted();

            //
            // access resource's WSN capability and create a new topic
            //
            final NotificationProducer wsn =
(NotificationProducer)getResource().getCapability(WsnConstants.PRODUCER_URI)
;

            wsn.addTopic(_TOPIC_NAME);

            Thread producer = new Thread() {
                public void run()
                {
                    //
                    // for this example, reuse one payload for every
notification
                    //
                    QName messageName = new QName(NAMESPACE_URI,
"MyMessage", PREFIX);
                    String message = "This is a message from " +
getServerName();
                    Element payload = XmlUtils.createElement(messageName,
message);

                    while (true)
                    {
                        try
                        {
                            //
                            // read current value - property is mutable
                            //
                            int currentInterval = getMessageInterval();

                            getLog().info("Waiting " + currentInterval + "
seconds before sending message...");
                            Thread.currentThread().sleep(currentInterval *
1000);

                            //
                            // use WSN capability to send message to any
subscribers
                            //
                            getLog().info("Sending message to
consumers...");
                            wsn.publish(_TOPIC_NAME, payload);
                        }

                        catch (Throwable error)
                        {
                            error.printStackTrace();
                        }
                    }
                }
            };
            producer.start();
        }
    }

    It is almost identical to the source code given with muse.

On Mon, Apr 28, 2008 at 12:43 PM, Lenni Madsen <l....@mil.dk> wrote:

> A thing just occurred to me, the people affected by this issue seems to
> follow the following approach (please correct me when/if I'm wrong, I'll
> assume this is correctly understood until further notice):
>
>
>
> 1)       wsdl2java is called on one or more wsdl's from the sample-wsn
> project
>
> 2)       no code is edited after wsdl2java is called (no files are copied
> to
> the project after wsdl2java is called either)
>
> 3)       the war file is deployed
>
> 4)       the project experiences one or more errors
>
>
>
> from my past experiences with the sample-wsn project and indeed any
> further
> development issues I have had with wsn, one needs to make sure that the
> generated code is edited to be up to spec, for one thing some important
> wsn-producer code is not put in the MyCapability.java (might have another
> name if you're using the more advance naming options) initialize function.
>
>
>
> *** what you get ***
>
> public void initialize() throws SoapFault
>
>    {
>
>        //
>
>        //The following call is necessary to property initialize the
> resource
>
>        //
>
>        super.initialize();
>
>
>
>        //
>
>        //TODO perform intitialization of the following non-primitive
> properties
>
>        //
>
>        // ServerName
>
>        //
>
>
>
>        throw new RuntimeException("User needs to update initialization
> code");
>
> }
>
>
>
> *** what you need for the sample-wsn ***
>
> public void initialize() throws SoapFault
>
>    {
>
>        //
>
>        //The following call is necessary to property initialize the
> resource
>
>        //
>
>        super.initialize();
>
>
>
>        //
>
>        //TODO perform intitialization of the following non-primitive
> properties
>
>        //
>
>        // ServerName
>
>        //
>
>
>
> //        throw new RuntimeException("User needs to update initialization
> code");
>
>        _ServerName = "sample-wsn-producer";
>
>        wsn =
>
>
(NotificationProducer)getResource().getCapability(WsnConstants.PRODUCER_URI)
> ;
>
>        // move this code below to a function if you wish to use it when
> called and not continuously
>
>        QName topicName = new QName("http://example.com/server-product",
> "ServerUpdates");
>
>        wsn.addTopic(topicName);
>
>        QName messageName = new QName("http://example.com/server-product",
> "UpdateMessage");
>
>        String updateMessage = "Something important happened!";
>
>        Element payload = XmlUtils.createElement(messageName,
> updateMessage);
>
>        wsn.publish(topicName, payload);
>
>    }
>
>
>
> Not sure if it helps at all, but at least it closes one possible issue
> related to starting up the application and initialization of the producer.
>
>
>
> Mr. Kanat, please don't worry about replying to the mail group message
> it's
> here for questions and debate regarding the use of the Muse framework and
> I
> find I learn new things every time I have a look at other peoples issues
> with Muse. sometimes a solution for a problems ends up enhancing my own
> projects.
>
>
>
> /Lenni
>
>  _____
>
> Fra: Irfan Emrah Kanat [mailto:iekanat@gmail.com]
> Sendt: 28. april 2008 10:56
> Til: muse-user@ws.apache.org
> Emne: Re: trouble with WsnTestClient after new wsn-producer.war file
>
>
>
> I am not sure if this is the right way to reply to a mail group message
> but
> it is my first time so forgive me just this once.
>
> I set the binding in wsdl file as I stated earlier but here, I am
> attaching
> my wsdl file here.
>
> There is also another problem. I guess Mr. Nguyen is right as my app does
> not seem to be starting up. As I posted in my previous post, I build it as
> an axis2 app. but in tomcat manager I can not see the usual web interface
> of
> axis2. I get an HTTP Status 500 error. It seems to me that my app is not
> built correctly. The fact that I am getting a cygwin error alleviates my
> belief.
>
> Here is the command I issue and the error message I get:
>
> dulbirakan@chibi:~/Desktop/samp$ sudo sh
> /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl
> sample-wsn-producer.wsdl -output wsn-srv/ -overwrite
> [: 38: cygwin: unexpected operator
> dulbirakan@chibi:~/Desktop/samp$
>
> If there is anything else I can provide please let me know...
>
>
>
>
>
>
>
> On Mon, Apr 28, 2008 at 9:08 AM, Lenni Madsen <l....@mil.dk> wrote:
>
> Hi there
>
> Could you attach your wsdl file? It might be something fairly simple and
> therefore easy to overlook in the wsdl, I know I've missed small important
> stuff time and time again.
>
>
> [Fatal Error] :1:1040: The element type "HR" must be terminated by the
> > matching end-tag "</HR>".
> > org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR"
> > must be terminated by the matching end-tag "</HR>".
>
> This error comes when you're trying to use a wrong or incomplete
> EndpointReference. The error message is very generic.
>
> /Lenni
>
>
> -----Oprindelig meddelelse-----
> Fra: dulbirakan [mailto:iekanat@gmail.com]
> Sendt: 27. april 2008 23:19
> Til: muse-user@ws.apache.org
> Emne: Re: trouble with WsnTestClient after new wsn-producer.war file
>
>
>
> I had the same problem, infact I still have it.
>
> I used muse 2.2.0's wsdl2java in ubuntu linux (7.10 and 8.04) both to no
> avail but it worked under windows XP in my advisors computer.
>
> First I change the binding in sample-wsn-producer.wsdl to point to my
> producer (wsn-srv) then I change the source of wsn-consumers test class to
> point to my producer. Then I issue wsdl2java command and deploy services.
> I
> get the same error message you are getting (the one with HR). I also
> deployed one with default settings, it was a no go also.
>
> I issue:
>
> $ sudo sh /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl
> sample-wsn-producer.wsdl -output wsn-srv/ -overwrite
>
> I get a :
> [: 38: cygwin: unexpected operator
>
> but everything seems to be in place and I run ant and copy the resulting
> war
> files to my tomcat webapps folder. These war files however, once deployed
> do
> not act as axis2 services. When I click on one in tomcat manager I see the
> following message instead of the usual axis2 web interface:
>
> HTTP Status 500 -
>
> type Exception report
>
> message
>
> description The server encountered an internal error () that prevented it
> from fulfilling this request.
>
> exception
>
> org.apache.jasper.JasperException: java.lang.NullPointerException
>
>
>
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWra
> pper.java:522)
>
>
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> 56)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
>       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
>
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:9
> 68)
>
> org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78)
>       org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> 74)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
>       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> root cause
>
> java.lang.NullPointerException
>
>
>
org.apache.jsp.axis2_002dweb.include.httpbase_jsp.jspInit(httpbase_jsp.java:
> 22)
>       org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:51)
>
>
>
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.jav
> a:159)
>
>
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> 29)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
>       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
>
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:9
> 68)
>
> org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78)
>       org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> 74)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
>       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> note The full stack trace of the root cause is available in the Apache
> Tomcat/6.0.16 logs.
> Apache Tomcat/6.0.16
>
>
> I really would appreciate if it would just run under ubuntu.
>
> I guess the problem might be related to the cygwin problem I stated
> earlier.
> Does any one have any clue?
>
>
> dchou wrote:
> >
> > Hello,
> >
> > I am able to drop the sample wsn-producer.war and wsn-consumer.war files
> > into my Tomcat and they run fine when I run the WsnTestClient. However,
> > when I do a wsdl2java build in the wsn-producer directory then build a
> new
> > war using Ant. I get an error message with this newly created
> > wsn-producer.war. I have changed no code. Only performed wsdl2java and
> > ant. The steps and error I get when I run the WsnTestClient is as
> follows:
> >
> > $wsdl2java -j2ee axis2 -overwrite -wsdl wsdl/WsResource.wsdl
> >
> > $ ant-1.6.5/bin/ant
> >
> > I then run the test client, WsnTestClient and get the following output:
> >
> > [CLIENT TRACE] SOAP envelope contents (outgoing):
> >
> > <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
> >     <soap:Header>
> >         <wsa:To
> >
> xmlns:wsa="http://www.w3.org/2005/08/addressing">
> http://166.21.9.161:8080/ws
> <http://166.21.9.161:8080/wsn-producer/services/WsResource>
> n-producer/services/WsResource</wsa:To>
> >         <wsa:Action
> >
> xmlns:wsa="http://www.w3.org/2005/08/addressing">
> http://docs.oasis-open.org/
> <http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeRequest
> >
> wsn/bw-2/NotificationProducer/SubscribeRequest</wsa:Action>
> >         <wsa:MessageID
> >
> xmlns:wsa="http://www.w3.org/2005/08/addressing
> ">uuid:f6255f7a-9b73-1057-462
> 0-a4ec2be5ff0a</wsa:MessageID>
> >         <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
> >
> >
> <wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous
> </wsa:Addres
> s>
> >         </wsa:From>
> >     </soap:Header>
> >     <soap:Body>
> >         <wsnt:Subscribe xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
> >             <wsnt:ConsumerReference>
> >                 <wsa:Address
> >
> xmlns:wsa="http://www.w3.org/2005/08/addressing">
> http://166.21.9.175:8060/ws
> <http://166.21.9.175:8060/wsn-consumer/services/consumer>
> n-consumer/services/consumer</wsa:Address>
> >             </wsnt:ConsumerReference>
> >         </wsnt:Subscribe>
> >     </soap:Body>
> > </soap:Envelope>
> >
> > [Fatal Error] :1:1040: The element type "HR" must be terminated by the
> > matching end-tag "</HR>".
> > org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR" must
> > be terminated by the matching end-tag "</HR>".
> >         at
> >
>
>
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.ja
> va:298)
> >         at
> >
>
>
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.ja
> va:254)
> >         at
> >
>
>
org.apache.muse.ws.notification.remote.NotificationProducerClient.subscribe(
> NotificationProducerClient.java:97)
> >         at org.apache.muse.test.wsn.WsnTestClient.main(Unknown Source)
> >
> > Does anyone have any idea what I am doing wrong? I have changed no code.
> I
> > just wanted to try and build a new war with the method outlined in the
> > tutorial. Any help would be appreciated.
> >
> > Thanks,
> > Dave
> >
>
> --
> View this message in context:
>
>
http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.war-
> <
>
http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.war
>
-file-tp10191599p16928534.html<http://www.nabble.com/trouble-with-WsnTestCli
ent-after-new-wsn-producer.war-file-tp10191599p16928534.html>
> >
> file-tp10191599p16928534.html
> Sent from the Muse User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


Re: trouble with WsnTestClient after new wsn-producer.war file

Posted by Irfan Emrah Kanat <ie...@gmail.com>.
Thanks for your prompt reply Mr. Madsen

The below approach does not fit me as I modified the MyCapability.java as
given below:

//
    // MyCapability.java
    // Tue Apr 22 16:45:01 EEST 2008
    // Generated by the Apache Muse Code Generation Tool
    //
    package org.apache.ws.muse.test.wsrf;

    import javax.xml.namespace.QName;

    import org.w3c.dom.Element;

    import org.apache.muse.util.xml.XmlUtils;
    import org.apache.muse.ws.addressing.soap.SoapFault;
    import org.apache.muse.ws.notification.NotificationProducer;
    import org.apache.muse.ws.notification.WsnConstants;
    import org.apache.muse.ws.resource.impl.AbstractWsResourceCapability;

    public class MyCapability extends AbstractWsResourceCapability
implements IMyCapability
    {
        private static final QName[] _PROPERTIES = new QName[] {
                new QName(NAMESPACE_URI, "MessageInterval", PREFIX),
                new QName(NAMESPACE_URI, "ServerName", PREFIX)
        };

        private static final QName _TOPIC_NAME = new QName(NAMESPACE_URI,
"MyTopic", PREFIX);

        public QName[] getPropertyNames()
        {
            return _PROPERTIES;
        }

    // You can assign any value you may want to the two variables below.
        private int _MessageInterval = 10;

        private String _ServerName = "muse-test.apache.org";

        public int getMessageInterval()
        {
            return _MessageInterval;
        }

        public void setMessageInterval(int param0)
        {
            _MessageInterval = param0;
        }

        public String getServerName()
        {
            return _ServerName;
        }

        public void setServerName(String param0)
        {
            _ServerName = param0;
        }

        public void initializeCompleted()
            throws SoapFault
        {
            super.initializeCompleted();

            //
            // access resource's WSN capability and create a new topic
            //
            final NotificationProducer wsn =
(NotificationProducer)getResource().getCapability(WsnConstants.PRODUCER_URI);

            wsn.addTopic(_TOPIC_NAME);

            Thread producer = new Thread() {
                public void run()
                {
                    //
                    // for this example, reuse one payload for every
notification
                    //
                    QName messageName = new QName(NAMESPACE_URI,
"MyMessage", PREFIX);
                    String message = "This is a message from " +
getServerName();
                    Element payload = XmlUtils.createElement(messageName,
message);

                    while (true)
                    {
                        try
                        {
                            //
                            // read current value - property is mutable
                            //
                            int currentInterval = getMessageInterval();

                            getLog().info("Waiting " + currentInterval + "
seconds before sending message...");
                            Thread.currentThread().sleep(currentInterval *
1000);

                            //
                            // use WSN capability to send message to any
subscribers
                            //
                            getLog().info("Sending message to
consumers...");
                            wsn.publish(_TOPIC_NAME, payload);
                        }

                        catch (Throwable error)
                        {
                            error.printStackTrace();
                        }
                    }
                }
            };
            producer.start();
        }
    }

    It is almost identical to the source code given with muse.

On Mon, Apr 28, 2008 at 12:43 PM, Lenni Madsen <l....@mil.dk> wrote:

> A thing just occurred to me, the people affected by this issue seems to
> follow the following approach (please correct me when/if I'm wrong, I'll
> assume this is correctly understood until further notice):
>
>
>
> 1)       wsdl2java is called on one or more wsdl's from the sample-wsn
> project
>
> 2)       no code is edited after wsdl2java is called (no files are copied
> to
> the project after wsdl2java is called either)
>
> 3)       the war file is deployed
>
> 4)       the project experiences one or more errors
>
>
>
> from my past experiences with the sample-wsn project and indeed any
> further
> development issues I have had with wsn, one needs to make sure that the
> generated code is edited to be up to spec, for one thing some important
> wsn-producer code is not put in the MyCapability.java (might have another
> name if you're using the more advance naming options) initialize function.
>
>
>
> *** what you get ***
>
> public void initialize() throws SoapFault
>
>    {
>
>        //
>
>        //The following call is necessary to property initialize the
> resource
>
>        //
>
>        super.initialize();
>
>
>
>        //
>
>        //TODO perform intitialization of the following non-primitive
> properties
>
>        //
>
>        // ServerName
>
>        //
>
>
>
>        throw new RuntimeException("User needs to update initialization
> code");
>
> }
>
>
>
> *** what you need for the sample-wsn ***
>
> public void initialize() throws SoapFault
>
>    {
>
>        //
>
>        //The following call is necessary to property initialize the
> resource
>
>        //
>
>        super.initialize();
>
>
>
>        //
>
>        //TODO perform intitialization of the following non-primitive
> properties
>
>        //
>
>        // ServerName
>
>        //
>
>
>
> //        throw new RuntimeException("User needs to update initialization
> code");
>
>        _ServerName = "sample-wsn-producer";
>
>        wsn =
>
> (NotificationProducer)getResource().getCapability(WsnConstants.PRODUCER_URI)
> ;
>
>        // move this code below to a function if you wish to use it when
> called and not continuously
>
>        QName topicName = new QName("http://example.com/server-product",
> "ServerUpdates");
>
>        wsn.addTopic(topicName);
>
>        QName messageName = new QName("http://example.com/server-product",
> "UpdateMessage");
>
>        String updateMessage = "Something important happened!";
>
>        Element payload = XmlUtils.createElement(messageName,
> updateMessage);
>
>        wsn.publish(topicName, payload);
>
>    }
>
>
>
> Not sure if it helps at all, but at least it closes one possible issue
> related to starting up the application and initialization of the producer.
>
>
>
> Mr. Kanat, please don't worry about replying to the mail group message
> it's
> here for questions and debate regarding the use of the Muse framework and
> I
> find I learn new things every time I have a look at other peoples issues
> with Muse. sometimes a solution for a problems ends up enhancing my own
> projects.
>
>
>
> /Lenni
>
>  _____
>
> Fra: Irfan Emrah Kanat [mailto:iekanat@gmail.com]
> Sendt: 28. april 2008 10:56
> Til: muse-user@ws.apache.org
> Emne: Re: trouble with WsnTestClient after new wsn-producer.war file
>
>
>
> I am not sure if this is the right way to reply to a mail group message
> but
> it is my first time so forgive me just this once.
>
> I set the binding in wsdl file as I stated earlier but here, I am
> attaching
> my wsdl file here.
>
> There is also another problem. I guess Mr. Nguyen is right as my app does
> not seem to be starting up. As I posted in my previous post, I build it as
> an axis2 app. but in tomcat manager I can not see the usual web interface
> of
> axis2. I get an HTTP Status 500 error. It seems to me that my app is not
> built correctly. The fact that I am getting a cygwin error alleviates my
> belief.
>
> Here is the command I issue and the error message I get:
>
> dulbirakan@chibi:~/Desktop/samp$ sudo sh
> /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl
> sample-wsn-producer.wsdl -output wsn-srv/ -overwrite
> [: 38: cygwin: unexpected operator
> dulbirakan@chibi:~/Desktop/samp$
>
> If there is anything else I can provide please let me know...
>
>
>
>
>
>
>
> On Mon, Apr 28, 2008 at 9:08 AM, Lenni Madsen <l....@mil.dk> wrote:
>
> Hi there
>
> Could you attach your wsdl file? It might be something fairly simple and
> therefore easy to overlook in the wsdl, I know I've missed small important
> stuff time and time again.
>
>
> [Fatal Error] :1:1040: The element type "HR" must be terminated by the
> > matching end-tag "</HR>".
> > org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR"
> > must be terminated by the matching end-tag "</HR>".
>
> This error comes when you're trying to use a wrong or incomplete
> EndpointReference. The error message is very generic.
>
> /Lenni
>
>
> -----Oprindelig meddelelse-----
> Fra: dulbirakan [mailto:iekanat@gmail.com]
> Sendt: 27. april 2008 23:19
> Til: muse-user@ws.apache.org
> Emne: Re: trouble with WsnTestClient after new wsn-producer.war file
>
>
>
> I had the same problem, infact I still have it.
>
> I used muse 2.2.0's wsdl2java in ubuntu linux (7.10 and 8.04) both to no
> avail but it worked under windows XP in my advisors computer.
>
> First I change the binding in sample-wsn-producer.wsdl to point to my
> producer (wsn-srv) then I change the source of wsn-consumers test class to
> point to my producer. Then I issue wsdl2java command and deploy services.
> I
> get the same error message you are getting (the one with HR). I also
> deployed one with default settings, it was a no go also.
>
> I issue:
>
> $ sudo sh /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl
> sample-wsn-producer.wsdl -output wsn-srv/ -overwrite
>
> I get a :
> [: 38: cygwin: unexpected operator
>
> but everything seems to be in place and I run ant and copy the resulting
> war
> files to my tomcat webapps folder. These war files however, once deployed
> do
> not act as axis2 services. When I click on one in tomcat manager I see the
> following message instead of the usual axis2 web interface:
>
> HTTP Status 500 -
>
> type Exception report
>
> message
>
> description The server encountered an internal error () that prevented it
> from fulfilling this request.
>
> exception
>
> org.apache.jasper.JasperException: java.lang.NullPointerException
>
>
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWra
> pper.java:522)
>
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> 56)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
>       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
> org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:9
> 68)
>
> org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78)
>       org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> 74)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
>       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> root cause
>
> java.lang.NullPointerException
>
>
> org.apache.jsp.axis2_002dweb.include.httpbase_jsp.jspInit(httpbase_jsp.java:
> 22)
>       org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:51)
>
>
> org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.jav
> a:159)
>
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> 29)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
>       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
> org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:9
> 68)
>
> org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78)
>       org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> 74)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
>       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> note The full stack trace of the root cause is available in the Apache
> Tomcat/6.0.16 logs.
> Apache Tomcat/6.0.16
>
>
> I really would appreciate if it would just run under ubuntu.
>
> I guess the problem might be related to the cygwin problem I stated
> earlier.
> Does any one have any clue?
>
>
> dchou wrote:
> >
> > Hello,
> >
> > I am able to drop the sample wsn-producer.war and wsn-consumer.war files
> > into my Tomcat and they run fine when I run the WsnTestClient. However,
> > when I do a wsdl2java build in the wsn-producer directory then build a
> new
> > war using Ant. I get an error message with this newly created
> > wsn-producer.war. I have changed no code. Only performed wsdl2java and
> > ant. The steps and error I get when I run the WsnTestClient is as
> follows:
> >
> > $wsdl2java -j2ee axis2 -overwrite -wsdl wsdl/WsResource.wsdl
> >
> > $ ant-1.6.5/bin/ant
> >
> > I then run the test client, WsnTestClient and get the following output:
> >
> > [CLIENT TRACE] SOAP envelope contents (outgoing):
> >
> > <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
> >     <soap:Header>
> >         <wsa:To
> >
> xmlns:wsa="http://www.w3.org/2005/08/addressing">
> http://166.21.9.161:8080/ws
> <http://166.21.9.161:8080/wsn-producer/services/WsResource>
> n-producer/services/WsResource</wsa:To>
> >         <wsa:Action
> >
> xmlns:wsa="http://www.w3.org/2005/08/addressing">
> http://docs.oasis-open.org/
> <http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeRequest
> >
> wsn/bw-2/NotificationProducer/SubscribeRequest</wsa:Action>
> >         <wsa:MessageID
> >
> xmlns:wsa="http://www.w3.org/2005/08/addressing
> ">uuid:f6255f7a-9b73-1057-462
> 0-a4ec2be5ff0a</wsa:MessageID>
> >         <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
> >
> >
> <wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous
> </wsa:Addres
> s>
> >         </wsa:From>
> >     </soap:Header>
> >     <soap:Body>
> >         <wsnt:Subscribe xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
> >             <wsnt:ConsumerReference>
> >                 <wsa:Address
> >
> xmlns:wsa="http://www.w3.org/2005/08/addressing">
> http://166.21.9.175:8060/ws
> <http://166.21.9.175:8060/wsn-consumer/services/consumer>
> n-consumer/services/consumer</wsa:Address>
> >             </wsnt:ConsumerReference>
> >         </wsnt:Subscribe>
> >     </soap:Body>
> > </soap:Envelope>
> >
> > [Fatal Error] :1:1040: The element type "HR" must be terminated by the
> > matching end-tag "</HR>".
> > org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR" must
> > be terminated by the matching end-tag "</HR>".
> >         at
> >
>
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.ja
> va:298)
> >         at
> >
>
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.ja
> va:254)
> >         at
> >
>
> org.apache.muse.ws.notification.remote.NotificationProducerClient.subscribe(
> NotificationProducerClient.java:97)
> >         at org.apache.muse.test.wsn.WsnTestClient.main(Unknown Source)
> >
> > Does anyone have any idea what I am doing wrong? I have changed no code.
> I
> > just wanted to try and build a new war with the method outlined in the
> > tutorial. Any help would be appreciated.
> >
> > Thanks,
> > Dave
> >
>
> --
> View this message in context:
>
> http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.war-
> <
> http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.war
> -file-tp10191599p16928534.html<http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.war-file-tp10191599p16928534.html>
> >
> file-tp10191599p16928534.html
> Sent from the Muse User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
>
>
>

SV: trouble with WsnTestClient after new wsn-producer.war file

Posted by Lenni Madsen <l....@mil.dk>.
A thing just occurred to me, the people affected by this issue seems to
follow the following approach (please correct me when/if I'm wrong, I'll
assume this is correctly understood until further notice):

 

1)       wsdl2java is called on one or more wsdl's from the sample-wsn
project

2)       no code is edited after wsdl2java is called (no files are copied to
the project after wsdl2java is called either)

3)       the war file is deployed

4)       the project experiences one or more errors

 

from my past experiences with the sample-wsn project and indeed any further
development issues I have had with wsn, one needs to make sure that the
generated code is edited to be up to spec, for one thing some important
wsn-producer code is not put in the MyCapability.java (might have another
name if you're using the more advance naming options) initialize function.

 

*** what you get ***

public void initialize() throws SoapFault 

    {

        //

        //The following call is necessary to property initialize the
resource

        //

        super.initialize();

 

        //

        //TODO perform intitialization of the following non-primitive
properties

        //

        // ServerName

        //

 

        throw new RuntimeException("User needs to update initialization
code");

}

 

*** what you need for the sample-wsn ***

public void initialize() throws SoapFault 

    {

        //

        //The following call is necessary to property initialize the
resource

        //

        super.initialize();

 

        //

        //TODO perform intitialization of the following non-primitive
properties

        //

        // ServerName

        //

 

//        throw new RuntimeException("User needs to update initialization
code");

        _ServerName = "sample-wsn-producer";

        wsn =
(NotificationProducer)getResource().getCapability(WsnConstants.PRODUCER_URI)
;

        // move this code below to a function if you wish to use it when
called and not continuously

        QName topicName = new QName("http://example.com/server-product",
"ServerUpdates");

        wsn.addTopic(topicName);

        QName messageName = new QName("http://example.com/server-product",
"UpdateMessage");

        String updateMessage = "Something important happened!";

        Element payload = XmlUtils.createElement(messageName,
updateMessage);

        wsn.publish(topicName, payload);

    }

 

Not sure if it helps at all, but at least it closes one possible issue
related to starting up the application and initialization of the producer.

 

Mr. Kanat, please don't worry about replying to the mail group message it's
here for questions and debate regarding the use of the Muse framework and I
find I learn new things every time I have a look at other peoples issues
with Muse. sometimes a solution for a problems ends up enhancing my own
projects.

 

/Lenni

  _____  

Fra: Irfan Emrah Kanat [mailto:iekanat@gmail.com] 
Sendt: 28. april 2008 10:56
Til: muse-user@ws.apache.org
Emne: Re: trouble with WsnTestClient after new wsn-producer.war file

 

I am not sure if this is the right way to reply to a mail group message but
it is my first time so forgive me just this once.

I set the binding in wsdl file as I stated earlier but here, I am attaching
my wsdl file here.

There is also another problem. I guess Mr. Nguyen is right as my app does
not seem to be starting up. As I posted in my previous post, I build it as
an axis2 app. but in tomcat manager I can not see the usual web interface of
axis2. I get an HTTP Status 500 error. It seems to me that my app is not
built correctly. The fact that I am getting a cygwin error alleviates my
belief.

Here is the command I issue and the error message I get:

dulbirakan@chibi:~/Desktop/samp$ sudo sh
/opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl
sample-wsn-producer.wsdl -output wsn-srv/ -overwrite
[: 38: cygwin: unexpected operator
dulbirakan@chibi:~/Desktop/samp$

If there is anything else I can provide please let me know...


 


 

On Mon, Apr 28, 2008 at 9:08 AM, Lenni Madsen <l....@mil.dk> wrote:

Hi there

Could you attach your wsdl file? It might be something fairly simple and
therefore easy to overlook in the wsdl, I know I've missed small important
stuff time and time again.


[Fatal Error] :1:1040: The element type "HR" must be terminated by the
> matching end-tag "</HR>".
> org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR"
> must be terminated by the matching end-tag "</HR>".

This error comes when you're trying to use a wrong or incomplete
EndpointReference. The error message is very generic.

/Lenni


-----Oprindelig meddelelse-----
Fra: dulbirakan [mailto:iekanat@gmail.com]
Sendt: 27. april 2008 23:19
Til: muse-user@ws.apache.org
Emne: Re: trouble with WsnTestClient after new wsn-producer.war file



I had the same problem, infact I still have it.

I used muse 2.2.0's wsdl2java in ubuntu linux (7.10 and 8.04) both to no
avail but it worked under windows XP in my advisors computer.

First I change the binding in sample-wsn-producer.wsdl to point to my
producer (wsn-srv) then I change the source of wsn-consumers test class to
point to my producer. Then I issue wsdl2java command and deploy services. I
get the same error message you are getting (the one with HR). I also
deployed one with default settings, it was a no go also.

I issue:

$ sudo sh /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl
sample-wsn-producer.wsdl -output wsn-srv/ -overwrite

I get a :
[: 38: cygwin: unexpected operator

but everything seems to be in place and I run ant and copy the resulting war
files to my tomcat webapps folder. These war files however, once deployed do
not act as axis2 services. When I click on one in tomcat manager I see the
following message instead of the usual axis2 web interface:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

org.apache.jasper.JasperException: java.lang.NullPointerException

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWra
pper.java:522)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
56)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:9
68)

org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78)
       org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
74)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

java.lang.NullPointerException

org.apache.jsp.axis2_002dweb.include.httpbase_jsp.jspInit(httpbase_jsp.java:
22)
       org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:51)

org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.jav
a:159)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
29)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:9
68)

org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78)
       org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
74)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

note The full stack trace of the root cause is available in the Apache
Tomcat/6.0.16 logs.
Apache Tomcat/6.0.16


I really would appreciate if it would just run under ubuntu.

I guess the problem might be related to the cygwin problem I stated earlier.
Does any one have any clue?


dchou wrote:
>
> Hello,
>
> I am able to drop the sample wsn-producer.war and wsn-consumer.war files
> into my Tomcat and they run fine when I run the WsnTestClient. However,
> when I do a wsdl2java build in the wsn-producer directory then build a new
> war using Ant. I get an error message with this newly created
> wsn-producer.war. I have changed no code. Only performed wsdl2java and
> ant. The steps and error I get when I run the WsnTestClient is as follows:
>
> $wsdl2java -j2ee axis2 -overwrite -wsdl wsdl/WsResource.wsdl
>
> $ ant-1.6.5/bin/ant
>
> I then run the test client, WsnTestClient and get the following output:
>
> [CLIENT TRACE] SOAP envelope contents (outgoing):
>
> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
>     <soap:Header>
>         <wsa:To
>
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://166.21.9.161:8080/ws
<http://166.21.9.161:8080/wsn-producer/services/WsResource> 
n-producer/services/WsResource</wsa:To>
>         <wsa:Action
>
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://docs.oasis-open.org/
<http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeRequest> 
wsn/bw-2/NotificationProducer/SubscribeRequest</wsa:Action>
>         <wsa:MessageID
>
xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:f6255f7a-9b73-1057-462
0-a4ec2be5ff0a</wsa:MessageID>
>         <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
>
>
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Addres
s>
>         </wsa:From>
>     </soap:Header>
>     <soap:Body>
>         <wsnt:Subscribe xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
>             <wsnt:ConsumerReference>
>                 <wsa:Address
>
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://166.21.9.175:8060/ws
<http://166.21.9.175:8060/wsn-consumer/services/consumer> 
n-consumer/services/consumer</wsa:Address>
>             </wsnt:ConsumerReference>
>         </wsnt:Subscribe>
>     </soap:Body>
> </soap:Envelope>
>
> [Fatal Error] :1:1040: The element type "HR" must be terminated by the
> matching end-tag "</HR>".
> org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR" must
> be terminated by the matching end-tag "</HR>".
>         at
>
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.ja
va:298)
>         at
>
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.ja
va:254)
>         at
>
org.apache.muse.ws.notification.remote.NotificationProducerClient.subscribe(
NotificationProducerClient.java:97)
>         at org.apache.muse.test.wsn.WsnTestClient.main(Unknown Source)
>
> Does anyone have any idea what I am doing wrong? I have changed no code. I
> just wanted to try and build a new war with the method outlined in the
> tutorial. Any help would be appreciated.
>
> Thanks,
> Dave
>

--
View this message in context:
http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.war-
<http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.war
-file-tp10191599p16928534.html> 
file-tp10191599p16928534.html
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org

 


Re: trouble with WsnTestClient after new wsn-producer.war file

Posted by Irfan Emrah Kanat <ie...@gmail.com>.
I am not sure if this is the right way to reply to a mail group message but
it is my first time so forgive me just this once.

I set the binding in wsdl file as I stated earlier but here, I am attaching
my wsdl file here.

There is also another problem. I guess Mr. Nguyen is right as my app does
not seem to be starting up. As I posted in my previous post, I build it as
an axis2 app. but in tomcat manager I can not see the usual web interface of
axis2. I get an HTTP Status 500 error. It seems to me that my app is not
built correctly. The fact that I am getting a cygwin error alleviates my
belief.

Here is the command I issue and the error message I get:

dulbirakan@chibi:~/Desktop/samp$ sudo sh
/opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl
sample-wsn-producer.wsdl -output wsn-srv/ -overwrite
[: 38: cygwin: unexpected operator
dulbirakan@chibi:~/Desktop/samp$

If there is anything else I can provide please let me know...


On Mon, Apr 28, 2008 at 9:08 AM, Lenni Madsen <l....@mil.dk> wrote:

> Hi there
>
> Could you attach your wsdl file? It might be something fairly simple and
> therefore easy to overlook in the wsdl, I know I've missed small important
> stuff time and time again.
>
> [Fatal Error] :1:1040: The element type "HR" must be terminated by the
> > matching end-tag "</HR>".
> > org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR"
> > must be terminated by the matching end-tag "</HR>".
>
> This error comes when you're trying to use a wrong or incomplete
> EndpointReference. The error message is very generic.
>
> /Lenni
>
>
> -----Oprindelig meddelelse-----
> Fra: dulbirakan [mailto:iekanat@gmail.com]
> Sendt: 27. april 2008 23:19
> Til: muse-user@ws.apache.org
> Emne: Re: trouble with WsnTestClient after new wsn-producer.war file
>
>
> I had the same problem, infact I still have it.
>
> I used muse 2.2.0's wsdl2java in ubuntu linux (7.10 and 8.04) both to no
> avail but it worked under windows XP in my advisors computer.
>
> First I change the binding in sample-wsn-producer.wsdl to point to my
> producer (wsn-srv) then I change the source of wsn-consumers test class to
> point to my producer. Then I issue wsdl2java command and deploy services.
> I
> get the same error message you are getting (the one with HR). I also
> deployed one with default settings, it was a no go also.
>
> I issue:
>
> $ sudo sh /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl
> sample-wsn-producer.wsdl -output wsn-srv/ -overwrite
>
> I get a :
> [: 38: cygwin: unexpected operator
>
> but everything seems to be in place and I run ant and copy the resulting
> war
> files to my tomcat webapps folder. These war files however, once deployed
> do
> not act as axis2 services. When I click on one in tomcat manager I see the
> following message instead of the usual axis2 web interface:
>
> HTTP Status 500 -
>
> type Exception report
>
> message
>
> description The server encountered an internal error () that prevented it
> from fulfilling this request.
>
> exception
>
> org.apache.jasper.JasperException: java.lang.NullPointerException
>
>
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWra
> pper.java:522)
>
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> 56)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
> org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:9
> 68)
>
> org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78)
>        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> 74)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> root cause
>
> java.lang.NullPointerException
>
>
> org.apache.jsp.axis2_002dweb.include.httpbase_jsp.jspInit(httpbase_jsp.java:
> 22)
>        org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:51)
>
>
> org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.jav
> a:159)
>
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> 29)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
> org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:9
> 68)
>
> org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78)
>        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> 74)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> note The full stack trace of the root cause is available in the Apache
> Tomcat/6.0.16 logs.
> Apache Tomcat/6.0.16
>
>
> I really would appreciate if it would just run under ubuntu.
>
> I guess the problem might be related to the cygwin problem I stated
> earlier.
> Does any one have any clue?
>
>
> dchou wrote:
> >
> > Hello,
> >
> > I am able to drop the sample wsn-producer.war and wsn-consumer.war files
> > into my Tomcat and they run fine when I run the WsnTestClient. However,
> > when I do a wsdl2java build in the wsn-producer directory then build a
> new
> > war using Ant. I get an error message with this newly created
> > wsn-producer.war. I have changed no code. Only performed wsdl2java and
> > ant. The steps and error I get when I run the WsnTestClient is as
> follows:
> >
> > $wsdl2java -j2ee axis2 -overwrite -wsdl wsdl/WsResource.wsdl
> >
> > $ ant-1.6.5/bin/ant
> >
> > I then run the test client, WsnTestClient and get the following output:
> >
> > [CLIENT TRACE] SOAP envelope contents (outgoing):
> >
> > <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
> >     <soap:Header>
> >         <wsa:To
> >
> xmlns:wsa="http://www.w3.org/2005/08/addressing">
> http://166.21.9.161:8080/ws
> n-producer/services/WsResource<http://166.21.9.161:8080/wsn-producer/services/WsResource>
> </wsa:To>
> >         <wsa:Action
> >
> xmlns:wsa="http://www.w3.org/2005/08/addressing">
> http://docs.oasis-open.org/
> wsn/bw-2/NotificationProducer/SubscribeRequest<http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeRequest>
> </wsa:Action>
> >         <wsa:MessageID
> >
> xmlns:wsa="http://www.w3.org/2005/08/addressing
> ">uuid:f6255f7a-9b73-1057-462
> 0-a4ec2be5ff0a</wsa:MessageID>
> >         <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
> >
> >
> <wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous
> </wsa:Addres
> s>
> >         </wsa:From>
> >     </soap:Header>
> >     <soap:Body>
> >         <wsnt:Subscribe xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
> >             <wsnt:ConsumerReference>
> >                 <wsa:Address
> >
> xmlns:wsa="http://www.w3.org/2005/08/addressing">
> http://166.21.9.175:8060/ws
> n-consumer/services/consumer<http://166.21.9.175:8060/wsn-consumer/services/consumer>
> </wsa:Address>
> >             </wsnt:ConsumerReference>
> >         </wsnt:Subscribe>
> >     </soap:Body>
> > </soap:Envelope>
> >
> > [Fatal Error] :1:1040: The element type "HR" must be terminated by the
> > matching end-tag "</HR>".
> > org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR" must
> > be terminated by the matching end-tag "</HR>".
> >         at
> >
>
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.ja
> va:298)
> >         at
> >
>
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.ja
> va:254)
> >         at
> >
>
> org.apache.muse.ws.notification.remote.NotificationProducerClient.subscribe(
> NotificationProducerClient.java:97)
> >         at org.apache.muse.test.wsn.WsnTestClient.main(Unknown Source)
> >
> > Does anyone have any idea what I am doing wrong? I have changed no code.
> I
> > just wanted to try and build a new war with the method outlined in the
> > tutorial. Any help would be appreciated.
> >
> > Thanks,
> > Dave
> >
>
> --
> View this message in context:
>
> http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.war-
> file-tp10191599p16928534.html<http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.war-file-tp10191599p16928534.html>
> Sent from the Muse User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
>

RE: trouble with WsnTestClient after new wsn-producer.war file

Posted by "Vinh Nguyen (vinguye2)" <vi...@cisco.com>.
Hi,
The "HR" error also occurs when the server app didn't startup
successfully for some reason, like if one capability class failed to
initialize properly.  This leaves the entire app in an unstable state.

In addition to checking the Tomcat logs, also check the runtime muse.log
file.  The latter usually gives a better idea of which
resource/capability failed to initialize.
-Vinh


-----Original Message-----
From: Lenni Madsen [mailto:l.madsen@mil.dk] 
Sent: Sunday, April 27, 2008 11:09 PM
To: muse-user@ws.apache.org
Subject: SV: trouble with WsnTestClient after new wsn-producer.war file

Hi there

Could you attach your wsdl file? It might be something fairly simple and
therefore easy to overlook in the wsdl, I know I've missed small
important stuff time and time again.

[Fatal Error] :1:1040: The element type "HR" must be terminated by the 
> matching end-tag "</HR>".
> org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR" 
> must be terminated by the matching end-tag "</HR>".

This error comes when you're trying to use a wrong or incomplete
EndpointReference. The error message is very generic.

/Lenni


-----Oprindelig meddelelse-----
Fra: dulbirakan [mailto:iekanat@gmail.com]
Sendt: 27. april 2008 23:19
Til: muse-user@ws.apache.org
Emne: Re: trouble with WsnTestClient after new wsn-producer.war file


I had the same problem, infact I still have it.

I used muse 2.2.0's wsdl2java in ubuntu linux (7.10 and 8.04) both to no
avail but it worked under windows XP in my advisors computer. 

First I change the binding in sample-wsn-producer.wsdl to point to my
producer (wsn-srv) then I change the source of wsn-consumers test class
to
point to my producer. Then I issue wsdl2java command and deploy
services. I
get the same error message you are getting (the one with HR). I also
deployed one with default settings, it was a no go also.

I issue:

$ sudo sh /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl
sample-wsn-producer.wsdl -output wsn-srv/ -overwrite

I get a :
[: 38: cygwin: unexpected operator

but everything seems to be in place and I run ant and copy the resulting
war
files to my tomcat webapps folder. These war files however, once
deployed do
not act as axis2 services. When I click on one in tomcat manager I see
the
following message instead of the usual axis2 web interface:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented
it
from fulfilling this request.

exception

org.apache.jasper.JasperException: java.lang.NullPointerException

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServle
tWra
pper.java:522)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:3
56)
	
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
	
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.ja
va:9
68)
	
org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78)
	
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:3
74)
	
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
	
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

java.lang.NullPointerException

org.apache.jsp.axis2_002dweb.include.httpbase_jsp.jspInit(httpbase_jsp.j
ava:
22)
	org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:51)

org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper
.jav
a:159)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:3
29)
	
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
	
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.ja
va:9
68)
	
org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78)
	
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:3
74)
	
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
	
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

note The full stack trace of the root cause is available in the Apache
Tomcat/6.0.16 logs.
Apache Tomcat/6.0.16


I really would appreciate if it would just run under ubuntu.

I guess the problem might be related to the cygwin problem I stated
earlier.
Does any one have any clue?


dchou wrote:
> 
> Hello,
> 
> I am able to drop the sample wsn-producer.war and wsn-consumer.war
files
> into my Tomcat and they run fine when I run the WsnTestClient.
However,
> when I do a wsdl2java build in the wsn-producer directory then build a
new
> war using Ant. I get an error message with this newly created
> wsn-producer.war. I have changed no code. Only performed wsdl2java and
> ant. The steps and error I get when I run the WsnTestClient is as
follows:
> 
> $wsdl2java -j2ee axis2 -overwrite -wsdl wsdl/WsResource.wsdl 
> 
> $ ant-1.6.5/bin/ant  
> 
> I then run the test client, WsnTestClient and get the following
output: 
> 
> [CLIENT TRACE] SOAP envelope contents (outgoing):
> 
> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
>     <soap:Header>
>         <wsa:To
>
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://166.21.9.161:808
0/ws
n-producer/services/WsResource</wsa:To>
>         <wsa:Action
>
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://docs.oasis-open.
org/
wsn/bw-2/NotificationProducer/SubscribeRequest</wsa:Action>
>         <wsa:MessageID
>
xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:f6255f7a-9b73-1057
-462
0-a4ec2be5ff0a</wsa:MessageID>
>         <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
>            
>
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Ad
dres
s>
>         </wsa:From>
>     </soap:Header>
>     <soap:Body>
>         <wsnt:Subscribe
xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
>             <wsnt:ConsumerReference>
>                 <wsa:Address
>
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://166.21.9.175:806
0/ws
n-consumer/services/consumer</wsa:Address>
>             </wsnt:ConsumerReference>
>         </wsnt:Subscribe>
>     </soap:Body>
> </soap:Envelope>
> 
> [Fatal Error] :1:1040: The element type "HR" must be terminated by the
> matching end-tag "</HR>".
> org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR"
must
> be terminated by the matching end-tag "</HR>".
>         at
>
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
t.ja
va:298)
>         at
>
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
t.ja
va:254)
>         at
>
org.apache.muse.ws.notification.remote.NotificationProducerClient.subscr
ibe(
NotificationProducerClient.java:97)
>         at org.apache.muse.test.wsn.WsnTestClient.main(Unknown Source)
> 
> Does anyone have any idea what I am doing wrong? I have changed no
code. I
> just wanted to try and build a new war with the method outlined in the
> tutorial. Any help would be appreciated.
> 
> Thanks,
> Dave
> 

-- 
View this message in context:
http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.
war-
file-tp10191599p16928534.html
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


SV: trouble with WsnTestClient after new wsn-producer.war file

Posted by Lenni Madsen <l....@mil.dk>.
Hi there

Could you attach your wsdl file? It might be something fairly simple and
therefore easy to overlook in the wsdl, I know I've missed small important
stuff time and time again.

[Fatal Error] :1:1040: The element type "HR" must be terminated by the 
> matching end-tag "</HR>".
> org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR" 
> must be terminated by the matching end-tag "</HR>".

This error comes when you're trying to use a wrong or incomplete
EndpointReference. The error message is very generic.

/Lenni


-----Oprindelig meddelelse-----
Fra: dulbirakan [mailto:iekanat@gmail.com] 
Sendt: 27. april 2008 23:19
Til: muse-user@ws.apache.org
Emne: Re: trouble with WsnTestClient after new wsn-producer.war file


I had the same problem, infact I still have it.

I used muse 2.2.0's wsdl2java in ubuntu linux (7.10 and 8.04) both to no
avail but it worked under windows XP in my advisors computer. 

First I change the binding in sample-wsn-producer.wsdl to point to my
producer (wsn-srv) then I change the source of wsn-consumers test class to
point to my producer. Then I issue wsdl2java command and deploy services. I
get the same error message you are getting (the one with HR). I also
deployed one with default settings, it was a no go also.

I issue:

$ sudo sh /opt/muse-2.2.0-bin/bin/wsdl2java.sh -j2ee axis2 -wsdl
sample-wsn-producer.wsdl -output wsn-srv/ -overwrite

I get a :
[: 38: cygwin: unexpected operator

but everything seems to be in place and I run ant and copy the resulting war
files to my tomcat webapps folder. These war files however, once deployed do
not act as axis2 services. When I click on one in tomcat manager I see the
following message instead of the usual axis2 web interface:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

org.apache.jasper.JasperException: java.lang.NullPointerException

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWra
pper.java:522)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
56)
	
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:9
68)
	
org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
74)
	
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

java.lang.NullPointerException

org.apache.jsp.axis2_002dweb.include.httpbase_jsp.jspInit(httpbase_jsp.java:
22)
	org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:51)

org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.jav
a:159)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
29)
	
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:9
68)
	
org.apache.jsp.axis2_002dweb.index_jsp._jspService(index_jsp.java:78)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
74)
	
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

note The full stack trace of the root cause is available in the Apache
Tomcat/6.0.16 logs.
Apache Tomcat/6.0.16


I really would appreciate if it would just run under ubuntu.

I guess the problem might be related to the cygwin problem I stated earlier.
Does any one have any clue?


dchou wrote:
> 
> Hello,
> 
> I am able to drop the sample wsn-producer.war and wsn-consumer.war files
> into my Tomcat and they run fine when I run the WsnTestClient. However,
> when I do a wsdl2java build in the wsn-producer directory then build a new
> war using Ant. I get an error message with this newly created
> wsn-producer.war. I have changed no code. Only performed wsdl2java and
> ant. The steps and error I get when I run the WsnTestClient is as follows:
> 
> $wsdl2java -j2ee axis2 -overwrite -wsdl wsdl/WsResource.wsdl 
> 
> $ ant-1.6.5/bin/ant  
> 
> I then run the test client, WsnTestClient and get the following output: 
> 
> [CLIENT TRACE] SOAP envelope contents (outgoing):
> 
> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
>     <soap:Header>
>         <wsa:To
>
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://166.21.9.161:8080/ws
n-producer/services/WsResource</wsa:To>
>         <wsa:Action
>
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://docs.oasis-open.org/
wsn/bw-2/NotificationProducer/SubscribeRequest</wsa:Action>
>         <wsa:MessageID
>
xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:f6255f7a-9b73-1057-462
0-a4ec2be5ff0a</wsa:MessageID>
>         <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
>            
>
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Addres
s>
>         </wsa:From>
>     </soap:Header>
>     <soap:Body>
>         <wsnt:Subscribe xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
>             <wsnt:ConsumerReference>
>                 <wsa:Address
>
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://166.21.9.175:8060/ws
n-consumer/services/consumer</wsa:Address>
>             </wsnt:ConsumerReference>
>         </wsnt:Subscribe>
>     </soap:Body>
> </soap:Envelope>
> 
> [Fatal Error] :1:1040: The element type "HR" must be terminated by the
> matching end-tag "</HR>".
> org.apache.muse.ws.addressing.soap.SoapFault: The element type "HR" must
> be terminated by the matching end-tag "</HR>".
>         at
>
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.ja
va:298)
>         at
>
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.ja
va:254)
>         at
>
org.apache.muse.ws.notification.remote.NotificationProducerClient.subscribe(
NotificationProducerClient.java:97)
>         at org.apache.muse.test.wsn.WsnTestClient.main(Unknown Source)
> 
> Does anyone have any idea what I am doing wrong? I have changed no code. I
> just wanted to try and build a new war with the method outlined in the
> tutorial. Any help would be appreciated.
> 
> Thanks,
> Dave
> 

-- 
View this message in context:
http://www.nabble.com/trouble-with-WsnTestClient-after-new-wsn-producer.war-
file-tp10191599p16928534.html
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org