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.

Bug 238935 - SEVERE: Exception while preparing the app : Invalid resource : jdbc/<databasename>__pm
Summary: SEVERE: Exception while preparing the app : Invalid resource : jdbc/<databa...
Status: RESOLVED INCOMPLETE
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 7.0
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-28 14:50 UTC by strayan
Modified: 2015-02-11 18:35 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Attaching server logs, persistence.xml, POM.xml and glassfishserver-resources.xml (6.84 KB, application/x-zip-compressed)
2013-11-28 14:50 UTC, strayan
Details
Datasource Creations (65.17 KB, image/png)
2013-11-28 15:17 UTC, strayan
Details
All the requested logs (11.70 KB, application/x-zip-compressed)
2013-11-28 16:10 UTC, strayan
Details
Attaching the project (1.73 MB, application/x-zip-compressed)
2013-11-28 16:31 UTC, strayan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description strayan 2013-11-28 14:50:53 UTC
Created attachment 142682 [details]
Attaching server logs, persistence.xml, POM.xml and glassfishserver-resources.xml

Getting below error when trying to deploy from netbeans. Connection pool is successfully getting created but not JDBC datasource

Attaching server logs, persistence.xml, POM.xml and glassfishserver-resources.xml to share the config and error message.

BELOW ARE VERSION

Product Version: NetBeans IDE 7.4 (Build 201310111528)
Updates: NetBeans IDE is updated to version NetBeans 7.4 Patch 1
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\krithu\AppData\Roaming\NetBeans\7.4
Cache directory: C:\Users\krithu\AppData\Local\NetBeans\Cache\7.4

GlassFish Server Open Source Edition 4.0 (build 89)
Comment 1 strayan 2013-11-28 14:52:26 UTC
Also note, when you search the internet - several folks are facing this issue but not clear what solution works.
Comment 2 strayan 2013-11-28 14:55:26 UTC
Also check the bug https://netbeans.org/bugzilla/show_bug.cgi?id=235220
Comment 3 strayan 2013-11-28 15:00:35 UTC
I added new datasource from the Projects like mentioned in the below
Comment 5 Sergey Petrov 2013-11-28 15:07:31 UTC
if it's server deployment error, main issue should be somewhere in ds creation, in case if it was created with nb, it should be deployed, otherwise error is expected.
It's not clear what actions "I added new datasource from the Projects like mentioned in the below" are behind this. I need steps how ds was created.
Comment 6 strayan 2013-11-28 15:16:49 UTC
Refer to attached bitmap, showing how datasource was created - which auto created persistence.xml in "other sources/src/main/resources/META-INF" and glassfishserver-resoruces.xml in "other sources/setup". Only change I made was adding app scope (java:app) to JNDI-Name in  glassfishserver-resoruces.xml, if I don't do that was getting someother error.
Comment 7 strayan 2013-11-28 15:17:36 UTC
Created attachment 142685 [details]
Datasource Creations
Comment 8 Sergey Petrov 2013-11-28 15:20:09 UTC
I see jdbc connections usage in attached screenshot, there are no traces of and ds creation.
Comment 9 strayan 2013-11-28 15:23:11 UTC
I can re-create the DS and get the traces. Please let me know if you need NB or Glasfish server logs/traces - also location of logs/traces  files.
Comment 10 Sergey Petrov 2013-11-28 15:35:01 UTC
So far, only steps to create ds are required, including project type, server selection.
Comment 11 strayan 2013-11-28 16:10:39 UTC
Created attachment 142691 [details]
All the requested logs
Comment 12 strayan 2013-11-28 16:11:41 UTC
Server is Glassfish 4.0 and Java EE 7
Comment 13 Sergey Petrov 2013-11-28 16:19:06 UTC
not logs was requested. but I see glassfish.xml is present and it should be deployed and ds should be created on server side, but persistence.xml use happyhourDB 
when server.log have failure on happyhourDB_pm ds, I don't understand why _pm is added. can you provide complete project sample?
Comment 14 Sergey Petrov 2013-11-28 16:22:26 UTC
from what I see, there is no issue on netbeans side as all nb configuration is with happyhourDB and gf search for wrong resource, it may be either an issue in gf or in gf configuration. If you see there is an issue in nb, can you say what should be fixed/changed in this case?
Comment 15 strayan 2013-11-28 16:31:14 UTC
Created attachment 142695 [details]
Attaching the project
Comment 16 strayan 2013-11-28 16:32:10 UTC
Attached the project, please check if it is Java resource
Comment 17 zebhed 2013-12-15 10:07:28 UTC
Ich have the same problem or at leadt a similar problem. This stackoverflow thread describes it exactly:

