On Oct 2, 2004, at 5:34 PM, Aaron Mulder wrote:
The example I'm looking at has a couple of MBeans --
GBeans
two thread pool timers. Do those need to be in there? What are they?
They should be deployed once in the server, they are used in ejb timers.
It also has
dependencies on some commons libs with some kind of substitution variables
for the version numbers. Do I need the dependencies, and if so I guess I
need to put in the actual version numbers -- they're interpreted by Ant of
Maven at build time, not by Geronimo at deployment time, right?
These are the driver jar and the jars needed by the driver. That way you can use the tranql jca-jdbc adapter without repacking it for your driver. Use the actual version numbers unless you modify assembly to deploy your plan:-). I recommend using maven to deploy your plan, in which case you can use a <repository>true</repository> property to get maven/geronimo-maven-plugin to put the dependencies in the geronimo repo for you. (hope I remembered the tag name correctly)
Also, I would have thought the jetty DD needed namespaces on the
resource-env-ref elements, since the jetty stuff is from a geronimo jetty
namespace and the resource-env-ref stuff is from a geronimo naming
namespace. Am I wrong about that?
too many meanings for namespace:-). You can put the xml namespace in your plan if you want (I think) but there is some magic xml manipulation going on behind the scenes so you don't need to: it gets converted on the fly to the correct namespace.
yes. As I mentioned above, I like to use maven for this.
Finally, in order to use a different vendor's JDBC driver, do I
need to put the JAR in the repository/ directory and add a dependency to
the geronimo-ra.xml?
We don't use a global jndi namespace internally. The ger: namespace is there only for people who won't follow the j2ee instructions:-) which clearly state that you can only look up stuff in java:comp/env from within a j2ee component. Stuff that goes into the java:comp/env context does not refer to anything in any other jndi binding or context. My reading of the spec is that resource-env-ref can only refer to jms queues or topics, now a subset of what message-destination-refs can refer to. In any case, right now, if you want to get a datasource, you need to use a resource-ref.
Oh, and in response to David J, I thought a resource-env-ref was
used to refer to anything that was already in the server's JNDI space.
Since deploying the RA should put the DB pool in the JNDI space, I think I
can use a resource-env-ref in the WAR to map the global DB pool entry to a
local java:comp/env location. I though resource-refs were only necessary
for things that weren't already present in the server's global JNDI space
somewhere.
<from other email>
Also, should target-name be the "name" of the
"connectiondefinition-instance", or the "global-jndi-name", or the
"configId" of the connector, or what?
the "name" of the connectiondefinition-instance
thanks david jencks
Thanks, Aaron
On Sat, 2 Oct 2004, Jeremy Boynes wrote:There is an example system-database-plan.xml that defines a DataSource for accessing the embedded Derby database. This uses the generic JDBC connector from TranQL and can be adapted to other vendor's drivers as needed. You use the same RAR file, just different deployment plans.
To access from a web app you need a <resource-ref> not a <resource-env-ref> - the Jetty plan looks like:
<web-app xmlns="http://geronimo.apache.org/xml/ns/web/jetty" configId="my_wars_config_id">
<context-priority-classloader>false</context-priority-classloader> <resource-ref> <ref-name>jdbc/myDB</ref-name> <target-name>myDatasource</target-name> </resource-ref> </web-app>
where <target-name> is the name of your datasource.
If you don't want an additional RAR config, I think you can actually
embed its plan inside your geronimo-jetty.xml definition. Basically copy
the <resource> element from the RAR plan and put it at the end of your
web-app element (I know this works for app-clients).
-- Jeremy
