Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Jax-ws error :No JAX-WS context information available.  RSS feed

 
Abhi Barik
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new to java web services. i am using Jax-ws to create a simple web service.
I have created below classes.

Hello.java
-----------

package Hello;

import javax.jws.*;

@WebService

public interface Hello
{
@WebMethod
public String sayHello(String name);
}


Helloimpl.java
-----------------


package Hello;


import javax.jws.*;

@WebService(endpointInterface="Hello.Hello")
public class Helloimpl implements Hello{

@Override
public String sayHello(String name) {
// TODO Auto-generated method stub
return "Hello " + name;
}


}




HelloPublisher.java
---------------------------

package Hello;
import java.io.IOException;

import javax.jws.*;
import javax.xml.ws.Endpoint;

public class HelloPublisher {

public static void main(String[] args) throws IOException {
Endpoint.publish("http://localhost:9876/hello", new Helloimpl());
System.in.read();
}
}


After compiling all these classes , I had used below command to generate jax-ws artifacts.

> wsgen -cp . Hello.Helloimpl

It generates two classes SayHello.class and SayHelloResponse.class .

Then i had tried to execute this service by below command.

> java Hellopublisher

This throws me error " no class def found"


Then i just tried to run this from eclipse. it ran successfully. Then I had tried to acces that web service from IE by URL " http://localhost:9876/hello" . It throws me the error "No JAX-WS context information available."

I am not sure where i have gone wrong. Please suggest me what causes this error. am i doing something wrong ?


Thanks,
AR
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Please include complete stack-traces from the errors you get - it will make it easier to locate the problem.
Best wishes!
 
Kota Takahashi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm studying English.(and I love snoopy so much!)
So I'm sorry if I'm wrong.

-----
It throws me, too.

But I can get the correct WSDL by use the following URL,
and I can also connect from the web services client(that generated by JAX-WS) to the web service.

http://localhost:9876/hello?wsdl

I think you didn't do anything wrong at all!

Thanks.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!