jboss 7 webservice cofiguration
camicase82 Sep 29, 2012 5:00 PMHI there, I've been working an getting together a example project to start a migration from a jboss 5 to jboss as 7 (jboss-as-7.1.1.Final) until now I got:
Seam 2.2.2 and full web components working
Envers for hibernate 3
Simple jax web services
On the original jboss 5 project, the webservices were also seam componets like this:
@WebService(name = "calculoService", serviceName = "calculoService", endpointInterface = "co.com.adv.Salarix2.ws.CalculoServiceFacade")
@Stateless
@Name("calculoService")
@Scope(ScopeType.SESSION)
public class CalculoService implements CalculoServiceFacade{
And the onlye thing that I needed to to do achieve this was to add an standard-jaxws-endpoint-config.xml to the META-INF folder of my ear project.
Now on jboss7, this file ins't even read, I know t beacuase I just made this change
<javaee:handler-class>org.jboss.seam.webservice.SOAPRequestHandler2</javaee:handler-class>
and got no error at all, note that the handler class name is wrong..
I already tried no place it on everi META-INF folder on the project but by this time I'm really stuck...
By the way, this is my webservice class:
@WebService(name = "Test", serviceName = "Test", endpointInterface = "org.jboss.samples.webservices.ITest")
@Stateless
@Name("Test")
@Scope(ScopeType.SESSION)
public class Test implements ITest {
@In(required=true) protected EntityManager entityManager;
private long instance;
public Test(){
instance = System.currentTimeMillis();
System.out.println("Intance created: " + instance);
}
@PostConstruct
public void something(){
System.out.println("element: " + entityManager);
}
/* (non-Javadoc)
* @see org.jboss.samples.webservices.ITest#sayHello(java.lang.String)
*/
@Override
@WebMethod()
public String sayHello(String name) {
System.out.println("Intance called: " + instance);
System.out.println(entityManager);
System.out.println(entityManager);
System.out.println("Hello: " + name);
return "Hello " + name + "!";
}
}
and when I call it this is what i get:
15:52:33,588 INFO [stdout] (http-localhost-127.0.0.1-9090-1) Intance created: 1348951953588
15:52:33,606 INFO [stdout] (http-localhost-127.0.0.1-9090-1) Intance created: 1348951953606
15:52:33,608 INFO [stdout] (http-localhost-127.0.0.1-9090-1) Intance called: 1348951953606
15:52:33,609 INFO [stdout] (http-localhost-127.0.0.1-9090-1) null
15:52:33,611 INFO [stdout] (http-localhost-127.0.0.1-9090-1) null
15:52:33,612 INFO [stdout] (http-localhost-127.0.0.1-9090-1) Hello: null
15:52:33,685 INFO [stdout] (http-localhost-127.0.0.1-9090-1) Intance called: 1348951953606
15:52:33,687 INFO [stdout] (http-localhost-127.0.0.1-9090-1) null
15:52:33,688 INFO [stdout] (http-localhost-127.0.0.1-9090-1) null
15:52:33,689 INFO [stdout] (http-localhost-127.0.0.1-9090-1) Hello: null
as you can se somewhy the system creates two differente instances, I guess one of which is the seam mananged instance, but the one it calls to attend the webservices isn't even in a seam context.
Pdta: The web.xml doesn't have any selvlet anotations as long as they aren't needed any more.
Any help'll be reaally Apreciated
In case some one whants to take a look, or thinks tha my project culd help him, Im atacheing the full maven projects (by this point I already sorted a LOT of obstacles to get seam 2.2.2 envers and jboss 7 together, here you can already see seam and envers working like a charm! )
-
workspace.rar.zip 184.0 KB