[JBoss JIRA] Created: (EJBTHREE-1029) Invoke remote EJB3 from JVM 1.4 client
by Boris Maras (JIRA)
Invoke remote EJB3 from JVM 1.4 client
--------------------------------------
Key: EJBTHREE-1029
URL: http://jira.jboss.com/jira/browse/EJBTHREE-1029
Project: EJB 3.0
Issue Type: Patch
Environment: Server : JDK 1.5.0_10, JBoss 4.0.3SP1 + EJB3 jars (RC6), EJB 3 Session Stateless
Client : JDK 1.4.2
Reporter: Boris Maras
Natively, you cannot use a JVM 1.4 client to call JBoss EJB3. This is because the jboss-ejb3.jar is compiled with JDK 1.5 : using it in a 1.4 JVM gives errors on major/minor version.
So I used jbossretro to convert this jar in jdk 1.4 compatible format.
That gave me a jar that works in my jvm 1.4 client (see attached file, to be used with JBoss 4.0.3SP1 + EJB3 RC6)
In order to use it, you also need to create a client jar for your EJBs, compiled with a 1.4 target. At compile time, you'll probably need to remove some annotations (@Local, @Remote etc). Thus, you need on the client side :
- the client jar for your EJBs
- the generated jboss-ejb3-client14.jar
- jbossretro-rt.jar
- jboss-backport-concurrent.jar
- javassist.jar
I tested that on JBoss 4.0.3SP1+EJB3 RC6, with Session Stateless Beans only.
I attach a patch for the current version of ejb3/build.xml, that generates the jboss-ejb3-client14.jar for the current version. I could not test this version, because I only use JBoss 4.0.3SP1, that doesn't support it.
I also attach the jboss-ejb3-client14.jar that works with EJB3 RC6 and JBoss 4.0.3SP1. I generated it with another ant script (also attached), that does this :
- uncompress the file jboss-ejb3.jar
- delete all files that are not included in jboss-ejb3-client.jar (based on the list of current ejb3/build.xml)
- run jbossretro on the classes, using the jboss 4.0.3SP1 libraries on the classpath
- recompress the jar
This ant script should probably let you convert the jar of other versions of JBoss & EJB3.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 10 months
[JBoss JIRA] Created: (EJBTHREE-1005) TxPropagationInterceptor requires use of IsLocalInterceptor
by Brian Stansberry (JIRA)
TxPropagationInterceptor requires use of IsLocalInterceptor
-----------------------------------------------------------
Key: EJBTHREE-1005
URL: http://jira.jboss.com/jira/browse/EJBTHREE-1005
Project: EJB 3.0
Issue Type: Bug
Affects Versions: AS 4.2.0 GA
Reporter: Brian Stansberry
Assigned To: Brian Stansberry
Priority: Minor
The TxPropagationInterceptor will fail if a tx is running and a call to a local bean is not routed through IsLocalInterceptor.invokeLocal(). This means the IsLocalInterceptor.invokeLocal() routing can't be effectively disabled, which is a user request that comes up fairly often for EJB2. Users request this when they want the EJB requests load balanced, with no preference for the in-VM bean.
The same thing isn't a problem in EJB2, where transaction propagation is a function of the Invoker; the LocalInvoker just doesn't do it. But EJB3 doesn't have that option -- Remoting will bypass any invoker if it detects an in-VM target.
Couple possibilities:
1) Change TxPropagationInterceptor from:
Transaction tx = tm.getTransaction();
if (tx != null) throw new RuntimeException("cannot import a transaction context when a transaction is already associated with the thread");
Transaction importedTx = TransactionPropagationContextUtil.getTPCImporter().importTransactionPropagationContext(tpc);
tm.resume(importedTx);
to:
Transaction tx = tm.getTransaction();
Transaction importedTx = TransactionPropagationContextUtil.getTPCImporter().importTransactionPropagationContext(tpc);
if (tx != null)
{
if (tx != importedTx)
{
throw new RuntimeException("cannot import a transaction context when a transaction is already associated with the thread");
}
else
{
tm.resume(importedTx);
}
2) Have IsLocalInterceptor add some transient metadata to the invocation if it doesn't route the request via invokeLocal() -- i.e. if it expects the call is going remote. TxPropagationInterceptor can check for that metadata; if found it knows the call didn't actually go remote and can skip the import of the tx.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 10 months
[JBoss JIRA] Created: (EJBTHREE-862) EJB 3.0 dependencies injection accross EARs
by Roland R?z (JIRA)
EJB 3.0 dependencies injection accross EARs
-------------------------------------------
Key: EJBTHREE-862
URL: http://jira.jboss.com/jira/browse/EJBTHREE-862
Project: EJB 3.0
Issue Type: Bug
Components: EJB3 Extensions
Affects Versions: EJB 3.0 RC9 - Patch 1
Environment: Windows, JDK 1.5.0_06-b05, JBoss 4.0.5 GA, EJB-3.0_RC9 Patch 1
Reporter: Roland R?z
We have a deployment schema similar to the example from EJB 3.0 specification (chapter 19.6 Example):
ear1:
FirstReferencer.jar Class-Path:FirstReferencer-client.jar SecondReferencer-client.jar
FirstReferencer-client.jar
SecondReferencer-client.jar
ear2:
SecondReferencer.jar Class-Path:SecondReferencer-client.jar
SecondReferencer-client.jar
deployment descriptor contains:
<ejb-client-jar>SecondReferencer-client.jar</ejb-client-jar>
There are two session beans FirstReferencer and SecondReferencer. FirstReferencer references SecondReferencer over the dependency injection. After deployment if we call the business method on the FirstReferencer, which in turn calls SecondReferencer we get exception like this:
16:22:12,155 ERROR [STDERR] java.lang.RuntimeException: Non matching type for inject of field: SecondReferencer FirstReferencerEjb.secondReferencer for type: $Proxy79 of jndiName env/FirstReferencerEjb/secondReferencer
intfs: , SecondReferencer, org.jboss.ejb3.JBossProxy, javax.ejb.EJBObject
16:22:12,155 ERROR [STDERR] at org.jboss.injection.JndiFieldInjector.inject(JndiFieldInjector.java:135)
16:22:12,155 ERROR [STDERR] at org.jboss.injection.JndiFieldInjector.inject(JndiFieldInjector.java:104)
16:22:12,155 ERROR [STDERR] at org.jboss.injection.JndiFieldInjector.inject(JndiFieldInjector.java:61)
16:22:12,155 ERROR [STDERR] at org.jboss.ejb3.AbstractPool.create(AbstractPool.java:92)
16:22:12,155 ERROR [STDERR] at org.jboss.ejb3.ThreadlocalPool.get(ThreadlocalPool.java:48)
16:22:12,165 ERROR [STDERR] at org.jboss.ejb3.cache.simple.SimpleStatefulCache.create(SimpleStatefulCache.java:209)
16:22:12,165 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulContainer.dynamicInvoke(StatefulContainer.java:303)
16:22:12,165 ERROR [STDERR] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
16:22:12,165 ERROR [STDERR] at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
16:22:12,175 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828)
16:22:12,175 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681)
16:22:12,175 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358)
16:22:12,175 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:412)
16:22:12,175 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
16:22:12,185 ERROR [STDERR] Caused by: java.lang.IllegalArgumentException
16:22:12,185 ERROR [STDERR] at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
16:22:12,185 ERROR [STDERR] at java.lang.reflect.Field.set(Field.java:656)
16:22:12,185 ERROR [STDERR] at org.jboss.injection.JndiFieldInjector.inject(JndiFieldInjector.java:119)
16:22:12,185 ERROR [STDERR] ... 13 more
On debuging and from the stacktrace of the exception we can see that the lookup for refernced EJB works fine but the assigning over reflaction fails. It seems to be a ClassLoading issue there.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 10 months
[JBoss JIRA] Created: (JBAS-5049) NoInitialContextException on deployment of EAR that contains MDB and persistence.xml
by Alan Feng (JIRA)
NoInitialContextException on deployment of EAR that contains MDB and persistence.xml
------------------------------------------------------------------------------------
Key: JBAS-5049
URL: http://jira.jboss.com/jira/browse/JBAS-5049
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Deployment services, EJB3
Affects Versions: JBossAS-4.2.2.GA
Environment: Windows XP SP2, JDK1.5.0_09, JBoss AS-4.2.2.GA, SEAM 2.0.0.GA
Reporter: Alan Feng
Assigned To: Dimitris Andreadis
When deploy an EAR that contains EJB3 MDB, you may receive NoInitialContextException on the deployment of other EJB3 elements. In my particular case, I have a persistence.xml file that configures the EntityManager. The deployment of this persistence.xml throws the NoInitialContextException. Depending on the contents of the EAR, it may be other deployment unit that is throwing this exception.
Tracing into the deployment code shows that the problem is with the latest code change in the org.jboss.ejb3.EJBContainer class. This class has method named getInitialContext(). In the previous release it returns a newly constructed InitialConext object. In the 4.2.2.GA, it returns the shared static InitialContext object from the InitialContextFactory class. The MDB deployer class org.jboss.ejb3.mdb.MessagingContainer.getJMSProviderAdapter() method calls this method to obtain a InitialContext object and closes this InitialContext object after using it. This results in that the shared InitialContext object been closed prematurely as it is used later on to deploy other EJB3 units, such as the persistence.xml file in my case.
Suggested fix:
Change the org.jboss.ejb3.mdb.MessagingContainer.getJMSProviderAdapter() method as follows:
Change the line (around line # 586):
Context context = getInitialContext();
to:
Context context = initialContextProperties == null ? new InitialContext() : new InitialContext(initialContextProperties);
The above suggested change is copied from the previous implementation of the EJBContainer.getInitialContext() method.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 10 months