![]() |
![]() |
|
| Index | Recent Threads | Unanswered Threads | Who's Online | User List | Help |
|
|
| No member browsing this thread |
|
Thread Status: Active Total posts in this thread: 10
|
|
| Author |
|
|
Newbie Joined: May 17, 2006 Post Count: 16 Status: Offline |
Hello, has anyone had any luck integrating the JPOX RAR with Glassfish and could post their experience? I've been running into some problems but managed to solve them with the help of the documentation and this forum. But now I'm stuck and have no clue how to proceed. I would really appreciate any comments / pointers / etc. I am trying to use JPOX 1.1.0 integrated via JCA with Glassfish (build 48) and Derby. I have EJB 3.0 session beans running with CMT, accessing the JPOX-provided PMF through JNDI look-up. My ra.xml file inside the RAR has the following transaction setting: <resourceadapter>(I do need XA transactions.) I heave learned that when JPOX is used with XA transactions, it needs two data source connections: one supporting XA transactions and the other supporting non-XA transactions. So I configure my "Connector Connection Pool" with these two properties (and nothing more): ConnectionFactoryName = myXaDsNameThe first JNDI name is bound to a org.apache.derby.jdbc.EmbeddedXADataSource type data source, the other type is org.apache.derby.jdbc.EmbeddedDataSource. The problem is that every time a transaction involving some operations on the PersistenceManager is to be commited I get a mysterious NoSuchElementException. The following stack trace is a result of calling a simplistic business method that does nothing more than call PersistenceManager's getObjectById() (please ignore the method names in the motoforge.domain.logic package -- they are currently meaningless). JTS5067: Unexpected error occurred in commitAny thoughts? Thanks in advance! Wojtek ---------------------------------------- [Edit 1 times, last edit by wojtek at May 17, 2006 6:29:19 PM] |
||
|
|
Expert Belgium Joined: Mar 12, 2004 Post Count: 3114 Status: Offline |
never tried. raise a task request to certify JPOX JCA compatibility with Glassfish ---------------------------------------- Erik Bengtson ![]() |
||
|
|
Newbie Joined: May 17, 2006 Post Count: 16 Status: Offline |
Erik, thanks for your response! never tried. raise a task request to certify JPOX JCA compatibility with Glassfish I must admit you're kinda scaring me here. So I may be the first to try this combination...? :) Well anyway, in the meantime I continued with my experiments and the most recent discovery is that things seem to work fine (well, almost) if I do not close the PersistenceManager before the transaction is committed. So in the following flow:
If I do skip it, I easily get You are trying to get the PersistenceManager for an object when it is associated with X PersistenceManager(s)!Any suggestions? If you don't mind, I will refrain from raising a task request to certify JPOX JCA compatibility with Glassfish until I'm more convinced that I'm not doing some fundamentally wrong here. Wojtek |
||
|
|
Newbie Joined: May 17, 2006 Post Count: 16 Status: Offline |
Well, the flow described above is what I've always seen in examples showing how JDO is used in a JEE environment. Now I have also checked the JDO spec and section 16.1.1 seems to confirm that pm.close() should indeed be called: At the end of the business method, the PersistenceManager instance must be closed. This allows the transaction completion code in the PersistenceManager to free the instance and return it to the available pool in the PersistenceManagerFactory. I actually came across another problem. Unfortunately I cannot say if it appears in application servers other than Glassfish. The problem is with including certain plugins in the RAR. I tried the Java5 plugin and couldn't get it to map Enums the way it was supposed to. What I found out is that Glassfish unpacks all the JARs contained in the RAR into one location. If the contents of the JARs overlap, things get overwritten. In this case, the contents of the META-INF/plugins directory provided by JPOX core and the plugin, which -- if I understand correctly -- are normally somehow "merged" at runtime, overwrote one another. I managed to achieve my goal by manually merging the datastoremapping.xml and jpoxtypes.xml files from the core and the plugin JARs, but it shouldn't work this way, should it? Is this also an issue subject to Glassfish compatibility certification? Other than that, the deeper I dig into JPOX, the more impressed I am. Good work! Wojtek |
||
|
|
Expert Belgium Joined: Mar 12, 2004 Post Count: 3114 Status: Offline |
For the unpacking thing raise the issue to the Glassfish project. For the closing issue, I suggest you to disable reachability at commit as workaround. Anyway, if you dont need reachability at commit, you should always disable it to improve performance. ---------------------------------------- Erik Bengtson ![]() |
||
|
|
Newbie Joined: May 23, 2006 Post Count: 1 Status: Offline |
Hi I actually came across another problem. Unfortunately I cannot say if it appears in application servers other than Glassfish. The problem is with including certain plugins in the RAR. ... What I found out is that Glassfish unpacks all the JARs contained in the RAR into one location. If the contents of the JARs overlap, things get overwritten. Are you referring to the case when a RAR has foo.jar and bar.jar, deployment of the connector module explodes the RAR and its constituent jars into ${domaindir}/applications/j2ee-modules/${rarname} causes common classes (ie common fully qualified class names) in foo and bar to be overwritten? If yes,this is how they behave in GlassFish by design. If I have misunderstood this issue, please send a mail to to the users mailing list at GlassFish [users@glassfish.dev.java.net] and/or raise an issue and we would be glad to understand this better. Thanks --Siva. GlassFish Team |
||
|
|
Newbie Joined: May 17, 2006 Post Count: 16 Status: Offline |
Hallo, Are you referring to the case when a RAR has foo.jar and bar.jar, deployment of the connector module explodes the RAR and its constituent jars into ${domaindir}/applications/j2ee-modules/${rarname} causes common classes (ie common fully qualified class names) in foo and bar to be overwritten? Yes, this is precisely what I meant. Except in this case it is not really classes that are overwritten, but the META-INF/plugins/datastoremapping.xml and META-INF/plugins/jpoxtypes.xml files provided by both the JPOX core and the Java5 plugin JARs. If yes,this is how they behave in GlassFish by design. So this probably means that changing it is out of the question. Erik, any chance for plugin "registration" to be changed in JPOX? Wojtek |
||
|
|
Expert Belgium Joined: Mar 12, 2004 Post Count: 3114 Status: Offline |
we can provide a pmf setting where you set the location of the files separated by a comma. However, the way glassfish is handling the deployment, at runtime, will consume too many operating system file descriptors which can cause errors. When the application server use a compressed file like a rar, instead of expanding it, only one file descriptor is used. If you don't have file descriptors available, the JVM can crash, other processes running on the same machine can also crash, and other problems can pop up. If the JVM crashes and no file descriptors are available, you even dont get a core dump of the JVM. ---------------------------------------- Erik Bengtson ![]() |
||
|
|
Newbie Joined: May 17, 2006 Post Count: 16 Status: Offline |
Hi Erik, For the closing issue, I suggest you to disable reachability at commit as workaround. Anyway, if you dont need reachability at commit, you should always disable it to improve performance. I tried: PersistenceByReachabilityAtCommit=falseINFO [JPOX.JDO] - <You are trying to get the PersistenceManager for an object when it is associated with 0 PersistenceManager(s)!>Wojtek |
||
|
|
Newbie Joined: May 17, 2006 Post Count: 16 Status: Offline |
Hello again, I've noticed something new here. The behavior with the inability to properly close a PM is occurring if the PMF is obtained by the stateless session beans in the following way: protected PersistenceManagerFactory pmf;@Resource(mappedName="jdo/pmf")[#|2006-06-20T10:40:04.914+0200|INFO|sun-appserver-pe9.0|javax.enterprise.resource.resourceadapterjavax.ejb.TransactionRolledbackLocalException: Exception thrown from bean;This leads me to suspect that maybe there's something wrong with my deployment? Does anyone have any ideas? Thanks, Wojtek |
||
|
|
|
|
|
Current timezone is GMT Sep 3, 2010 4:41:17 PM |