I agree absolutely with the glassfish logs, that jdbc/legacy__pm
is an invalid resource. There's no mention of such a file, or even that text, anywhere within the Enterprise project nor its modules. There is, however, a jdbc/legacy
resource. The reason Netbeans fails to deploy the project is less clear to me.
the EJB module's glassfish-resources.xml
file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="mysql_legacy_jdbcPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
<property name="serverName" value="localhost"/>
<property name="portNumber" value="3306"/>
<property name="databaseName" value="legacy"/>
<property name="User" value="jdbc"/>
<property name="Password" value="password"/>
<property name="URL" value="jdbc:mysql://localhost:3306/legacy?zeroDateTimeBehavior=convertToNull"/>
<property name="driverClass" value="com.mysql.jdbc.Driver"/>
</jdbc-connection-pool>
<jdbc-resource enabled="true" jndi-name="jdbc/legacy" object-type="user" pool-name="mysql_legacy_jdbcPool"/>
</resources>
the EJB module's persitence.xml
file:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="EnterpriseLegacyJDBC-ejbPU" transaction-type="JTA">
<jta-data-source>jdbc/legacy</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties/>
</persistence-unit>
</persistence>
The enterprise application builds as an EAR correctly:
post-compile:
compile:
pre-dist:
do-dist-without-manifest:
Skipped because property 'has.custom.manifest' set.
do-dist-with-manifest:
Setting project property: dist.jar.dir -> /home/thufir/NetBeansProjects/EnterpriseLegacyJDBC/dist
Created dir: /home/thufir/NetBeansProjects/EnterpriseLegacyJDBC/dist
fileset: Setup scanner in dir /home/thufir/NetBeansProjects/EnterpriseLegacyJDBC/build with patternSet{ includes: [] excludes: [] }
Building jar: /home/thufir/NetBeansProjects/EnterpriseLegacyJDBC/dist/EnterpriseLegacyJDBC.ear
adding directory META-INF/
adding entry META-INF/MANIFEST.MF
adding directory lib/
adding entry EnterpriseLegacyJDBC-ejb.jar
adding entry EnterpriseLegacyJDBC-war.war
adding entry lib/RemoteEJB.jar
adding entry lib/javaee-web-api-7.0.jar
No Implementation-Title set.No Implementation-Version set.No Implementation-Vendor set.
Location: /home/thufir/NetBeansProjects/EnterpriseLegacyJDBC/nbproject/build-impl.xml:249:
post-dist:
dist:
BUILD SUCCESSFUL (total time: 19 seconds)
with the following structure:
thufir@dur:~$
thufir@dur:~$ jar -tf NetBeansProjects/EnterpriseLegacyJDBC/dist/EnterpriseLegacyJDBC.ear
META-INF/
META-INF/MANIFEST.MF
lib/
EnterpriseLegacyJDBC-ejb.jar
EnterpriseLegacyJDBC-war.war
lib/RemoteEJB.jar
lib/javaee-web-api-7.0.jar
thufir@dur:~$
I would like to deploy this manually, but don't quite know where to put the RemoteEJB
JAR file.