在 glassfish 中部署战争的问题
当我想在 glassfish 中部署我的 Web 应用程序(我使用 Netbeans 制作)时,出现此错误
部署期间发生错误:准备应用程序时出现异常:无效资源:tun__pm。请参阅 server.log 了解更多详细信息
该应用程序是一个 RESTful Web 服务,当我测试它时,netbeans 部署它并且它工作正常。但是当我获取 .war 文件并想要部署它时,出现错误。
这是日志:
> [#|2011-04-30T19:50:05.229+0100|SEVERE|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=84;_ThreadName=Thread-3;|Invalid
> resource : tun__pm
> java.lang.RuntimeException: Invalid
> resource : tun__pm at
> com.sun.enterprise.connectors.ConnectorRuntime.lookupDataSourceInDAS(ConnectorRuntime.java:539)
> at
> com.sun.enterprise.connectors.ConnectorRuntime.lookupPMResource(ConnectorRuntime.java:468)
> at
> org.glassfish.persistence.common.PersistenceHelper.lookupPMResource(PersistenceHelper.java:63)
> at
> org.glassfish.persistence.jpa.ProviderContainerContractInfoBase.lookupDataSource(ProviderContainerContractInfoBase.java:71)
> at
> org.glassfish.persistence.jpa.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:108)
> at
> org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:154)
> at
> org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:119)
> at
> org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:213)
> at
> org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:486)
> at
> org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:220)
> at
> org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:166)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:870)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:410)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
> at
> org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1067)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
> at
> org.glassfish.admingui.common.util.LocalDeploymentFacility$LocalDFCommandRunner.run(LocalDeploymentFacility.java:143)
> at
> org.glassfish.deployment.client.AbstractDeploymentFacility.deploy(AbstractDeploymentFacility.java:406)
> at
> org.glassfish.admingui.common.util.DeployUtil.invokeDeploymentFacility(DeployUtil.java:100)
> at
> org.glassfish.admingui.common.util.DeployUtil.deploy(DeployUtil.java:76)
> at
> org.glassfish.admingui.common.handlers.DeploymentHandler.deploy(DeploymentHandler.java:191)
> 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.jsftemplating.layout.descriptors.handler.Handler.invoke(Handler.java:442)
> at
> com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:420)
> at
> com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:394)
> at
> com.sun.jsftemplating.layout.event.CommandActionListener.invokeCommandHandlers(CommandActionListener.java:150)
> at
> com.sun.jsftemplating.layout.event.CommandActionListener.processAction(CommandActionListener.java:98)
> at
> javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
> at
> javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)
> at
> javax.faces.component.UICommand.broadcast(UICommand.java:300)
> at
> com.sun.webui.jsf.component.WebuiCommand.broadcast(WebuiCommand.java:166)
> at
> javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
> at
> javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
> at
> com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
> at
> com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
> at
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
> at
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:409)
> at
> org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
> at
> com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:223)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
> at
> org.apache.catalina.core.StandardPipeline.doChainInvoke(StandardPipeline.java:600)
> at
> com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:96)
> at
> com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
> at
> org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:228)
> at
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
> at
> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
> at
> com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
> at
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
> at
> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
> at
> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
> at
> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
> at
> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
> at
> com.sun.grizzly.ContextTask.run(ContextTask.java:71)
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
> at
> java.lang.Thread.run(Thread.java:680)
> Caused by:
> com.sun.appserv.connectors.internal.api.ConnectorRuntimeException:
> Invalid resource : tun__pm at
> com.sun.enterprise.connectors.service.ConnectorResourceAdminServiceImpl$MyDataSource.validateResource(ConnectorResourceAdminServiceImpl.java:272)
> at
> com.sun.enterprise.connectors.service.ConnectorResourceAdminServiceImpl$MyDataSource.setResourceInfo(ConnectorResourceAdminServiceImpl.java:253)
> at
> com.sun.enterprise.connectors.service.ConnectorResourceAdminServiceImpl.lookupDataSourceInDAS(ConnectorResourceAdminServiceImpl.java:243)
> at
> com.sun.enterprise.connectors.ConnectorRuntime.lookupDataSourceInDAS(ConnectorRuntime.java:537)
> ... 74 more |#]
>
> [#|2011-04-30T19:50:05.238+0100|SEVERE|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=84;_ThreadName=Thread-3;|Exception
> while preparing the app : Invalid
> resource : tun__pm
> com.sun.appserv.connectors.internal.api.ConnectorRuntimeException:
> Invalid resource : tun__pm at
> com.sun.enterprise.connectors.service.ConnectorResourceAdminServiceImpl$MyDataSource.validateResource(ConnectorResourceAdminServiceImpl.java:272)
> at
> com.sun.enterprise.connectors.service.ConnectorResourceAdminServiceImpl$MyDataSource.setResourceInfo(ConnectorResourceAdminServiceImpl.java:253)
> at
> com.sun.enterprise.connectors.service.ConnectorResourceAdminServiceImpl.lookupDataSourceInDAS(ConnectorResourceAdminServiceImpl.java:243)
> at
> com.sun.enterprise.connectors.ConnectorRuntime.lookupDataSourceInDAS(ConnectorRuntime.java:537)
> at
> com.sun.enterprise.connectors.ConnectorRuntime.lookupPMResource(ConnectorRuntime.java:468)
> at
> org.glassfish.persistence.common.PersistenceHelper.lookupPMResource(PersistenceHelper.java:63)
> at
> org.glassfish.persistence.jpa.ProviderContainerContractInfoBase.lookupDataSource(ProviderContainerContractInfoBase.java:71)
> at
> org.glassfish.persistence.jpa.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:108)
> at
> org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:154)
> at
> org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:119)
> at
> org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:213)
> at
> org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:486)
> at
> org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:220)
> at
> org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:166)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:870)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:410)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
> at
> org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1067)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
> at
> org.glassfish.admingui.common.util.LocalDeploymentFacility$LocalDFCommandRunner.run(LocalDeploymentFacility.java:143)
> at
> org.glassfish.deployment.client.AbstractDeploymentFacility.deploy(AbstractDeploymentFacility.java:406)
> at
> org.glassfish.admingui.common.util.DeployUtil.invokeDeploymentFacility(DeployUtil.java:100)
> at
> org.glassfish.admingui.common.util.DeployUtil.deploy(DeployUtil.java:76)
> at
> org.glassfish.admingui.common.handlers.DeploymentHandler.deploy(DeploymentHandler.java:191)
> 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.jsftemplating.layout.descriptors.handler.Handler.invoke(Handler.java:442)
> at
> com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:420)
> at
> com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:394)
> at
> com.sun.jsftemplating.layout.event.CommandActionListener.invokeCommandHandlers(CommandActionListener.java:150)
> at
> com.sun.jsftemplating.layout.event.CommandActionListener.processAction(CommandActionListener.java:98)
> at
> javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
> at
> javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)
> at
> javax.faces.component.UICommand.broadcast(UICommand.java:300)
> at
> com.sun.webui.jsf.component.WebuiCommand.broadcast(WebuiCommand.java:166)
> at
> javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
> at
> javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
> at
> com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
> at
> com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
> at
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
> at
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:409)
> at
> org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
> at
> com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:223)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
> at
> org.apache.catalina.core.StandardPipeline.doChainInvoke(StandardPipeline.java:600)
> at
> com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:96)
> at
> com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
> at
> org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:228)
> at
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
> at
> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
> at
> com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
> at
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
> at
> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
> at
> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
> at
> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
> at
> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
> at
> com.sun.grizzly.ContextTask.run(ContextTask.java:71)
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
> at
> java.lang.Thread.run(Thread.java:680)
我不知道什么是 tun__pm ,但 tun 是 netbeans 中数据库连接的名称。我应该在 glassfish 中为数据库连接做些什么吗? mysql正在工作..
when i want to deploy my web application ( i make it with netbeans) in glassfish i have this error
Error occurred during deployment: Exception while preparing the app : Invalid resource : tun__pm. Please see server.log for more details
The application is a RESTful web service , when i test it , netbeans deploy it and it work fine . But when i took the .war file and want to deploy it i have the error .
this is the log:
> [#|2011-04-30T19:50:05.229+0100|SEVERE|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=84;_ThreadName=Thread-3;|Invalid
> resource : tun__pm
> java.lang.RuntimeException: Invalid
> resource : tun__pm at
> com.sun.enterprise.connectors.ConnectorRuntime.lookupDataSourceInDAS(ConnectorRuntime.java:539)
> at
> com.sun.enterprise.connectors.ConnectorRuntime.lookupPMResource(ConnectorRuntime.java:468)
> at
> org.glassfish.persistence.common.PersistenceHelper.lookupPMResource(PersistenceHelper.java:63)
> at
> org.glassfish.persistence.jpa.ProviderContainerContractInfoBase.lookupDataSource(ProviderContainerContractInfoBase.java:71)
> at
> org.glassfish.persistence.jpa.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:108)
> at
> org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:154)
> at
> org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:119)
> at
> org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:213)
> at
> org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:486)
> at
> org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:220)
> at
> org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:166)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:870)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:410)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
> at
> org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1067)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
> at
> org.glassfish.admingui.common.util.LocalDeploymentFacility$LocalDFCommandRunner.run(LocalDeploymentFacility.java:143)
> at
> org.glassfish.deployment.client.AbstractDeploymentFacility.deploy(AbstractDeploymentFacility.java:406)
> at
> org.glassfish.admingui.common.util.DeployUtil.invokeDeploymentFacility(DeployUtil.java:100)
> at
> org.glassfish.admingui.common.util.DeployUtil.deploy(DeployUtil.java:76)
> at
> org.glassfish.admingui.common.handlers.DeploymentHandler.deploy(DeploymentHandler.java:191)
> 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.jsftemplating.layout.descriptors.handler.Handler.invoke(Handler.java:442)
> at
> com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:420)
> at
> com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:394)
> at
> com.sun.jsftemplating.layout.event.CommandActionListener.invokeCommandHandlers(CommandActionListener.java:150)
> at
> com.sun.jsftemplating.layout.event.CommandActionListener.processAction(CommandActionListener.java:98)
> at
> javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
> at
> javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)
> at
> javax.faces.component.UICommand.broadcast(UICommand.java:300)
> at
> com.sun.webui.jsf.component.WebuiCommand.broadcast(WebuiCommand.java:166)
> at
> javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
> at
> javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
> at
> com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
> at
> com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
> at
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
> at
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:409)
> at
> org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
> at
> com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:223)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
> at
> org.apache.catalina.core.StandardPipeline.doChainInvoke(StandardPipeline.java:600)
> at
> com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:96)
> at
> com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
> at
> org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:228)
> at
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
> at
> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
> at
> com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
> at
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
> at
> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
> at
> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
> at
> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
> at
> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
> at
> com.sun.grizzly.ContextTask.run(ContextTask.java:71)
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
> at
> java.lang.Thread.run(Thread.java:680)
> Caused by:
> com.sun.appserv.connectors.internal.api.ConnectorRuntimeException:
> Invalid resource : tun__pm at
> com.sun.enterprise.connectors.service.ConnectorResourceAdminServiceImpl$MyDataSource.validateResource(ConnectorResourceAdminServiceImpl.java:272)
> at
> com.sun.enterprise.connectors.service.ConnectorResourceAdminServiceImpl$MyDataSource.setResourceInfo(ConnectorResourceAdminServiceImpl.java:253)
> at
> com.sun.enterprise.connectors.service.ConnectorResourceAdminServiceImpl.lookupDataSourceInDAS(ConnectorResourceAdminServiceImpl.java:243)
> at
> com.sun.enterprise.connectors.ConnectorRuntime.lookupDataSourceInDAS(ConnectorRuntime.java:537)
> ... 74 more |#]
>
> [#|2011-04-30T19:50:05.238+0100|SEVERE|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=84;_ThreadName=Thread-3;|Exception
> while preparing the app : Invalid
> resource : tun__pm
> com.sun.appserv.connectors.internal.api.ConnectorRuntimeException:
> Invalid resource : tun__pm at
> com.sun.enterprise.connectors.service.ConnectorResourceAdminServiceImpl$MyDataSource.validateResource(ConnectorResourceAdminServiceImpl.java:272)
> at
> com.sun.enterprise.connectors.service.ConnectorResourceAdminServiceImpl$MyDataSource.setResourceInfo(ConnectorResourceAdminServiceImpl.java:253)
> at
> com.sun.enterprise.connectors.service.ConnectorResourceAdminServiceImpl.lookupDataSourceInDAS(ConnectorResourceAdminServiceImpl.java:243)
> at
> com.sun.enterprise.connectors.ConnectorRuntime.lookupDataSourceInDAS(ConnectorRuntime.java:537)
> at
> com.sun.enterprise.connectors.ConnectorRuntime.lookupPMResource(ConnectorRuntime.java:468)
> at
> org.glassfish.persistence.common.PersistenceHelper.lookupPMResource(PersistenceHelper.java:63)
> at
> org.glassfish.persistence.jpa.ProviderContainerContractInfoBase.lookupDataSource(ProviderContainerContractInfoBase.java:71)
> at
> org.glassfish.persistence.jpa.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:108)
> at
> org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:154)
> at
> org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:119)
> at
> org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:213)
> at
> org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:486)
> at
> org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:220)
> at
> org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:166)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:870)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:410)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
> at
> org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1067)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
> at
> org.glassfish.admingui.common.util.LocalDeploymentFacility$LocalDFCommandRunner.run(LocalDeploymentFacility.java:143)
> at
> org.glassfish.deployment.client.AbstractDeploymentFacility.deploy(AbstractDeploymentFacility.java:406)
> at
> org.glassfish.admingui.common.util.DeployUtil.invokeDeploymentFacility(DeployUtil.java:100)
> at
> org.glassfish.admingui.common.util.DeployUtil.deploy(DeployUtil.java:76)
> at
> org.glassfish.admingui.common.handlers.DeploymentHandler.deploy(DeploymentHandler.java:191)
> 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.jsftemplating.layout.descriptors.handler.Handler.invoke(Handler.java:442)
> at
> com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:420)
> at
> com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:394)
> at
> com.sun.jsftemplating.layout.event.CommandActionListener.invokeCommandHandlers(CommandActionListener.java:150)
> at
> com.sun.jsftemplating.layout.event.CommandActionListener.processAction(CommandActionListener.java:98)
> at
> javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
> at
> javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)
> at
> javax.faces.component.UICommand.broadcast(UICommand.java:300)
> at
> com.sun.webui.jsf.component.WebuiCommand.broadcast(WebuiCommand.java:166)
> at
> javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
> at
> javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
> at
> com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
> at
> com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
> at
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
> at
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:409)
> at
> org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
> at
> com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:223)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
> at
> org.apache.catalina.core.StandardPipeline.doChainInvoke(StandardPipeline.java:600)
> at
> com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:96)
> at
> com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
> at
> org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:228)
> at
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
> at
> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
> at
> com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
> at
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
> at
> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
> at
> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
> at
> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
> at
> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
> at
> com.sun.grizzly.ContextTask.run(ContextTask.java:71)
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
> at
> java.lang.Thread.run(Thread.java:680)
i don't know what is tun__pm
but tun is the name of the database connection in netbeans .Should i do something in glassfish for the database connection ? mysql is working ..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我有同样的问题。
但无论如何,已经安装了 netbeans,如果您在安装时选择该选项,它还会同时安装 glassfish。
在服务选项卡中,如果右键单击 Glassfish 服务器的属性,则域文件夹为:
C:\Users\\{username}\\.netbeans\7.1\config\GF3
而不是 C:\Program Files\glassfish-3.1.1\glassfish\domains\domain1
因此,如果您在 netbeans 中启动默认域实例并创建任何数据源,它们实际上存储连接池和数据源信息在
C:\Users\\{用户名}\\.netbeans\7.1\config\GF3\domain1\config\domain.xml
中的domain.xml 中。所以解决方案是:
复制
从
C:\Users\\{username}\\.netbeans\7.1\config\GF3\domain1\config\domain.xml
到或
将 glassfish 域实例添加到以下位置的服务选项卡: netbeans 并使用它创建数据源(在 Windows 操作系统中,在将domain1添加到netbeans之前,右键单击netbeans并选择“以管理员身份运行”以打开它,否则netbeans无法检测到domain1的存在)
I had same issue.
But anyways, had installed netbeans, which also installs glassfish along with it, if you select that option while installing.
In the services tab, if you right click on the Glassfish server, properties, the domain folder is :
C:\Users\\{username}\\.netbeans\7.1\config\GF3
and not
C:\Program Files\glassfish-3.1.1\glassfish\domains\domain1
So if you start the default domain instance in netbeans and create any datasources , they actually store the connection pool and datasource info in the domain.xml in
C:\Users\\{username}\\.netbeans\7.1\config\GF3\domain1\config\domain.xml
.So solution is:
either copy
from your
C:\Users\\{username}\\.netbeans\7.1\config\GF3\domain1\config\domain.xml
toOR
add your glassfish domain instance to the services tab in netbeans and create your datasource using it (in windows OS, before adding domain1 to netbeans, right click on netbeans and select 'Run as Administrator' for opening it or else netbeans fails to detect the presence of domain1)
看起来您需要在 glassfish 中创建 JNDI 名称为“tun_pm”的 JDBC 资源。这应该可以解决您的查找错误。
Looks like you need to create a JDBC resource in glassfish with the JNDI name of "tun_pm". This should resolve your lookup error.
我在使用 NetBeans 7.1.2 和 Glassfish 进行开发时遇到了类似的问题,我不知道为什么,但我一直在使用的数据源和相关数据库服务有时会消失时间,因此它在部署时显示下一个错误:
Grave: 准备应用程序时出现异常:无效资源:whateverDBcon__pm
com.sun.appserv.connectors.internal.api.ConnectorRuntimeException:无效资源:whateverDBcon__pm
NetBeans 7.1.2 解决方案: 也许这不是专业的方法,但我刚刚创建了相同的数据源:
Configuration Files/persistence.xml
使用您可以在“设计”视图中找到的向导。只需使用与旧名称相同的 JNDI 名称,它将创建您需要的 JDBC 服务。cmutt78 有钥匙,谢谢!
I've been having a similar problem while developing using NetBeans 7.1.2 and Glassfish, I don't know why but the data source and the related database service that I've been using disappear from time to time so it displays the next error while deploying:
Grave: Exception while preparing the app : Invalid resource : whateverDBcon__pm
com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Invalid resource : whateverDBcon__pm
NetBeans 7.1.2 solution: Maybe it's not the professional way but I have just created the same data source:
Configuration Files/persistence.xml
using the wizard you can find at the "Design" view. Just use the same JNDI name of the old one and it will create the JDBC service you needed.cmutt78 had the key, thanks!