Dienstag, 1. Dezember 2015

GlassFish glassfish-resources.xml

---There are currently problems with posting xml or html--- I had a lot of trouble to create jdbc resources and connection pools via glassfish-resources.xml, but finally it works! The method to config the GlassFish application server within your webapp is much better than via the console oder admin gui.
glassfish-resources.xml:



    
        
        
        
        
        
        
        
        
        
    
    



persistence.xml:
org.eclipse.persistence.jpa.PersistenceProvider java:app/jdbc/WebApp classes true

Place the glassfish-resources.xml in the WEB-INF (not META-INF!) folder. Only this configuration worked for me. I tried almost every combination and read through all the forums and posts. I had the following error when it didn't work:
org.glassfish.deployment.common.DeploymentException: Invalid resource : { ResourceInfo : (jndiName=java:app/jdbc/WebApp__pm), (applicationName=repro-ear) } at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:166)
It worked for me with NetBeans8.1, GlassFish 4.0 and PostreSQL 9.3.

Keine Kommentare:

Kommentar veröffentlichen