Scienze  
Syllabus ItalianoSyllabus IngleseindexlogoutArea Personale UNITN
Sistemi distribuiti: design Forum del Corso Messaggi del Thread
 
Sistemi distribuiti: design - Forum del Corso
Messaggi del Thread

Autore Messaggio
gianni.costanzi
Thread
  Post Postato: 18 dicembre 2004
   Titolo: JBoss problem (related to Cabin.zip)
 

I have tried to run the Cabin.zip example but I'm having some problems with Jboss.. Here is the output that I get when I run "ant run.client -Darg1=create":

-----------------------------------------------------------------
Buildfile: build.xml

prepare:

compile:

ejbjar:

run.client:
     [java] javax.naming.NameNotFoundException: CabinHandle not bound
     [java]     at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
     [java]     at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
     [java]     at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
     [java]     at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java]     at java.lang.reflect.Method.invoke(Method.java:324)
     [java]     at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
     [java]     at sun.rmi.transport.Transport$1.run(Transport.java:148)
     [java]     at java.security.AccessController.doPrivileged(Native Method)
     [java]     at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
     [java]     at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
     [java]     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
     [java]     at java.lang.Thread.run(Thread.java:534)
     [java]     at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
     [java]     at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
     [java]     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
     [java]     at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
     [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)
     [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
     [java]     at javax.naming.InitialContext.lookup(InitialContext.java:347)
     [java]     at com.titan.clients.Client_1.main(Client_1.java:71)

BUILD SUCCESSFUL
Total time: 2 seconds
-----------------------------------------------------------------

It seems to be a problem related to JNDI, so what should I check? The directory server should be listening on the 1099 port, is it right? I am sure that something is listening on that port, because if I run "telnet localhost 1099" I get some messages (nothing understandable, it is not meant to interact with telnet )

I hope someone can help me or at least tell me where I should put my hands to get it work..

Thank you
afogarolli
  Post Postato: 20 dicembre 2004
   Titolo: Re: JBoss problem (related to Cabin.zip)
 

The exeption you get it's related with the JNDI service.
JNDI can not bound (can't find) CabinHandle object.
The name you use when you lookup the object must match the <ejb-ref-name>
in jboss.xml file.
For example, if you use this string in your lookup call "java:comp/env/ejb
/CabinHandle" , you must have this reference in jboss.xml:
<ejb-ref-name>ejb/CabinHandle</ejb-ref-name>
Then you should check ejb-jar.xml file, you must have a reference to
CabinHandle in the bean that is going to call it.
The section <ejb-local-ref> must include the same reference name defined in
jboss.xml: <ejb-local-ref> <ejb-ref-name> ejb/CabinHandle</ejb-ref-name>


Hope it helps...
Tell me if you can't solve the problem.
gianni.costanzi
  Post Postato: 20 dicembre 2004
   Titolo: Re: JBoss problem (related to Cabin.zip)
 

Perhaps there's something I do not understand...
Why if in the lookup call I use "java:comp/env/ejb/CabinHandle" in the jboss.xml I should write only <ejb-ref-name>ejb/CabinHandle</ejb-ref-name> instead of <ejb-ref-name>comp/env/ejb/CabinHandle</ejb-ref-name> ?

However, there isn't the row <ejb-ref-name> in jboss.xml.. It contains only:

<?xml version="1.0"?> 
<jboss>
<enterprise-beans>
          <entity>
              <ejb-name>CabinEJB</ejb-name> 
              <jndi-name>CabinHandle</jndi-name> 
          </entity>
       </enterprise-beans>
</jboss>

This evening I will try to make all this stuff work.. Did you have a look at Cabin.zip? You can find it in the section "Diario del Corso"..
I'll let you know if I solve my problem..

Thank you!
afogarolli
  Post Postato: 20 dicembre 2004
   Titolo: Re: JBoss problem (related to Cabin.zip)
 

I took a look to the Cabin example, and I notice a mistake in Client_2.java. The lookup agrument is not CabinHomeRemote but CabinHandle as in Client_1.java.
There are also some conventions in working with JNDI ...but it's better discuss this part in class, thrusday could be the right day for this kind of questions.
gianni.costanzi
  Post Postato: 21 dicembre 2004
   Titolo: Re: Re: JBoss problem (related to Cabin.zip)
 

afogarolli wrote:
I took a look to the Cabin example, and I notice a mistake in Client_2.java. The lookup agrument is not CabinHomeRemote but CabinHandle as in Client_1.java.


I've run Client_1 with "ant run.client -Darg1=create" and it should work if the mistake is only in Client_2.. I thought it was a problem related to some configuration mistakes under Linux, but we noticed the same problem under Windows...
Thank you
marco.ronchetti
  Post Postato: 21 dicembre 2004
   Titolo: Re: Re: Re: JBoss problem (related to Cabin.zip)
 

gianni.costanzi wrote:

I've run Client_1 with "ant run.client -Darg1=create" and it should work if the mistake is only in Client_2..


I think there might be a problem with the -Darg1 switch of ant. It worked fine with last year's version of ant. I'll check it.
stefano.schivo
  Post Postato: 22 dicembre 2004
   Titolo: Re: JBoss problem (related to Cabin.zip)
 

marco.ronchetti wrote:

I think there might be a problem with the -Darg1 switch of ant. It worked fine with last year's version of ant. I'll check it.


Forse il problema non č quello, perché anche cambiando il build.xml (o lanciando il client a mano) a Gianni non funziona lo stesso..
Da me la situazione č anche peggiore: non riesce nemmeno a trovare il dataSource nel JNDI, quindi JBoss non riesce ad effettuare il deployment. L'errore che mi da č questo:

[ObjectName: jboss.j2ee:jndiName=CabinHandle,service=EJB state: FAILED
 I Depend On:
 Depends On Me: org.jboss.deployment.DeploymentException: Error: can't find data source: java:/CabinDataBase; - nested throwable: (javax.naming.NameNotFoundException: CabinDataBase not bound)]


Boh.. Voi avete qualche idea?
afogarolli
  Post Postato: 22 dicembre 2004
   Titolo: Re: JBoss problem (related to Cabin.zip)
 

I propose to try to solve the problem in class tomorrow without using tools.
We can discuss the example step by step and you will learn also all the dependency among descriptors.
gianni.costanzi
  Post Postato: 24 dicembre 2004
   Titolo: Re: JBoss problem (related to Cabin.zip) [SOLVED]
 

Now the example works fine for me.. Tha major issues where:

- mysql-ds.xml was placed inside the titan.jar instead of the "deploy" directory

- there was an opening tag in mysql-ds.xml without the correspondig closing tag (just remove the opening tag)

- I didn't have the mysql-connector-java-3.0.11-stable-bin.jar in the "default/lib/" directory of jboss

I hope it will work fine also for you...
 
Progetto eLeaf
Contact eLeaf team