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.
Scenario : NB 0705 & GF b54 on both solaris and windows (jdk 1.6u1) Cannot deploy a web application with JMS resources injected within a servlet. ** local default domain is started (GlassFish V2 kept the node added automatically by IDE at start as installed with the bundled GF b54) ** Open a new web project with struts FWK Add Servlet In servlet code: click right and choose Enterpise Resources / Send JMS Message in the wizard Project Destinations: Queue1 and after OK Problem1: The method createJMSMessageForqueue1 is generated as: private Message createJMSMessageForqueue1 (Session session, Object messageData) throws JMSException { } with an empty code ==>> red ! it is called within sendJMSMessageToQueue1(Object messageData) throws JMSException { .... etc. the code here seem to be ok, as the one I'looked at in javaeetutorial : jms/simple examples producer and consumers. (the Producer example does not run neither evenif I add the needed resources, but this another issue may be related). } Problem2: if I update the code in createJMSMessageForqueue1 to be like: private Message createJMSMessageForqueue1(Session session, Object messageData) throws JMSException { TextMessage message = session.createTextMessage(); message.setText("This is message from servlet " + messageData.toString() ); return message; } to go further in the build/deployment, got the error: <<< compile-jsps: do-dist: dist: In-place deployment at /NetBeansProjects/WebApplication1/build/web Prepare server resources for deployment moduleID=WebApplication1 deployment started : 0% Deploying application in domain failed; Error loading deployment descriptors for module [WebApplication1] -- This web app [/NetBeansProjects/WebApplication1/build/web] has no resource reference by the name of [Queue1Factory] /NetBeansProjects/WebApplication1/nbproject/build-impl.xml:511: Deployment error: The module has not been deployed. See the server log for details. BUILD FAILED (total time: 2 seconds) >>>
Created attachment 44827 [details] project zip file made on solaris-sparc
sorry, did the zip without making a clean over the project, hope is not too huge.
Investigating this. Seems to be some set of issues regarding deployoyment of JMS resources created via zero-config. Investigating
The first issue is basically where the IDE is creating a placeholder where the user can place their logic for the JMS message. I don't think it is an error. The user would need to add their logic for the app.
For @Resource(mappedName = "TestMessageDestinationFactory"), the plugin is creating an associated connector resource with jndiName 'jms/TestMessageDestinationFactory'. This is wrong and needs to be fixed. The jndiName should be 'TestMessageDestinationFactory'. There is also a secondary issue with respect to usage of the @Resource annotation. Annotation @Resource(mappedName = "TestMessageDestinationFactory") fails with Error loading deployment descriptors for module [EnterpriseApplicationJMS-war] -- This web app [C:\Documents and Settings\Nitya Doraisamy\My Documents\NetBeansProjects\EnterpriseApplicationJMS\EnterpriseApplicationJMS-war\build\web] has no resource reference by the name of [TestMessageDestinationFactory] But using name property in the annotation , @Resource(name= "TestMessageDestinationFactory") works. sun-web.xml has the following entry, <resource-ref> <res-ref-name>TestMessageDestinationFactory</res-ref-name> <jndi-name>TestMessageDestinationFactory</jndi-name> </resource-ref> Annotation, @Resource(mappedName = "TestMessageDestinationFactory") works only if there is no entry in the sun-web.xml.
*** Issue 109214 has been marked as a duplicate of this issue. ***
Fixed Plugin - uses the jndiName passed via API's as jndiName of resource Checking in ResourceConfigurator.java; /cvs/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/beans/ResourceConfigurator.java,v <-- ResourceConfigurator.java new revision: 1.17; previous revision: 1.16
fix in j2ee (109463) is done today 0716, waiting for a NB 6.0 build > 0716 to verify. jndiName is ok (verified in 071512000) does not have any more jms/xxxx
Fix for 109463 fixes this issue.
marking verified in RC2 and recent dailys dev 6.1