atom feed29 messages in net.java.dev.glassfish.usersRe: JAX-RS on Glassfish 3.1: @EJB inj...
FromSent OnAttachments
glas...@javadesktop.orgJun 15, 2010 6:13 am 
Paul SandozJun 15, 2010 6:32 am 
glas...@javadesktop.orgJun 15, 2010 6:44 am 
Paul SandozJun 15, 2010 7:02 am 
glas...@javadesktop.orgJun 15, 2010 7:12 am 
Paul SandozJun 15, 2010 7:31 am 
glas...@javadesktop.orgJun 15, 2010 8:12 am 
glas...@javadesktop.orgJun 15, 2010 2:02 pm 
glas...@javadesktop.orgJun 15, 2010 2:17 pm 
glas...@javadesktop.orgJun 15, 2010 2:37 pm 
Paul SandozJun 16, 2010 1:49 am 
Paul SandozJun 16, 2010 2:08 am 
glas...@javadesktop.orgJun 16, 2010 5:07 am 
glas...@javadesktop.orgJun 16, 2010 5:25 am 
Paul SandozJun 16, 2010 5:43 am 
Paul SandozJun 16, 2010 5:46 am 
glas...@javadesktop.orgJun 16, 2010 5:58 am 
glas...@javadesktop.orgJun 16, 2010 5:59 am 
Paul SandozJun 16, 2010 7:08 am 
glas...@javadesktop.orgJun 16, 2010 8:02 am 
Paul SandozJun 16, 2010 8:29 am 
glas...@javadesktop.orgJun 16, 2010 8:49 am 
Paul SandozJun 16, 2010 9:20 am 
glas...@javadesktop.orgJun 16, 2010 9:33 am 
Paul SandozJun 16, 2010 9:42 am 
glas...@javadesktop.orgJun 16, 2010 10:15 am 
Paul SandozJun 17, 2010 3:26 am 
glas...@javadesktop.orgJun 17, 2010 5:33 am 
Paul SandozJun 17, 2010 6:06 am 
Subject:Re: JAX-RS on Glassfish 3.1: @EJB injection?
From:Paul Sandoz (Paul@Sun.COM)
Date:Jun 16, 2010 5:43:08 am
List:net.java.dev.glassfish.users

On Jun 16, 2010, at 2:15 PM, glas@javadesktop.org wrote:

Thanks, Paul, for the quick response.

I apologize for the configuration; I thought I had proofed the thing better than that. I've been through so many configurations that a bad one slipped through the cracks.

I found some other issues as well.

It turns out that looking for resources in the .ear does NOT work. That is, once I cleared up the skinny .war problem (there was indeed a jar file in the war; there shouldn't have been) then the application did not deploy.

I'm attaching another copy which I regard as the copy that I should have attached in the first place; again I'm sorry for having put one out there that wasn't proofed accurately.

But in any case it did show up another issue with CDI where your previous example did work on 3.0 but not on 3.0.1 and 3.1 b04.

When i deploy the new example you provide i get the following deployment error:

SEVERE: Exception while loading the app org.glassfish.deployment.common.DeploymentException: WELD-001201 Error loading beans.xml java.io.IOException: Cannot open a foreign URL; this.url=jar:file:/Users/paulsandoz/Downloads/glassfish-bugs%25202/ frobnicator/ear/target/gfdeploy/ljnelson_frobnicator-ear_ear_1.0- SNAPSHOT/lib/frobnicator-jaxrs-1.0-SNAPSHOT.jar!/META-INF/beans.xml; foreign.url=jar:file:/Users/paulsandoz/Downloads/glassfish-bugs%25202/ frobnicator/ear/target/gfdeploy/ljnelson_frobnicator-ear_ear_1.0- SNAPSHOT/lib/frobnicator-jaxrs-1.0-SNAPSHOT.jar!/META-INF/beans.xml at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:167) at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java: 125) at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java: 237) at com .sun .enterprise .v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:355) at com .sun .enterprise .v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:199) at org .glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java: 286)

If i remove the beans.xml then i can deploy and then i get the following in the logs when i access the URL:

http://localhost:8080/frobnicator-war/frobnication/frobnicator

INFO: WEB0671: Loading application [ljnelson_frobnicator-ear_ear_1.0- SNAPSHOT#frobnicator-war-1.0-SNAPSHOT.war] at [/frobnicator-war] INFO: ljnelson_frobnicator-ear_ear_1.0-SNAPSHOT was successfully deployed in 2,800 milliseconds. INFO: Updating configuration from org.apache.felix.fileinstall- autodeploy-bundles.cfg INFO: Installed /Users/paulsandoz/Applications/GlassFish/3.1/b04/ glassfishv3/glassfish/modules/autostart/org.apache.felix.fileinstall- autodeploy-bundles.cfg INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir = / Users/paulsandoz/Applications/GlassFish/3.1/b04/glassfishv3/glassfish/ domains/domain1/autodeploy/bundles, felix.fileinstall.debug = -1, felix.fileinstall.bundles.new.start = true, felix.fileinstall.tmpdir = /var/folders/vd/vdTgcMYGEb0tkynCTcnFH++++TI/-Tmp-/ fileinstall--6530420101675025480, felix.fileinstall.filter = null} INFO: GlobalStatsProvider registered INFO: Initiating Jersey application, version 'Jersey: 1.1.5 01/20/2010 04:04 PM' INFO: Adding the following classes declared in META-INF/services/ jersey-server-components to the resource configuration: class com.sun.jersey.multipart.impl.FormDataMultiPartDispatchProvider class com.sun.jersey.multipart.impl.MultiPartConfigProvider class com.sun.jersey.multipart.impl.MultiPartReader class com.sun.jersey.multipart.impl.MultiPartWriter INFO: Instantiating the Application class, named ljnelson.frobnicator.war.Application. The following root resource and provider classes are registered: [class ljnelson.frobnicator.jaxrs.FrobnicatorResource] INFO: Binding the Managed bean class ljnelson.frobnicator.jaxrs.FrobnicatorResource to ManagedBeanComponentProvider SEVERE: The RuntimeException could not be mapped to a response, re- throwing to the HTTP container java.lang.IllegalStateException: Dependency injection of junk failed at ljnelson .frobnicator .jaxrs.FrobnicatorResource.doFrobnication(FrobnicatorResource.java:54)

The reason being is i do not think @ManagedBean supports 330 injection rules when CDI is not enabled. So if you modify the resource method to do:

@GET @Produces("text/plain") public String doFrobnication() { // if (this.junk == null) { // throw new IllegalStateException("Dependency injection of junk failed"); // } if (this.frobnicator == null) { throw new IllegalStateException("Dependency injection of frobnicator failed"); } return frobnicator.frobnicate(); }

it works for me.

Paul.

Thanks again for looking into this.

Best, Laird [Message sent by forum member 'ljnelson']

http://forums.java.net/jive/thread.jspa?messageID=474474