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 237107 - Perfectly working JAX-RS project in Netbeans 7.2.1 is broken in NetBeans 7.3.1
Summary: Perfectly working JAX-RS project in Netbeans 7.2.1 is broken in NetBeans 7.3.1
Status: RESOLVED WONTFIX
Alias: None
Product: webservices
Classification: Unclassified
Component: JAX-WS (show other bugs)
Version: 7.3.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-14 15:35 UTC by netbiolab12
Modified: 2016-07-07 09:54 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
glassfish 4.0 log (12.99 KB, text/x-log)
2013-10-14 15:35 UTC, netbiolab12
Details
errors under netbeans 7.4 and glassfish 4 with jersey 2.x (29.40 KB, text/x-log)
2013-10-15 16:26 UTC, netbiolab12
Details

Note You need to log in before you can comment on or make changes to this bug.
Description netbiolab12 2013-10-14 15:35:22 UTC
Created attachment 141067 [details]
glassfish 4.0 log

NetBeans 7.3.1 fresh install
Glassfish server 4.0 fresh install

Saying that support for JAX-RS in NetBeans 7.2.1 is decent would be too much but under 7.3.1 it is a nightmare! So probably a whole check of the ability of creating JAX-RS projects should be revised.

Anyway this is the kind of errors spit out (see attached file)


[2013-10-14T17:32:27.779+0200] [glassfish 4.0] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=34 _ThreadName=admin-listener(4)] [timeMillis: 1381764747779] [levelValue: 1000] [[
  Exception while loading the app]]

[2013-10-14T17:32:27.786+0200] [glassfish 4.0] [SEVERE] [AS-WEB-GLUE-00192] [javax.enterprise.web] [tid: _ThreadID=34 _ThreadName=admin-listener(4)] [timeMillis: 1381764747786] [levelValue: 1000] [[
  Undeployment failed for context /TestApplication]]

[2013-10-14T17:32:27.802+0200] [glassfish 4.0] [INFO] [] [org.eclipse.persistence.session.file:/var/www/riparto_ig/sample_projects/TestApplication/build/web/WEB-INF/classes/_TestApplicationPU.connection] [tid: _ThreadID=131 _ThreadName=pool-25-thread-1] [timeMillis: 1381764747802] [levelValue: 800] [[
  file:/var/www/riparto_ig/sample_projects/TestApplication/build/web/WEB-INF/classes/_TestApplicationPU logout successful]]

[2013-10-14T17:32:27.811+0200] [glassfish 4.0] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=34 _ThreadName=admin-listener(4)] [timeMillis: 1381764747811] [levelValue: 1000] [[
  Exception while loading the app : CDI deployment failure:WELD-001408 Unsatisfied dependencies for type [Ref<ContainerRequest>] with qualifiers [@Default] at injection point [[BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject org.glassfish.jersey.server.internal.routing.UriRoutingContext(Ref<ContainerRequest>, ProcessingProviders)]
org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Ref<ContainerRequest>] with qualifiers [@Default] at injection point [[BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject org.glassfish.jersey.server.internal.routing.UriRoutingContext(Ref<ContainerRequest>, ProcessingProviders)]
	at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:403)
	at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:325)
	at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:177)
	at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:208)
	at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:519)
	at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:505)
	at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:480)
	at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:536)
	at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:216)
	at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
	at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:493)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:356)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
	at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
	at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
	at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
	at java.lang.Thread.run(Thread.java:722)
]]
Comment 1 David Konecny 2013-10-14 19:58:50 UTC
Responding in the tone you've started all I can say is: read the error log again.


It's hard to say anything else due to lack of instructions on how to reproduce the problem. In that context the problem is the most likely in changing deployment server from GF 3.x (I'm guessing here) to GF 4.0 as indicated by depoloyment error caused by unsatisfied CDI dependency.
Comment 2 netbiolab12 2013-10-15 13:04:10 UTC
Didn't mean to be rude by saying support of JAX-RS in Netbeans 7.3.1 is a nightmare, however that's what it is for me.

If someone tried downloading Netbeans 7.3.1 and created a simple JAX-RS project he would soon realize JAX-RS doesn't work out of the box and the only error returned by the server is what I attached.
Debugging it is quite difficult because it is deep inside some jboss code.

With NetBeans 7.2.1 I was able to let JAX-RS run but with several difficulties and most of all NetBeans 7.2.1 still uses Jersey 1.0 and things like changing default plurals or wrapper names for xml elements is not supported/working.

If someone created an online guide: how to run JAX-RS with NetBeans 7.3.1 he would probably have to address these problems or point to a working configuration.

Again, I'll probably switch to Eclipse after days of fighting with Jax-RS under Netbeans, just wanted to raise some concern for the state of things which are not quite good.
No offence intended.
Comment 3 netbiolab12 2013-10-15 16:25:53 UTC
Ok this happens also under Netbeans IDE 7.4 with a fresh install.

How to Reproduce:

Create from scratch a JAX-RS project with a correctly working resource and entity.
Update web.xml with servlet for JAX-RS which correctly refers to Jax-RS 2.0

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
        <servlet-name>ServletAdaptor</servlet-name>
        <servlet-class>org.glassfish.jersey.spi.container.servlet.ServletContainer</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>ServletAdaptor</servlet-name>
        <url-pattern>/webresources/*</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>faces/index.xhtml</welcome-file>
    </welcome-file-list>
</web-app>

download jersey libraries version 2 from https://jersey.java.net/download.html and build application (correctly compiles).
Upon run it yields the errors attached inside glassfish4-errors.log
Comment 4 netbiolab12 2013-10-15 16:26:27 UTC
Created attachment 141102 [details]
errors under netbeans 7.4 and glassfish 4 with jersey 2.x
Comment 5 David Konecny 2013-10-17 19:46:27 UTC
In Czech there is a saying "You are crying at a wrong grave". Jersey 1.0 and 2.0 are not backward compatible - semantics is different, APIs are different, configuration is different. Migration of app from Jersey 1.0 (eg. GF3) to Jersey 2.0 (eg. GF4) requires some effort on developer's side. We've considered initialy to provide some support for migration but there is simply too many changes and migration cannot be automated easily. So this is not a NetBeans issue.

You should also not need to download Jersey 2.0 - it is included in NB 7.4 and deploying it to GF 4 in your WAR/EAR can only result in some nasty internal GF issues (was my personal experience in the past). Again not a NetBeans issue.

> How to Reproduce:
> Create from scratch a JAX-RS project with a correctly working resource and
> entity.
> Update web.xml with servlet for JAX-RS which correctly refers to Jax-RS 2.0

This always used to work for me. Passing to JAX-RS module owner.
Comment 6 Martin Balin 2016-07-07 09:54:07 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss