This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 178323 - @Stateless annotation in sts implementation classes causes problem to deploy STS to Glassfish V3
Summary: @Stateless annotation in sts implementation classes causes problem to deploy ...
Status: RESOLVED WORKSFORME
Alias: None
Product: webservices
Classification: Unclassified
Component: WSIT (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Martin Grebac
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-08 13:23 UTC by jdg6688
Modified: 2012-04-10 05:55 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jdg6688 2009-12-08 13:23:06 UTC
There are two issues:

1. When creating an Web services project for Glassfish V3, wsit jars are missing in the libraries except the webservices-api-osgi.jar. 

2. There is an @Stateless annotation added to the sts implementation class:

@WebServiceProvider(serviceName = "STSService", portName = "ISTSService_Port", targetNamespace = "http://tempuri.org/", wsdlLocation = "WEB-INF/wsdl/STS/STSService.wsdl")
@ServiceMode(value = Mode.PAYLOAD)
@Stateless
public class STS extends com.sun.xml.ws.security.trust.sts.BaseSTSImpl implements Provider<Source> {

So the following exception is thrown when deploying the STS to Glassfish V3:

Caused by: java.lang.ClassCastException: com.sun.enterprise.deployment.annotation.context.WebBundleContext cannot be cast to com.sun.enterprise.deployment.annotation.context.EjbContext
        at org.glassfish.webservices.annotation.handlers.WebServiceProviderHandler.processAnnotation(WebServiceProviderHandler.java:137)
        at org.glassfish.apf.impl.AnnotationProcessorImpl.process(AnnotationProcessorImpl.java:337)
Comment 1 Martin Grebac 2009-12-09 01:18:09 UTC
There's a workaround to remove the @Stateless annotation from the class. I'll provide a fix in trunk and will ask for a patch to 6.8 codeline.
Comment 2 jdg6688 2009-12-09 12:51:29 UTC
After removing the @Stateless, the war can be deployed. 


Using Nebeans to deploy the war, the wsdl is not available. But to deploy the exact same war from gf v3 admin console, it works fine.


http://forums.java.net/jive/thread.jspa?messageID=375589
Comment 3 Martin Grebac 2010-01-20 10:56:15 UTC
I fixed #2 in web-main. The problem was that web project has been incorrectly recognized - ejb instead of web project.

webservices-osgi has been removed from classpath by intention because it is large nad used for very limited cases - the real cause of the problem is more in wrong separation of api/impl in wsit itself. I'm downgrading the issue, and will add code which will add the osgi jar to path (without packaging it to war) whenever STS is created, or whenever WSIT functionality is configured through QoS dialog.
Comment 4 Quality Engineering 2010-01-24 08:41:43 UTC
Integrated into 'main-golden', will be available in build *201001240200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/01396d2ccc75
User: mgrebac@netbeans.org
Log: Fix of #178323 - @Stateless annotation in sts implementation classes causes problem to deploy STS to Glassfish V3

Web/EJB projects have been incorrectly recognized
Comment 5 Denis Anisimov 2012-04-10 05:55:00 UTC
STS code generation is changed and there  is no currently neither @Stateless 
annotation nor deployment problem.