Skip to main content

@Resource / Help Needed

4 replies [Last post]
Anonymous

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Jagadish Prasath Ramu

Hi Markus,
* Can you post the deployment time error messages ?

*Please refer to my response for the steps.
https://glassfish.dev.java.net/servlets/ReadMsg?list=users&msgNo=20636

Infact, you can write your bean with
@Resource(name="connector-resource")
MyIntf intf

and deploy the application. Once the app. is deployed you can create a
pool and resource by name "connector-resource".

Thanks,
-Jagadish

On Wed, 2008-06-25 at 20:26 +0200, Markus Karg wrote:
> Hello Sivakumar,
>
> thank you for posting this links.
>
> Unfortunately, I do know all of them so it doesn't solve my problem due to two facts: (A) it says WHAT to write but not WHERE to write that (B) it tells I shall create a pool after deployment, but the deployment fails sind the binding of the bean fails!
>
>
> My problem is like this:
>
> That links say that *after* deploying the EAR (containing the embedded RAR) I have to use some other admin command to create a connection pool. But the problem is that *at* deployment I get error messages that both references (@Resource to the outbound, @MessageDriven to the inbound) cannot be bound, so I have stack traces found in the log and the application is not loaded! Since the application is not loaded, I cannot call that admin command.
>
> If you want I can post the stack trace of the deploy command!
>
> See the problem?
>
> So what I'd like to do is to ask you for a very short but concise answer to each of the following situations. That should make me find the problem, I think. Would be great if you cold post the answers:
>
> Imagine my EAR is called a.ear and the RAR is called b.rar (found inside a.ear), can you please tell me what to write exactly at each place? The problem is with the links you provided, that it just says "write xyz", but not WHERE to write that!
>
>
> (1) Inbound Reference
>
> @MessageDriven(/* what here to link it to the inbound? */)
>
> or do I have to use sun specific deployment descriptors (and what to write into it)?
>
>
> (2) Outbound Reference
>
> @Resource(/* what here to link it to the outbound? */)
> private CustomConnectionFactory theFactory;
>
>
> (3) How to create the needed pool?
>
> As I said, the EAR will not deploy since it cannot bind, so I cannot create a pool AFTER deployment. What do do?
>
>
> Thank you so much!
> Markus
>
> -----Original Message-----
> From: Sivakumar.Thyagarajan@Sun.COM [mailto:Sivakumar.Thyagarajan@Sun.COM]
> Sent: Mittwoch, 25. Juni 2008 19:50
> To: ejb@glassfish.dev.java.net
> Cc: Markus Karg
> Subject: Re: @Resource / Help Needed
>
> Hi Markus
>
> >>> Can you please be so kind to help me with this problem?
> >>>
> >>> I am sure if you would provide just a step-by-step instruction
> >>> taylored to JUST embedded adapters, this would help me. Embedded
> >>> adapters are just shortly covered and I just do not understand the
> >>> existing documentation.
>
> Embedded resource adapters deployment is covered in [1]
>
> An embedded RA is referred using the template "AppName#EmbeddedRARname"
> as documented in the link above. Connector resources (connector
> connection pools/admin objects) can be created using that name while
> using the asadmin CLI. The resources for the embedded RARs can be
> created using the admin GUI as well and the embedded RARs should just
> show up in the drop-down list.
>
> [2] talks about how a MDB can be configured to listed to a resource
> adapter. For an embedded RAR, make your in
> sun-ejb-jar.xml point to AppName#EmbeddedRARname
>
> Please let this list know should you face any issues while trying these out.
>
> >>> Or can you please kindly forward my request to the commercial
> >>> programmer support so they can send me a per incidence contract or
> >>> something?
>
> FYI: GlassFish support subscriptions related information is at [3] and
> per-incident based developer support is available off [4]
>
> Thanks
> --Siva.
>
> [1] http://docs.sun.com/app/docs/doc/819-3672/bealq?a=view
> [2] http://docs.sun.com/app/docs/doc/819-3672/beama?a=view
> [3] http://www.sun.com/service/applicationserversubscriptions/index.jsp
> and http://www.sun.com/software/products/appsrvr/support.jsp
> [4] http://developers.sun.com/services/expertassistance/
>
>
> Kenneth Saks wrote:
> > Hi Markus,
> >
> > I've forwarded this to some connector team members who should be able to
> > help.
> >
> > --ken
> >
> > On Jun 25, 2008, at 5:26 AM, Markus Karg wrote:
> >
> >> Dear EJB Team,
> >>
> >> sorry for bothering with user questions, but unfortunately nobody in
> >> the users forum was able to help me so you are my last hope.
> >>
> >> In my EAR I have an EJB-JAR and a resource adapter. The resource
> >> adapter provides inbound and outbound of custom interfaces (neither
> >> JMS nor JDBC). I need to bind a MDB found in the EJB-JAR to that
> >> embedded resource adapter (listening to inbound as it is an MDB) and
> >> some other EJBs in the same EJB-JAR to the outbound using @Resource.
> >>
> >> I have developed lots of RARs in the past, and used them within JOnAS
> >> for years. So my problem is mainly about GlassFishv2 configuration but
> >> not about programming.
> >>
> >> I checked all the online resources and forums, but still I am stuck. I
> >> just doesn't work, and more and more I am getting confused.
> >>
> >> Can you please be so kind to help me with this problem?
> >>
> >> I am sure if you would provide just a step-by-step instruction
> >> taylored to JUST embedded adapters, this would help me. Embedded
> >> adapters are just shortly covered and I just do not understand the
> >> existing documentation.
> >>
> >> Or can you please kindly forward my request to the commercial
> >> programmer support so they can send me a per incidence contract or
> >> something?
> >>
> >> I really need help!
> >>
> >> Thanks
> >> Markus
> >>
> >> QUIPSY QUALITY GmbH & Co. KG
> >> Ein Unternehmen der MES-Gruppe
> >> Stuttgarter Strasse 23
> >> D-75179 Pforzheim
> >> Tel: 07231-9189-52
> >> Fax: 07231-9189-59
> >> www.quipsy.de
> >> karg@quipsy.de
> >> Registergericht Mannheim HRA 701214
> >> Geschäftsführer: Nils Schroeder
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ejb-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: ejb-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Markus Karg

Jagadish and Sivukamar,

thank you for beeing so patient.

Let's start with the outbound and check the inbound later. So here is the result of what you told me:

* In the code I wrote:

@Resource(name = "QUIPSY_KERNEL")
private KernelConnectionFactory kernelConnectionFactory;

When I deploy the EAR, the following stack trace is posted in the log (truncated; see below signature for full stack trace):

[#|2008-06-26T09:00:39.181+0200|SEVERE|sun-appserver9.1|javax.enterprise.system.core.naming|_ThreadID=21;_ThreadName=httpWorkerThread-4848-2;_RequestID=1e1bf0c8-e43b-41b6-be34-51b9efdd10c0;|javax.naming.NameNotFoundException
javax.naming.NameNotFoundException: QUIPSY_KERNEL not found
at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216)

I cannot believe that ignoring SEVERE log entries and stack traces shall really be the officially planned way to deploy embedded RARs!? Isn't there a way to automatically create a pool and resource by just deploying the app, e. g. by providing some more information to the annotation or to the deployment descriptor? I do not believe that our customers will be happy if I tell them they must ignore a stack trace at deployment.

Also it is some kind of strange that after undeploy of my EAR the pool and resource is still there. Since in turn the embedded RAR is undeployed, too, what sense does that make? Doesn't that lead to errors? Since it looks like the resource configuration is shared by all apps (what must not happen with an embedded (!) RAR) that means that other apps will "see" my embedded RAR even after it got deployed?!

But at least it seems to work. After undeploy and deploy, there is no more "NameNotFoundException: QUIPSY Kernel not found" in the server's log.

So next I will try to set up INBOUND referencing.

Thanks a lot!
Markus

Here is the full stack trace:

[#|2008-06-26T09:00:39.181+0200|SEVERE|sun-appserver9.1|javax.enterprise.system.core.naming|_ThreadID=21;_ThreadName=httpWorkerThread-4848-2;_RequestID=1e1bf0c8-e43b-41b6-be34-51b9efdd10c0;|javax.naming.NameNotFoundException
javax.naming.NameNotFoundException: QUIPSY_KERNEL not found
at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216)
at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:188)
at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:74)
at com.sun.enterprise.naming.LocalSerialContextProviderImpl.lookup(LocalSerialContextProviderImpl.java:111)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.sun.enterprise.naming.NamingManagerImpl.bindObjects(NamingManagerImpl.java:391)
at com.sun.ejb.containers.BaseContainer.setupEnvironment(BaseContainer.java:2754)
at com.sun.ejb.containers.BaseContainer.(BaseContainer.java:659)
at com.sun.ejb.containers.MessageBeanContainer.(MessageBeanContainer.java:150)
at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:524)
at com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:536)
at com.sun.enterprise.server.ApplicationLoader.doLoad(ApplicationLoader.java:188)
at com.sun.enterprise.server.TomcatApplicationLoader.doLoad(TomcatApplicationLoader.java:126)
at com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:244)
at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:336)
at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:210)
at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:645)
at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:928)
at com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeployEvent(AdminEventMulticaster.java:912)
at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:461)
at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:176)
at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:308)
at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:226)
at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:298)
at com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(ApplicationStartPhase.java:132)
at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:919)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:591)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:635)
at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsConfigMBean.java:744)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:375)
at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:358)
at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:464)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
at $Proxy1.invoke(Unknown Source)
at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:304)
at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:174)
at com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(InvokeCaller.java:69)
at com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.handle(MBeanServerRequestHandler.java:155)
at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.processRequest(RemoteJmxConnectorServlet.java:122)
at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.doPost(RemoteJmxConnectorServlet.java:193)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)
|#]

-----Original Message-----
From: Jagadish.Ramu@Sun.COM [mailto:Jagadish.Ramu@Sun.COM]
Sent: Donnerstag, 26. Juni 2008 05:45
To: ejb@glassfish.dev.java.net; users
Cc: Sivakumar.Thyagarajan@Sun.COM
Subject: RE: @Resource / Help Needed

Hi Markus,
* Can you post the deployment time error messages ?

*Please refer to my response for the steps.
https://glassfish.dev.java.net/servlets/ReadMsg?list=users&msgNo=20636

Infact, you can write your bean with
@Resource(name="connector-resource")
MyIntf intf

and deploy the application. Once the app. is deployed you can create a
pool and resource by name "connector-resource".

Thanks,
-Jagadish

On Wed, 2008-06-25 at 20:26 +0200, Markus Karg wrote:
> Hello Sivakumar,
>
> thank you for posting this links.
>
> Unfortunately, I do know all of them so it doesn't solve my problem due to two facts: (A) it says WHAT to write but not WHERE to write that (B) it tells I shall create a pool after deployment, but the deployment fails sind the binding of the bean fails!

>
>
> My problem is like this:
>
> That links say that *after* deploying the EAR (containing the embedded RAR) I have to use some other admin command to create a connection pool. But the problem is that *at* deployment I get error messages that both references (@Resource to the outbound, @MessageDriven to the inbound) cannot be bound, so I have stack traces found in the log and the application is not loaded! Since the application is not loaded, I cannot call that admin command.
>
> If you want I can post the stack trace of the deploy command!
>
> See the problem?
>
> So what I'd like to do is to ask you for a very short but concise answer to each of the following situations. That should make me find the problem, I think. Would be great if you cold post the answers:
>
> Imagine my EAR is called a.ear and the RAR is called b.rar (found inside a.ear), can you please tell me what to write exactly at each place? The problem is with the links you provided, that it just says "write xyz", but not WHERE to write that!
>
>
> (1) Inbound Reference
>
> @MessageDriven(/* what here to link it to the inbound? */)
>
> or do I have to use sun specific deployment descriptors (and what to write into it)?
>
>
> (2) Outbound Reference
>
> @Resource(/* what here to link it to the outbound? */)
> private CustomConnectionFactory theFactory;
>
>
> (3) How to create the needed pool?
>
> As I said, the EAR will not deploy since it cannot bind, so I cannot create a pool AFTER deployment. What do do?
>
>
> Thank you so much!
> Markus
>
> -----Original Message-----
> From: Sivakumar.Thyagarajan@Sun.COM [mailto:Sivakumar.Thyagarajan@Sun.COM]
> Sent: Mittwoch, 25. Juni 2008 19:50
> To: ejb@glassfish.dev.java.net
> Cc: Markus Karg
> Subject: Re: @Resource / Help Needed
>
> Hi Markus
>
> >>> Can you please be so kind to help me with this problem?
> >>>
> >>> I am sure if you would provide just a step-by-step instruction
> >>> taylored to JUST embedded adapters, this would help me. Embedded
> >>> adapters are just shortly covered and I just do not understand the
> >>> existing documentation.
>
> Embedded resource adapters deployment is covered in [1]
>
> An embedded RA is referred using the template "AppName#EmbeddedRARname"
> as documented in the link above. Connector resources (connector
> connection pools/admin objects) can be created using that name while
> using the asadmin CLI. The resources for the embedded RARs can be
> created using the admin GUI as well and the embedded RARs should just
> show up in the drop-down list.
>
> [2] talks about how a MDB can be configured to listed to a resource
> adapter. For an embedded RAR, make your in
> sun-ejb-jar.xml point to AppName#EmbeddedRARname
>
> Please let this list know should you face any issues while trying these out.
>
> >>> Or can you please kindly forward my request to the commercial
> >>> programmer support so they can send me a per incidence contract or
> >>> something?
>
> FYI: GlassFish support subscriptions related information is at [3] and
> per-incident based developer support is available off [4]
>
> Thanks
> --Siva.
>
> [1] http://docs.sun.com/app/docs/doc/819-3672/bealq?a=view
> [2] http://docs.sun.com/app/docs/doc/819-3672/beama?a=view
> [3] http://www.sun.com/service/applicationserversubscriptions/index.jsp
> and http://www.sun.com/software/products/appsrvr/support.jsp
> [4] http://developers.sun.com/services/expertassistance/
>
>
> Kenneth Saks wrote:
> > Hi Markus,
> >
> > I've forwarded this to some connector team members who should be able to
> > help.
> >
> > --ken
> >
> > On Jun 25, 2008, at 5:26 AM, Markus Karg wrote:
> >
> >> Dear EJB Team,
> >>
> >> sorry for bothering with user questions, but unfortunately nobody in
> >> the users forum was able to help me so you are my last hope.
> >>
> >> In my EAR I have an EJB-JAR and a resource adapter. The resource
> >> adapter provides inbound and outbound of custom interfaces (neither
> >> JMS nor JDBC). I need to bind a MDB found in the EJB-JAR to that
> >> embedded resource adapter (listening to inbound as it is an MDB) and
> >> some other EJBs in the same EJB-JAR to the outbound using @Resource.
> >>
> >> I have developed lots of RARs in the past, and used them within JOnAS
> >> for years. So my problem is mainly about GlassFishv2 configuration but
> >> not about programming.
> >>
> >> I checked all the online resources and forums, but still I am stuck. I
> >> just doesn't work, and more and more I am getting confused.
> >>
> >> Can you please be so kind to help me with this problem?
> >>
> >> I am sure if you would provide just a step-by-step instruction
> >> taylored to JUST embedded adapters, this would help me. Embedded
> >> adapters are just shortly covered and I just do not understand the
> >> existing documentation.
> >>
> >> Or can you please kindly forward my request to the commercial
> >> programmer support so they can send me a per incidence contract or
> >> something?
> >>
> >> I really need help!
> >>
> >> Thanks
> >> Markus
> >>
> >> QUIPSY QUALITY GmbH & Co. KG
> >> Ein Unternehmen der MES-Gruppe
> >> Stuttgarter Strasse 23
> >> D-75179 Pforzheim
> >> Tel: 07231-9189-52
> >> Fax: 07231-9189-59
> >> www.quipsy.de
> >> karg@quipsy.de
> >> Registergericht Mannheim HRA 701214
> >> Geschäftsführer: Nils Schroeder
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ejb-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: ejb-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: ejb-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: ejb-help@glassfish.dev.java.net

Jagadish Prasath Ramu

Hi Markus,

On Thu, 2008-06-26 at 09:17 +0200, Markus Karg wrote:

> Jagadish and Sivukamar,
>
> thank you for beeing so patient.
>
> Let's start with the outbound and check the inbound later. So here is the result of what you told me:
>
> * In the code I wrote:
>
> @Resource(name = "QUIPSY_KERNEL")
> private KernelConnectionFactory kernelConnectionFactory;
>
> When I deploy the EAR, the following stack trace is posted in the log (truncated; see below signature for full stack trace):
>
> [#|2008-06-26T09:00:39.181+0200|SEVERE|sun-appserver9.1|javax.enterprise.system.core.naming|_ThreadID=21;_ThreadName=httpWorkerThread-4848-2;_RequestID=1e1bf0c8-e43b-41b6-be34-51b9efdd10c0;|javax.naming.NameNotFoundException
> javax.naming.NameNotFoundException: QUIPSY_KERNEL not found
> at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216)
>
>
> I cannot believe that ignoring SEVERE log entries and stack traces shall really be the officially planned way to deploy embedded RARs!? Isn't there a way to automatically create a pool and resource by just deploying the app, e. g. by providing some more information to the annotation or to the deployment descriptor? I do not believe that our customers will be happy if I tell them they must ignore a stack trace at deployment.