http://stackoverflow.com/questions/18647551/netbeans-ant-script-creates-a-persistence-xml-if-it-is-missing
Comment 18 Sergey Petrov 2013-12-16 05:04:28 UTC
last one reference is for ant project when intial one is fo maven, it should be different.
also I don't see a problem on stack... as it copy already existent persistence.xml to build project if it wasn't copied sopmehow else, statement regarding "create" is wrong.
Comment 19 Sergey Petrov 2013-12-16 12:42:07 UTC
regarding intial problem, I see some references after web search with similar problems, and for some it's related to some server configuration problems, in this case nb may not do anything/
Comment 20 Sergey Petrov 2013-12-26 14:26:11 UTC
sorry, still have no ideas what is wrong with nb, do you have mysql driver configured properly for gf installation?
Comment 21 ahum 2015-01-04 14:01:50 UTC
I have a similar problem, but *only* when executing a unit test within the project.

Product Version: NetBeans IDE 8.0.2 (Build 201411181905)
Java: 1.7.0_71; Java HotSpot(TM) Client VM 24.71-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_71-b14
System: Windows 7 version 6.1 running on x86; Cp1252; en_US (nb)
User directory: C:\Users\Pierre\AppData\Roaming\NetBeans\8.0.2
Cache directory: C:\Users\Pierre\AppData\Local\NetBeans\Cache\8.0.2

Using Glasfishserver 4.1 and Derby and Apache Derby 10.8.3.2 - (1557835)



jan 04, 2015 1:00:37 PM org.glassfish.deployment.admin.DeployCommand execute
SEVERE: Exception while preparing the app : Invalid resource : jdbc/LADLM__pm
com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Invalid resource : jdbc/LADLM__pm
	at org.glassfish.jdbcruntime.service.JdbcDataSource.validateResource(JdbcDataSource.java:81)
	at org.glassfish.jdbcruntime.service.JdbcDataSource.setResourceInfo(JdbcDataSource.java:62)
	at org.glassfish.jdbcruntime.JdbcRuntimeExtension.lookupDataSourceInDAS(JdbcRuntimeExtension.java:136)
	at com.sun.enterprise.connectors.ConnectorRuntime.lookupDataSourceInDAS(ConnectorRuntime.java:589)
	at com.sun.enterprise.connectors.ConnectorRuntime.lookupPMResource(ConnectorRuntime.java:517)
	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:142)
	at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:107)
	at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223)
	at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510)
	at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230)
	at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:925)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:434)
	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.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
	at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:109)
	at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:138)
	at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:134)
	at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:127)
	at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:102)
	at Services.ArtiestFacadeRESTTest.testEdit_GenericType(ArtiestFacadeRESTTest.java:50)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.apache.tools.ant.taskdefs.optional.junit.JUnit4TestMethodAdapter.run(JUnit4TestMethodAdapter.java:105)
	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:532)
	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1179)
	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:1030)

jan 04, 2015 1:00:43 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl createEJBContainer
INFO: [EJBContainerProviderImpl] Cleaning up on failure ...
jan 04, 2015 1:00:43 PM org.glassfish.admin.mbeanserver.JMXStartupService shutdown
INFO: JMXStartupService and JMXConnectors have been shut down.
jan 04, 2015 1:00:43 PM org.glassfish.admin.mbeanserver.JMXStartupService shutdown
INFO: JMXStartupService and JMXConnectors have been shut down.
jan 04, 2015 1:00:43 PM com.sun.enterprise.v3.server.AppServerStartup stop
INFO: Shutdown procedure finished
Comment 22 maxy04 2015-02-11 18:35:04 UTC
I also have this problem.
i "solved" in this way:
renamed the datasource and the jdbc connection in glassfish 

__datasourcename


the same datasource but with two underscore.

it works, but it's ridicolous.