• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Accessing JNDI tree over HTTP problem

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all.

I have 2 servers running under the same JBoss 4.0.5 on my PC. The second server is configured to use different ports.
From one server I am connecting to the JNDI tree of the other server to lookup an EJB:



As you see I am using http to connect to the JNDI tree.

During the narrowing, on the last line, I get a ClassCastException.

Using the jnp protocol with the same source everthing works fine:



No ClassCastException thrown.

It seems a configuration problem, but I have no idea where to look at.
Can you please give me some advices?

Any help will be highly appreciated.

Best regards,
Felix Sima


 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Instead of casting it, try printing out the type of the object that's returned from that call. Then compare it with the code which works. See if there's any difference between those two types.
 
Felix Sima
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jaikiran.

Here are the type of objects I receive after the lookup

Using http:


[This is what I see in Eclipse IDE's expression window during debug]
objref -> org.jboss.invocation.http.interfaces.HttpInvokerProxy
objref instanceof ListeAllegateFacadeHome -> false
objref.getClass() -> class $Proxy64
objref.getClass().getInterfaces() -> [interface org.jnp.interfaces.Naming] KO


Using jnp:


[This is what I see in Eclipse IDE's expression window during debug]
objref -> ejb/mif/ListeAllegateFacadeHome
objref instanceof ListeAllegateFacadeHome -> true
objref.getClass() -> class $Proxy64
objref.getClass().getInterfaces() -> [interface ...ListeAllegateFacadeHome, interface javax.ejb.Handle] OK

Any hint? Any idea?
Thanks.

Best regards,
Felix

 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why don't you use the JNP Scheme on both servers??

If you HAVE TO use http, then have a look at this: http://community.jboss.org/wiki/EJBJMSandJNDIoverHTTPwithUnifiedInvoker
 
Felix Sima
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rene.

Thanks for the answer.
My client uses the http configuration, so I must use it too
The post you showed me, uses the unified http invoker, which is not ok for me, because, as
I said, I must use the configuration of my client (http://localhost:9000/invoker/JNDIFactory).
Any other suggestion?

Best regards,
Felix

 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I forgot to ask you to post the JNDI tree contents (use the list() operation of JNDIView MBean in jmx-console), both when you use the HTTP invoker and the jnp one.
 
Felix Sima
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jaikiran.

The contents of the JNDI tree is the same in both cases, in fact, I don't modify
the JBoss configuration from one test to another. I just change the client code, to
access the JNDI tree using jnp or http.





I suppose there is a JBoss configuration error of the http invoker (it is a servlet), but I don't know where to look for the error. I list below the configuration of the
http invoker servlet:

myserver\deploy\http-invoker.sar\invoker.war\WEB-INF\web.xml





myserver\deploy\http-invoker.sar\META-INF\jboss-service.xml



Thank you.

Best regards,
Felix
 
reply
    Bookmark Topic Watch Topic
  • New Topic