Is this happening in an MDB ?, in any case can you post the pseudo-code
of how do you inject and where the resource is being used ?

>
> Also it is some kind of strange that after undeploy of my EAR the pool and resource is still there. Since in turn the embedded RAR is undeployed, too, what sense does that make? Doesn't that lead to errors? Since it looks like the resource configuration is shared by all apps (what must not happen with an embedded (!) RAR) that means that other apps will "see" my embedded RAR even after it got deployed?!

resources/pools created for embedded rars are available only for the
enclosing .ear. No other app. can refer to them.

http://docs.sun.com/app/docs/doc/819-3672/bealp?a=view
Dev Guide > Developing app & app components > developing connectors >
redeploying stand-alone connector modules

states that resources/pools can exist though .rar is undeployed. I
guess, the same is applicable for embedded .rars also.

Thanks,
-Jagadish

>
> But at least it seems to work. After undeploy and deploy, there is no more "NameNotFoundException: QUIPSY Kernel not found" in the server's log.
>
> So next I will try to set up INBOUND referencing.
>
>
> Thanks a lot!
> Markus
>
>
> Here is the full stack trace:
>
> [#|2008-06-26T09:00:39.181+0200|SEVERE|sun-appserver9.1|javax.enterprise.system.core.naming|_ThreadID=21;_ThreadName=httpWorkerThread-4848-2;_RequestID=1e1bf0c8-e43b-41b6-be34-51b9efdd10c0;|javax.naming.NameNotFoundException
> javax.naming.NameNotFoundException: QUIPSY_KERNEL not found
> at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216)
> at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:188)
> at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:74)
> at com.sun.enterprise.naming.LocalSerialContextProviderImpl.lookup(LocalSerialContextProviderImpl.java:111)
> at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
> at javax.naming.InitialContext.lookup(InitialContext.java:392)
> at com.sun.enterprise.naming.NamingManagerImpl.bindObjects(NamingManagerImpl.java:391)
> at com.sun.ejb.containers.BaseContainer.setupEnvironment(BaseContainer.java:2754)
> at com.sun.ejb.containers.BaseContainer.(BaseContainer.java:659)
> at com.sun.ejb.containers.MessageBeanContainer.(MessageBeanContainer.java:150)
> at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:524)
> at com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:536)
> at com.sun.enterprise.server.ApplicationLoader.doLoad(ApplicationLoader.java:188)
> at com.sun.enterprise.server.TomcatApplicationLoader.doLoad(TomcatApplicationLoader.java:126)
> at com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:244)
> at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:336)
> at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:210)
> at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:645)
> at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:928)
> at com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeployEvent(AdminEventMulticaster.java:912)
> at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:461)
> at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:176)
> at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:308)
> at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:226)
> at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:298)
> at com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(ApplicationStartPhase.java:132)
> at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
> at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:919)
> at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:591)
> at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:635)
> at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsConfigMBean.java:744)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:375)
> at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:358)
> at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:464)
> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
> at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
> at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
> at $Proxy1.invoke(Unknown Source)
> at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:304)
> at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:174)
> at com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(InvokeCaller.java:69)
> at com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.handle(MBeanServerRequestHandler.java:155)
> at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.processRequest(RemoteJmxConnectorServlet.java:122)
> at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.doPost(RemoteJmxConnectorServlet.java:193)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
> at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
> at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
> at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
> at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
> at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
> at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
> at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
> at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
> at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
> at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
> at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)
> |#]
>
>
> -----Original Message-----
> From: Jagadish.Ramu@Sun.COM [mailto:Jagadish.Ramu@Sun.COM]
> Sent: Donnerstag, 26. Juni 2008 05:45
> To: ejb@glassfish.dev.java.net; users
> Cc: Sivakumar.Thyagarajan@Sun.COM
> Subject: RE: @Resource / Help Needed
>
> Hi Markus,
> * Can you post the deployment time error messages ?
>
> *Please refer to my response for the steps.
> https://glassfish.dev.java.net/servlets/ReadMsg?list=users&msgNo=20636
>
> Infact, you can write your bean with
> @Resource(name="connector-resource")
> MyIntf intf
>
> and deploy the application. Once the app. is deployed you can create a
> pool and resource by name "connector-resource".
>
> Thanks,
> -Jagadish
>
>
> On Wed, 2008-06-25 at 20:26 +0200, Markus Karg wrote:
> > Hello Sivakumar,
> >
> > thank you for posting this links.
> >
> > Unfortunately, I do know all of them so it doesn't solve my problem due to two facts: (A) it says WHAT to write but not WHERE to write that (B) it tells I shall create a pool after deployment, but the deployment fails sind the binding of the bean fails!
>
> >
> >
> > My problem is like this:
> >
> > That links say that *after* deploying the EAR (containing the embedded RAR) I have to use some other admin command to create a connection pool. But the problem is that *at* deployment I get error messages that both references (@Resource to the outbound, @MessageDriven to the inbound) cannot be bound, so I have stack traces found in the log and the application is not loaded! Since the application is not loaded, I cannot call that admin command.
> >
> > If you want I can post the stack trace of the deploy command!
> >
> > See the problem?
> >
> > So what I'd like to do is to ask you for a very short but concise answer to each of the following situations. That should make me find the problem, I think. Would be great if you cold post the answers:
> >
> > Imagine my EAR is called a.ear and the RAR is called b.rar (found inside a.ear), can you please tell me what to write exactly at each place? The problem is with the links you provided, that it just says "write xyz", but not WHERE to write that!
> >
> >
> > (1) Inbound Reference
> >
> > @MessageDriven(/* what here to link it to the inbound? */)
> >
> > or do I have to use sun specific deployment descriptors (and what to write into it)?
> >
> >
> > (2) Outbound Reference
> >
> > @Resource(/* what here to link it to the outbound? */)
> > private CustomConnectionFactory theFactory;
> >
> >
> > (3) How to create the needed pool?
> >
> > As I said, the EAR will not deploy since it cannot bind, so I cannot create a pool AFTER deployment. What do do?
> >
> >
> > Thank you so much!
> > Markus
> >
> > -----Original Message-----
> > From: Sivakumar.Thyagarajan@Sun.COM [mailto:Sivakumar.Thyagarajan@Sun.COM]
> > Sent: Mittwoch, 25. Juni 2008 19:50
> > To: ejb@glassfish.dev.java.net
> > Cc: Markus Karg
> > Subject: Re: @Resource / Help Needed
> >
> > Hi Markus
> >
> > >>> Can you please be so kind to help me with this problem?
> > >>>
> > >>> I am sure if you would provide just a step-by-step instruction
> > >>> taylored to JUST embedded adapters, this would help me. Embedded
> > >>> adapters are just shortly covered and I just do not understand the
> > >>> existing documentation.
> >
> > Embedded resource adapters deployment is covered in [1]
> >
> > An embedded RA is referred using the template "AppName#EmbeddedRARname"
> > as documented in the link above. Connector resources (connector
> > connection pools/admin objects) can be created using that name while
> > using the asadmin CLI. The resources for the embedded RARs can be
> > created using the admin GUI as well and the embedded RARs should just
> > show up in the drop-down list.
> >
> > [2] talks about how a MDB can be configured to listed to a resource
> > adapter. For an embedded RAR, make your in
> > sun-ejb-jar.xml point to AppName#EmbeddedRARname
> >
> > Please let this list know should you face any issues while trying these out.
> >
> > >>> Or can you please kindly forward my request to the commercial
> > >>> programmer support so they can send me a per incidence contract or
> > >>> something?
> >
> > FYI: GlassFish support subscriptions related information is at [3] and
> > per-incident based developer support is available off [4]
> >
> > Thanks
> > --Siva.
> >
> > [1] http://docs.sun.com/app/docs/doc/819-3672/bealq?a=view
> > [2] http://docs.sun.com/app/docs/doc/819-3672/beama?a=view
> > [3] http://www.sun.com/service/applicationserversubscriptions/index.jsp
> > and http://www.sun.com/software/products/appsrvr/support.jsp
> > [4] http://developers.sun.com/services/expertassistance/
> >
> >
> > Kenneth Saks wrote:
> > > Hi Markus,
> > >
> > > I've forwarded this to some connector team members who should be able to
> > > help.
> > >
> > > --ken
> > >
> > > On Jun 25, 2008, at 5:26 AM, Markus Karg wrote:
> > >
> > >> Dear EJB Team,
> > >>
> > >> sorry for bothering with user questions, but unfortunately nobody in
> > >> the users forum was able to help me so you are my last hope.
> > >>
> > >> In my EAR I have an EJB-JAR and a resource adapter. The resource
> > >> adapter provides inbound and outbound of custom interfaces (neither
> > >> JMS nor JDBC). I need to bind a MDB found in the EJB-JAR to that
> > >> embedded resource adapter (listening to inbound as it is an MDB) and
> > >> some other EJBs in the same EJB-JAR to the outbound using @Resource.
> > >>
> > >> I have developed lots of RARs in the past, and used them within JOnAS
> > >> for years. So my problem is mainly about GlassFishv2 configuration but
> > >> not about programming.
> > >>
> > >> I checked all the online resources and forums, but still I am stuck. I
> > >> just doesn't work, and more and more I am getting confused.
> > >>
> > >> Can you please be so kind to help me with this problem?
> > >>
> > >> I am sure if you would provide just a step-by-step instruction
> > >> taylored to JUST embedded adapters, this would help me. Embedded
> > >> adapters are just shortly covered and I just do not understand the
> > >> existing documentation.
> > >>
> > >> Or can you please kindly forward my request to the commercial
> > >> programmer support so they can send me a per incidence contract or
> > >> something?
> > >>
> > >> I really need help!
> > >>
> > >> Thanks
> > >> Markus
> > >>
> > >> QUIPSY QUALITY GmbH & Co. KG
> > >> Ein Unternehmen der MES-Gruppe
> > >> Stuttgarter Strasse 23
> > >> D-75179 Pforzheim
> > >> Tel: 07231-9189-52
> > >> Fax: 07231-9189-59
> > >> www.quipsy.de
> > >> karg@quipsy.de
> > >> Registergericht Mannheim HRA 701214
> > >> Geschäftsführer: Nils Schroeder
> > >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ejb-unsubscribe@glassfish.dev.java.net
> > For additional commands, e-mail: ejb-help@glassfish.dev.java.net
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ejb-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: ejb-help@glassfish.dev.java.net
>
[att1.html]

