Problème de connection avec mon premier EJB..
Bonjour,
J'essaie d'executer mon premier EJB (session bean) sur Jboss. J'ai déployé mon EJB avec Eclipse et son plugin JBOSS IDE. Le déploiement semble s'être bien passé mais je ne sais pas comment utiliser JBOSS pour le vérifier...
Maintenant j'ai compilé mon application cliente. J'ai dû ajouter appserv-rt.jar pour éliminer une première erreure de connection avec initialContext:
Code:
1 2 3 4 5
| // lookup InterestCalculator EJB
Object homeObject =
initialContext.lookup( "InterestCalculator" ); |
Maintenant j'ai une seconde erreure:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| 4 avr. 2007 18:23:03 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2348)
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2369)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:212)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:225)
at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:104)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:159)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:156)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:296)
at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:110)
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:164)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:309)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at InterestCalculatorClient.createInterestCalculator(InterestCalculatorClient.java:82)
at InterestCalculatorClient.<init>(InterestCalculatorClient.java:40)
at InterestCalculatorClient.main(InterestCalculatorClient.java:311)
Caused by: java.lang.RuntimeException: java.net.ConnectException: Connexion refusée
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:356)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:195)
... 14 more
Caused by: java.net.ConnectException: Connexion refusée
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:340)
... 15 more |
Je n'ai rien trouvé sur google concernant cette erreure donc j'ai vraiment besoin de votre aide. Pour information voici mon fichier application.xml:
Code:
1 2 3 4 5 6 7 8 9 10
| <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC
"-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
"http://java.sun.com/dtd/application_1_3.dtd">
<application>
<display-name>InterestCalculator</display-name>
<module>
<ejb>InterestCalculator.jar</ejb>
</module>
</application> |
et mon fichier ejb-jar.xml:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
| <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar >
<description><![CDATA[No Description.]]></description>
<display-name>Generated by XDoclet</display-name>
<enterprise-beans>
<!-- Session Beans -->
<session >
<description><![CDATA[Description for InterestCalculator]]></description>
<display-name>InterestCalculator</display-name>
<ejb-name>InterestCalculator</ejb-name>
<home>tutorial.interfaces.InterestCalculatorHome</home>
<remote>tutorial.interfaces.InterestCalculator</remote>
<ejb-class>tutorial.ejb.InterestCalculatorEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
<!--
To add session beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called session-beans.xml that contains
the <session></session> markup for those beans.
-->
<!-- Entity Beans -->
<!--
To add entity beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called entity-beans.xml that contains
the <entity></entity> markup for those beans.
-->
<!-- Message Driven Beans -->
<!--
To add message driven beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called message-driven-beans.xml that contains
the <message-driven></message-driven> markup for those beans.
-->
</enterprise-beans>
<!-- Relationships -->
<!-- Assembly Descriptor -->
<!--
To specify your own assembly descriptor info here, add a file to your
XDoclet merge directory called assembly-descriptor.xml that contains
the <assembly-descriptor></assembly-descriptor> markup.
-->
<assembly-descriptor >
<!--
To specify additional security-role elements, add a file in the merge
directory called ejb-security-roles.xml that contains them.
-->
<!-- method permissions -->
<!--
To specify additional method-permission elements, add a file in the merge
directory called ejb-method-permissions.ent that contains them.
-->
<!-- transactions -->
<!--
To specify additional container-transaction elements, add a file in the merge
directory called ejb-container-transactions.ent that contains them.
-->
<!-- finder transactions -->
<!-- message destinations -->
<!--
To specify additional message-destination elements, add a file in the merge
directory called ejb-message-destinations.ent that contains them.
-->
<!-- exclude list -->
<!--
To specify an exclude-list element, add a file in the merge directory
called ejb-exclude-list.xml that contains it.
-->
</assembly-descriptor>
</ejb-jar> |
et mon fichier jboss.xml:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jboss PUBLIC
"-//JBoss//DTD JBOSS 3.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
<jboss>
<enterprise-beans>
<!--
To add beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called jboss-beans.xml that contains
the <session></session>, <entity></entity> and <message-driven></message-driven>
markup for those beans.
-->
<session>
<ejb-name>InterestCalculator</ejb-name>
<jndi-name>ejb/InterestCalculator</jndi-name>
</session>
<!--
write a merge file jboss-webservices.ent for webservice-description
-->
</enterprise-beans>
<resource-managers>
</resource-managers>
<!--
| for container settings, you can merge in jboss-container.xml
| this can contain <invoker-proxy-bindings/> and <container-configurations/>
-->
</jboss> |
Merci pour votre aide!
Patrick