Thanks so much for all your efforts so far - alas its still not going
smoothly! Although I copied mysql-connector-java-3.1.12-bin.jar to
$openejb_home/lib I'm getting:
FATAL: OpenEJB has encountered a fatal error and cannot be started:
Assembler failed to build the container system.
org.openejb.OpenEJBException: Cannot load the container Default CMP
Container. Received message: Unable to construct the Castor JDOManager
objects: org.exolab.castor.mapping.MappingException: The persistence
engine mysql is not supported in this Castor configuration: The
persistence engine mysql is not supported in this Castor configuration
at
org.openejb.alt.assembler.classic.ContainerBuilder.buildContainer(ContainerBuilder.java:177)
...
I've put mappings under webapps/EJB/META-INF/cmp.mapping.xml; removed the
global/local TX*.xml files; and my openejb.conf now looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<openejb
xmlns="http://www.openejb.org/System/Configuration">
<Container
id="Default CMP Container" ctype="CMP_ENTITY">
# The default size of the method ready bean pools.
# Every bean class gets its own pool of this size.
PoolSize 100
Engine mysql
ConnectorName Default JDBC Database
# Driver class name
JdbcDriver com.mysql.jdbc.Driver
# Url for creating connections
JdbcUrl jdbc:mysql://localhost:3306/edushop
# Default user name
UserName www-data
# Default password
Password removed
</Container>
<Container id="Default BMP Container" ctype="BMP_ENTITY">
... Stateless / statefull / bmp containers removed for email ...
</Container>
<Connector id="Default JDBC Database">
JdbcDriver com.mysql.jdbc.Driver
JdbcUrl jdbc:mysql://localhost:3306/edushop
UserName www-data
Password removed
</Connector>
<Deployments dir="beans/"/>
<Deployments jar="/usr/local/apache-tomcat/webapps/EJB/ejb.jar"/>
</openejb>
Am I doing anything really stupid somewhere?
As a small aside the new Latest Unstable (openejb-1.1-20060411.tar.gz)
seems to be missing openejb_home/logs - needs a simple mkdir & touch
foo.log
Kind Regards, Jason
>
> On Apr 11, 2006, at 6:18 AM, Jason Woollard wrote:
>
>> Hi,
>>
>> Thanks to David and Bruce for their replies - you were right that
>> changing
>> to the castor-1.0.jar fixed the error message. However I'm still
>> having
>> troubles with my application now producing:
>>
>> INFO : OpenEJB ready.
>> FATAL: Castor JDO initialization failed: null
>> java.lang.NullPointerException
>> at
>> org.exolab.castor.jdo.transactionmanager.TransactionManagerRegistry.ge
>> tTransactionManager(TransactionManagerRegistry.java:77)
>>
> [...]
>> in openejb.log. I'm not sure if this list is the best place to ask for
>> help, but if anyone could offer an opinion as to what is causing
>> this or
>> suggest a better place to ask I would be very gratefull - I'm
>> running out
>> of time for this job!
>>
>
> My guess is that your local/global tx database files are setup
> wrong. I can't blame you as those things are less than intuitive,
> which is why I yanked the need for them in the 3.x branch. That
> said, I went ahead and backported that feature to the 1.x branch and
> whipped up an unstable release for you which also includes Castor 1.0:
>
> openejb-1.1-20060411
> http://www.openejb.org/Latest+Unstable
>
> That basically contains these three fixes:
> OPENEJB-138: Upgrade to Castor 1.0
> OPENEJB-137: Allow Castor cmp mapping files to be in the ejb jar
> archive
> OPENEJB-136: Remove need for Castor local and global tx database
> files
>
>
> Here is how you deal with the slight change:
>
>
> 1. Edit the your openejb.conf/xml file
>
> Add these properties to your CMP container definition:
>
> <Container id="Default CMP Container" ctype="CMP_ENTITY">
> PoolSize 100
> Engine instantdb
> ConnectorName Default JDBC Database
> JdbcDriver org.enhydra.instantdb.jdbc.idbDriver
> JdbcUrl jdbc:idb:conf/instantdb.properties
> UserName Admin
> Password pass
> </Container>
>
> The "Engine" property is the same as what would have been in your
> Castor JDO database xml files. We will build those for you at
> startup, so we still need that.
>
> The "ConnectorName" property is the name of which ever Connector
> definition you wish to use for CMP Container. We're actually going
> to use that when your CMP bean requires that it participate in any
> JTA transactions (aka. global transactions).
>
> The other four properties (JdbcDriver, JdbcUrl, UserName, Password)
> you can copy straight from the Connector definition. It'd be nice if
> we did that for you, but the config data for a Connector is not
> available to a Container so we'll have to work on that in the
> future. This information is going to be used to establish direct
> connections to the database when your CMP bean does not want to
> participate in any JTA transactions (global transactions) -- in this
> situation we start a local transaction that isn't XA enabled that
> just your CMP participates in.
>
> 2. Delete your old foo.database.xml files
>
> 3. Move your cmp mapping.xml file
>
> The cmp mapping.xml must be in your ejb jar archive at "META-INF/
> cmp.mapping.xml"
>
>
> That's it.
>
> Let us know how it goes.
>
> -David
>
>