Markus Karg

Jagadish and Sivakumar,

thank you for your kind help. Please find my answers inlined.

>I cannot believe that ignoring SEVERE log entries and stack traces shall really be the officially planned way to deploy embedded RARs!? Isn't >there a way to automatically create a pool and resource by just deploying the app, e. g. by providing some more information to the annotation >or to the deployment descriptor? I do not believe that our customers will be happy if I tell them they must ignore a stack trace at >deployment.

>Is this happening in an MDB ?, in any case can you post the pseudo-code of how do you inject and where the resource is being used ?

Yes this is happening in an MDB. Here is the code. Currently it is only injected but not used (usage code was removed temporarily as soon we experienced problems):

@Resource(name = "QUIPSY_KERNEL")

private KernelConnectionFactory kernelConnectionFactory;

>Also it is some kind of strange that after undeploy of my EAR the pool and resource is still there. Since in turn the embedded RAR is >undeployed, too, what sense does that make? Doesn't that lead to errors? Since it looks like the resource configuration is shared by all apps >(what must not happen with an embedded (!) RAR) that means that other apps will "see" my embedded RAR even after it got deployed?!

>resources/pools created for embedded rars are available only for the enclosing .ear. No other app. can refer to them.

But how to see the difference on the screen? I mean, I provide a JDNI name to the resource, just as I do for global ones. So is that JNDI name private to that application or what will happen if another application does lookup for that JNDI name?

>http://docs.sun.com/app/docs/doc/819-3672/bealp?a=view
>Dev Guide > Developing app & app components > developing connectors > redeploying stand-alone connector modules
>states that resources/pools can exist though .rar is undeployed. I guess, the same is applicable for embedded .rars also.

I am not redeploying but undeploying and deploying again. That's a far difference.

Thanks

Markus

[att1.html]