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 206799 - Jersey library is packaged even though unselected
Summary: Jersey library is packaged even though unselected
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: WebLogic (show other bugs)
Version: -S1S-
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Denis Anisimov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-30 00:57 UTC by arungupta
Modified: 2012-06-08 20:53 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 arungupta 2011-12-30 00:57:31 UTC
Create a Java EE 6 Web Application
Create new "RESTful Web services from Patterns ..."
Take Default "Simple Root Resource"
Enter the package name "foo" and click on "Finish"
Uncheck "Add Jersey library to project classpath" and click on "OK"


Right-click project, Properties, Libraries

Jersey library is selected even though it was explicitly unselected earlier.

Deploying this project gives an error:

Dec 29, 2011 4:55:35 PM com.sun.jersey.spi.inject.Errors processErrorMessages
SEVERE: The following errors and warnings have been detected with resource and/or provider classes:
	at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
  SEVERE: Missing dependency for field: private com.sun.jersey.oauth.server.spi.OAuthProvider com.sun.jersey.oauth.server.api.resources.AccessTokenRequest.provider
  SEVERE: Missing dependency for field: private com.sun.jersey.oauth.server.spi.OAuthProvider com.sun.jersey.oauth.server.api.resources.RequestTokenRequest.provider
	at weblogic.servlet.internal.StubSecurityHelper.initServletInstance(StubSecurityHelper.java:94)
	at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:82)
	at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:74)
	at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:60)

Unselecting the library from Project Properties again proceeds successfully with the deployment.
Comment 1 Petr Jiricka 2012-01-02 21:31:02 UTC
Could this be a duplicate of bug 204573?
Comment 2 arungupta 2012-01-03 17:16:33 UTC
I don't think so, here the libraries are added to the path even though unselected.
Comment 3 Denis Anisimov 2012-01-10 08:22:54 UTC
(In reply to comment #2)
> I don't think so, here the libraries are added to the path even though
> unselected.

Right, this is not a duplicate but it is related.
Anyway it is fixed : web-main#5b087d108782
Comment 4 rweaver 2012-01-10 14:45:53 UTC
Says this is fixed, but I just upgraded to 7.1 and got this same error when trying to deploy a previously working project (and my project did include Jersey since I am producing web services). 

Using GlassFish 3.1.1, snippet from log below:

INFO: Binding the EJB class com.omnistools.session.PublishedChecklistsFacade to EJBManagedComponentProvider
INFO: Binding the EJB class com.omnistools.session.CompanyChecklistItemsFacade to EJBManagedComponentProvider
SEVERE: The following errors and warnings have been detected with resource and/or provider classes:
  SEVERE: Missing dependency for field: private com.sun.jersey.oauth.server.spi.OAuthProvider com.sun.jersey.oauth.server.api.resources.AccessTokenRequest.provider
  SEVERE: Missing dependency for field: private com.sun.jersey.oauth.server.spi.OAuthProvider com.sun.jersey.oauth.server.api.resources.RequestTokenRequest.provider
SEVERE: WebModule[/OmnisTools]StandardWrapper.Throwable
com.sun.jersey.spi.inject.Errors$ErrorMessagesException
	at com.sun.jersey.spi.inject.Errors.processErrorMessages(Errors.java:170)
	at com.sun.jersey.spi.inject.Errors.postProcess(Errors.java:136)
	at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:199)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:771)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:766)
	at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:488)
	at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:318)
	at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:609)
	at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210)
	at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)
	at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556)
	at javax.servlet.GenericServlet.init(GenericServlet.java:244)
	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1444)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1241)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5093)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:5380)
	at com.sun.enterprise.web.WebModule.start(WebModule.java:497)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1997)
	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1648)
	at com.sun.enterprise.web.WebApplication.start(WebApplication.java:101)
	at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
	at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
	at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:294)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:462)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:382)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232)
	at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:455)
	at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
	at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
	at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:238)
	at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
	at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
	at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
	at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
	at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
	at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
	at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
	at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
	at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
	at java.lang.Thread.run(Thread.java:680)

SEVERE: WebModule[/OmnisTools]PWC1396: Servlet /OmnisTools threw load() exception
com.sun.jersey.spi.inject.Errors$ErrorMessagesException
	at com.sun.jersey.spi.inject.Errors.processErrorMessages(Errors.java:170)
	at com.sun.jersey.spi.inject.Errors.postProcess(Errors.java:136)
	at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:199)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:771)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:766)
	at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:488)
	at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:318)
	at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:609)
	at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210)
	at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)
	at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556)
	at javax.servlet.GenericServlet.init(GenericServlet.java:244)
	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1444)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1241)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5093)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:5380)
	at com.sun.enterprise.web.WebModule.start(WebModule.java:497)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1997)
	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1648)
	at com.sun.enterprise.web.WebApplication.start(WebApplication.java:101)
	at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
	at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
	at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:294)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:462)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:382)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232)
	at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:455)
	at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
	at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
	at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:238)
	at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
	at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
	at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
	at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
	at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
	at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
	at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
	at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
	at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
	at java.lang.Thread.run(Thread.java:680)
