dev@glassfish.java.net

[gf-dev] Re: error occurs when adding 'connection-factory' element in 'application.xml' file of ear package

From: Reza Rahman <reza.rahman_at_oracle.com>
Date: Fri, 12 Sep 2014 10:01:57 -0400

Please share the connection factory definition. The likely problem is trying to bind something to comp/env in an EAR context, which makes no sense.

Sent from my iPhone

> On Sep 12, 2014, at 5:24 AM, William <streetpoet_at_163.com> wrote:
>
>
> Dear Experts,
>
> I have a javeEE project with an EAR package. Within ear package, I add 'connection-factory’ element at the end of ‘application.xml’ file, but get errors on glassfish console as below. It seems like I need do some security configuration first but I don’t know why and how to do that. Since if I put connection-factory inside the EJB code as annotation, there is no error display and system works well.
> So what is the difference between writing connection-fatory in application.xml or in code with annotation?
> Thanks in advance.
>
>
> java.lang.IllegalStateException: Application validation fails for given application [community-dynamic-ear] for jndi-name [java:comp/env/eis/DMXCMSConnectionFactory]
> at com.sun.enterprise.deployment.util.ApplicationValidator.accept(ApplicationValidator.java:112)
> at com.sun.enterprise.deployment.BundleDescriptor.visit(BundleDescriptor.java:625)
> at com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:703)
> at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:248)
> at com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:232)
> at org.glassfish.javaee.core.deployment.DolProvider.processDOL(DolProvider.java:193)
> at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:227)
> at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:96)
> at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:881)
> at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:821)
> at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:377)
> 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:539)
> at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
> 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:534)
> at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
> at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
> at java.security.AccessController.doPrivileged(Native Method)
> at javax.security.auth.Subject.doAs(Subject.java:356)
> at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
> at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
> at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
> at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
> at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
> 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.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)
> at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
> at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
> at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
> at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
> at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
> at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
> at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
> at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
> at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
> at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
> at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
> at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
> at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
> at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
> at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
> at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
> at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
> at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
> at java.lang.Thread.run(Thread.java:744)
>
> ########################
> William
> System Architect
> streetpoet_at_163.com
> ########################
>