Question

Environment

  • Grails 2.0.4
  • OC4j 10.1.3

Problem

I cannot deploy an grails war file when my config use jndi. I can assure that the datasource is created and avaliable in the OC4J looking in the "JNDI Browser" (administration of oc4j).

I've tried to deploy setting the "setParentDataSources" to true, to make the grails app inherit the datasources of the default app, but no success on this.

The exception is:

Cannot resolve reference to bean 'dataSourceUnproxied' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceUnproxied': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: java:comp/env/jdbc/pontomoduloweb not found in

So my question is: am I missing something? Can I somehow debug this more deeply?

Was it helpful?

Solution

After some fight with this, I found a configuration in OC4J that makes the datasource globally available for all apps deployed.

In $OC4J_HOME\j2ee\home\config\server.xml, change the application-server tag adding the option global-jndi-lookup-enabled:

<application-server  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/application-server-10_1.xsd"  application-directory="../applications"
 check-for-updates="adminClientOnly"
 deployment-directory="../application-deployments"
 connector-directory="../connectors"
 global-jndi-lookup-enabled="true"
 schema-major-version="10" schema-minor-version="0" >

And also don't forget to mark the option to look for classes in local classpath too.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top