Comment 5 Denis Anisimov 2012-01-10 14:55:23 UTC
>Says this is fixed, but I just upgraded to 7.1 
How did you upgrade ?
Do you use the latest dev build ?
The fix is available only in the trunk which is 7.2 dev.
The other thing : how this relates to Web Logic ( the original compoenent of the issue ) if you are saying you use GF ?
Comment 6 Denis Anisimov 2012-01-10 15:02:07 UTC
I cannot move this bug into the WS product for reason I don't understand.
I'm closing this issue because the latest issue is absolutely unrelated to the 
current issue under question.
This issue is about extending project classpath with Jersey jars even if option
is unchecked and user don't want them in the classpath.
This is fixed.
The mentioned exception is just a consequence of WL classloader limitation .

If you have some problems with GF then file a different issue with exact steps to reproduce.
Comment 7 rweaver 2012-01-10 15:31:04 UTC
Also works fine in NB 7.0.1 which uses Jersey 1.3, which is what is loaded on the server. Library for Jersey 1.3 doesn't include any OAuth* jars, only the following:

asm-3.1.jar			jersey-spring-1.3.jar
jackson-core-asl-1.1.1.jar	jettison-1.1.jar
jersey-client-1.3.jar		jsr311-api-1.1.1.jar
jersey-core-1.3.jar		mimepull-1.4.jar
jersey-json-1.3.jar		oauth-client-1.3.jar
jersey-multipart-1.3.jar	oauth-signature-1.3.jar
jersey-server-1.3.jar

NB 7.1 appears to include the OAuth modules and a newer version of Jersey:

asm-3.1.jar			jersey-json-1.8.jar
jackson-core-asl-1.7.1.jar	jersey-multipart-1.8.jar
jackson-jaxrs-1.7.1.jar		jersey-server-1.8.jar
jackson-mapper-asl-1.7.1.jar	jersey-simple-server-1.8.jar
jackson-xc-1.7.1.jar		jersey-spring-1.8.jar
jersey-apache-client-1.8.jar	jettison-1.1.jar
jersey-atom-abdera-1.8.jar	jsr311-api-1.1.1.jar
jersey-client-1.8.jar		oauth-client-1.8.jar
jersey-core-1.8.jar		oauth-server-1.8.jar
jersey-guice-1.8.jar		oauth-signature-1.8.jar

And then just to confuse things even further, Glassfish says it uses Jersey 1.9-1.18
Comment 8 rweaver 2012-01-10 15:46:36 UTC
Mistakenly added my issue to this one before, not realizing it was a WL problem. The OAuth exception is identical to the GlassFish problem I'm seeing though.
Comment 9 Quality Engineering 2012-01-11 16:15:16 UTC
Integrated into 'main-golden', will be available in build *201201110601* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/5b087d108782
User: Denis Anisimov <ads@netbeans.org>
Log: Fix for BZ#206799 - Jersey library is packaged even though unselected
Comment 10 AlanU 2012-01-26 22:59:14 UTC
This was a frustrating bug. I am a complete beginner at JavaEE and tried the firstcup JavaEE Tutorial. The very first program you write is a Restful web service, and it instructs you to un-check the jersey library, which I did. Then when you have finished and try to run the program, it fails. It wasn't easy to find what the problem was, and as an Eclipse user at work, this really put me off trying Netbeans any further.

A very bad experiance for a newbie.
Comment 11 duttagoutam 2012-04-07 17:25:16 UTC
If you are running the application from net-beans, follow the steps to deploy and run successfully.
1. Right click on the project and go to "properties"
2. Click on "Libraries"
3. Unchecked the "Jersey 1.8" from the "compile" tab.
4. Click "ok"
5. Do clean, build and deploy and after that run.
Comment 12 montblack 2012-06-08 20:53:59 UTC
(In reply to comment #11)
> If you are running the application from net-beans, follow the steps to deploy
> and run successfully.
> 1. Right click on the project and go to "properties"
> 2. Click on "Libraries"
> 3. Unchecked the "Jersey 1.8" from the "compile" tab.
> 4. Click "ok"
> 5. Do clean, build and deploy and after that run.

it works thanks :)