[Design of EJB 3.0] - JNDI names with a leading /
by jaikiran
I have a fix for https://jira.jboss.org/jira/browse/EJBTHREE-1884 in which, i now bind the remote ProxyFactory to the JNDI. A local testsuite run after this fix, has exposed a couple of other issues, one of which is in the testcases. The other one is related to clustered stateful beans loadbalancing which is have to investigate a bit more (to understand why it was expected to work the way its currently configured).
The testsuite issue i am talking about is in the org.jboss.ejb3.test.jms.managed.unit.ManagedTestCase which deploys a JMSTestBean with a remote jndi binding for the session bean:
<session>
| <ejb-name>JMSTest</ejb-name>
|
| <resource-ref>
| <res-ref-name>jms/MyConnectionFactory</res-ref-name>
| <resource-name>connectionfactoryref</resource-name>
| </resource-ref>
| <resource-ref>
| <res-ref-name>jms/MyQueue</res-ref-name>
| <resource-name>queueref</resource-name>
| </resource-ref>
|
| <jndi-name>/jms-test-ejbs/JMSTest</jndi-name>
| </session>
|
Notice the leading / in the JNDI name. This results in our proxy-impl generating the jndi name for the default business interface as:
/jms-test-ejbs/JMSTest - EJB3.x Default Remote Business Interface
And the remote proxyfactory being bound in JNDI and registered in MC with the following key:
ProxyFactory/jms-managed/JMSTest//jms-test-ejbs/JMSTest
Notice the double // in the name. This binds fine in JNDI:
+- ProxyFactory (class: org.jnp.interfaces.NamingContext)
| |
| +- jms-managed (class: org.jnp.interfaces.NamingContext)
| | | +- JMSTest (class: org.jnp.interfaces.NamingContext)
| | | | +- jms-test-ejbs (class: org.jnp.interfaces.NamingContext)
| | | | | +- JMSTest (proxy: $Proxy257 implements interface
But when the ProxyFactory is looked up in the JNDI, it fails with NameNotFoundException:
10:10:31,701 ERROR [STDERR] javax.naming.NameNotFoundException: not bound
| 10:10:31,701 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
| 10:10:31,701 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
While doing the lookup, it internally splits the names on the / and obviously runs into this exception because of the double //.
IMO, we should fix this by our jndi binding logic (JNDISessionRegistrarBase) to strip any leading /. But what do others think? Possible options are:
1) Change the testcase to not use the leading / in the jndi-name. (Not an ideal fix, since end users too might end up with this exception if they do something similar).
2) Fix our jndi binding code. I think this is the ideal solution
3) Change the name lookup code (in jboss-naming) to parse this differently. I guess, this should not even be an option, since its not the responsibility of that piece of code to do the cleaning :)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249118#4249118
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4249118
16 years, 7 months
[Design of JBoss Profiler] - JVMTI committed on Branch_2_0
by clebert.suconic@jboss.com
I just committed JVMTIInterface on JBossProfiler2.
One of the good things on JBoss profiler 1 was the JVMTI module, that can be automated through JNI. There are a few tests using it on JBoss AS, and I think this is perfectly aligned with JBoss Profiler 2.
Jason was looking for a replacement of the JVMTI for a final version on JBAS, so I think this would be a good solution.
I've also added a few features around memory profiler.
I had a few leaks to chase on JBoss Messaging 2, and the best way to find them was by creating a few reports instead of spending a lot of time on tinkering with JVMTI Interface.
It is possible now to call a method startMemoryProfiler(InetAddress). That
method will start a small embedded Web Server (available on JDK 1.6+), and you would be able to link on references through the JVM (All live).
I've kept the build using Cmake. It should be fairly simple to compile it.
Also, the current code already has some support for inspecting methods. It's crashing but it's an initial version already.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249114#4249114
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4249114
16 years, 7 months