Skip to main content

deploy to Glassfish 3.1.2 fails with "java.lang.RuntimeException: Invalid resource : ***__pm"

No replies
m_perdikeas
Offline
Joined: 2012-07-15

I am deploying a simple *.war to Glassfish 3.1.2 on a Windows 7 machine.
I keep my glassfish-resources.xml in /WEB-INF and my persistence.xml in /WEB-INF/classes/META-INF. I am assuming that I can deploy the *.war without configuring anything else regarding the data-source on Glassfish. I.e. all information is provided in persistence.xml and glassfish-resources.xml.

I provide both my persistence.xml and my glassfish-resources.xml in the attached zip.

When I copy my war to the auto-deploy folder of GlassFish Server 3.1.2 I get the stack-trace that I append at the end of the message. My questions are:

  • what is the nature and cause of this error?
  • why does GlassFish appends the string "__pm" to the name of the resource
  • would there be any difference if the jndi-name was specified in the "java:/myorders2" style? (actually I tried both ways and I keep getting the same message).
  • is my assumption that one can deploy a *.war to GlassFish without configuring any data sources, JDBC resources or pools on the server correct? In other words, can one provide all persistence-related information in the *.war file without having to configure anything beforehand on the server?

    Stack Trace:
    INFO: [AutoDeploy] Selecting file C:\Users\mperdikeas\.netbeans\7.1.2\config\GF3\domain1\autodeploy\orders.war for autodeployment.
    SEVERE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
    SEVERE: Exception while preparing the app
    SEVERE: Invalid resource : myorders2__pm
    java.lang.RuntimeException: Invalid resource : myorders2__pm
    at com.sun.enterprise.connectors.ConnectorRuntime.lookupDataSourceInDAS(ConnectorRuntime.java:540)
    at com.sun.enterprise.connectors.ConnectorRuntime.lookupPMResource(ConnectorRuntime.java:469)
    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.(PersistenceUnitInfoImpl.java:108)
    at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:155)
    at org.glassfish.persistence.jpa.PersistenceUnitLoader.(PersistenceUnitLoader.java:120)
    at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:224)
    at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:495)
    at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:233)
    at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:871)
    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:389)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:353)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
    at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:145)
    at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:575)
    at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:461)
    at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:389)
    at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:380)
    at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:220)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)
    Caused by: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Invalid resource : myorders2__pm
    at com.sun.enterprise.connectors.service.ConnectorResourceAdminServiceImpl$MyDataSource.validateResource(ConnectorResourceAdminServiceImpl.java:274)
    at com.sun.enterprise.connectors.service.ConnectorResourceAdminServiceImpl$MyDataSource.setResourceInfo(ConnectorResourceAdminServiceImpl.java:255)
    at com.sun.enterprise.connectors.service.ConnectorResourceAdminServiceImpl.lookupDataSourceInDAS(ConnectorResourceAdminServiceImpl.java:245)
    at com.sun.enterprise.connectors.ConnectorRuntime.lookupDataSourceInDAS(ConnectorRuntime.java:538)
    ... 27 more

  • AttachmentSize
    glassfish-resources-and-persistence.zip1.29 KB