I'm working on the integration of IronJacamar (1.0.0.Beta3) with Glassfish (2.1.1).
The problem I get even if I try to configure the naming.xml file in order to use the local JNDI context
Well, Glassfish already has a naming implementation active - so you need to use that. For that you need to install a bean called "NamingServer" -- by basically replacing ironjacamar-embedded.jar/naming.xml with your own. That bean needs to make sure that the naming environment is initialized.
You can use "new EmbeddedJCA(false)" to boot a clean environment and then deploy each XML file. See which XML files inside the JAR.
There is some documentation here http://jesperpedersen.github.com/fungal/userguide/en/html/lifecycle.html
And some examples here: http://jesperpedersen.github.com/fungal/userguide/en/html/examples.html
And when I specify a xxxxx-ra.xml with a jndi-name property in the connection-definition attribute, I get a NotSerializableException from CachedConnectionManager.
Two things -- 1) Did your resource adapter deploy without problems when using the standalone distribution -- e.g. no archive validation errors / warnings ?
2) Can you post the full stack trace for that exception ? I need to see the root cause before I fix it
Thanks, and HTH !
Thanks for your help. I used "new EmbeddedJCA(false)" to boot a clean environment, and deployed the following XML files: transaction.xml, stdio.xml, jca.xml.
I didn't deploy the naming.xml and comment all the dependencies to the "NamingServer" bean in each of these XML files.
I assume IronJacamar (IJ) can find the local naming environment (the Glassfish one), cause I could see the bindings of the different tx beans (UserTransaction, TransactionPropagationContextImporter, TransactionPropagationContextExporter, TransactionSynchronizationRegistry, TransactionManager) in the JNDI tree.
I still get the NotSerializableException from org.jboss.jca.core.connectionmanager.ccm.CachedConnectionManager (@see the stack at the end of this post).
I don't get any error at archive validation (I changed the BeanValidation namespace in order to prevent NamingException with java:comp namespace modification). I only get a warning when I use IJ in standalone, but the deployment is OK. I could browse the IJ administration console, and view my connection factory and its different configuration properties.
Below the initialization of the JCA container:
embeddedJca = new EmbeddedJCA(false);
RAActivator raa = embeddedJca.lookup("RAActivator", RAActivator.class);
if (null == raa) throw new IllegalStateException("RAActivator not defined");
Content of my-ra.xml:
<?xml version="1.0" encoding="UTF-8"?>
<connection-definition jndi-name="eis/MyArchive" use-java-context="false" enabled="true" class-name="com.xxx.MCF">
Thanks for your help.
Caused by: java.lang.RuntimeException: com.github.fungal.spi.deployers.DeployException: Deployment file:/.../my-ra.xml failed
Caused by: com.github.fungal.spi.deployers.DeployException: Deployment file:/.../application-ra.xml failed
... 72 more
Caused by: java.lang.RuntimeException: Cant copy Serializable object:
... 77 more
Caused by: java.io.NotSerializableException: org.jboss.jca.core.connectionmanager.ccm.CachedConnectionManager
... 85 more
I could see the bindings of the different tx beans (UserTransaction, TransactionPropagationContextImporter, TransactionPropagationContextExporter, TransactionSynchronizationRegistry, TransactionManager) in the JNDI tree
The transaction manager integration is special, since it implements a JBoss specific SPI that IronJacamar is using. But we can get back to that later.
I still get the NotSerializableException from org.jboss.jca.core.connectionmanager.ccm.CachedConnectionManager
Ah, yes - I see the problem - the Glassfish naming implementation is more strict
Any chance that you could checkut our code and create a patch ? You'll need to start from AbstractConnectionManager and work your way out.
There are some instructions here: http://docs.jboss.org/ironjacamar/developerguide/en/html/building.html
You could start by making a test case that tries to serialize the NoTxConnectionManager to a byte stream and read it in again.
Thanks for your help. Instead of working my way out, I got back to the standalone version in order to validate the solution with IronJacamar.
I could do a lookup on the "TransactionManager", but as you told me, its integration is special.
I can see in the logs that my connector is well deployed (ManagedConnectionFactory and so on...), but can't do a lookup on the factory.
I assume I can't do it the same way than the tx beans... I can browse it from the console. Is there a way to do it from JMX ? Do I have to configure something else ?
I got back to the standalone version in order to validate the solution with IronJacamar.
Ok - I have added https://jira.jboss.org/browse/JBJCA-477 to keep track of this (assigned to me atm). Let me know if you want to work on it
Is there a way to do it from JMX ? Do I have to configure something else ?
There is not official client application component model for standalone JCA. You can use the kernel model model (http://jesperpedersen.github.com/fungal/userguide/en/html/) or try if the web container integration is good enough for you.
Looking up your connection factories and admin objects should be done through JNDI as you normally would. See http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/RarTestCase.java?revision=109546&view=markup as an example.
And I have uploaded a new Maven snapshot to the repository - if you use Maven or Ivy. Note, that the embedded API has changed (for the better ).