[EJB 3.0] - Getting EJB from remote Jboss instance fails
by henk53
Hi,
I'm trying to get an EJB from a remote Jboss AS 5.0.1 instance. On that same machine (in a different JVM) I can get this bean without any problems using basic code such as this:
| public static void main(String[] args) throws Exception {
| Context context = getRemoteInitialContext();
| Object obj = context.lookup("EJBTest/SessionBean/remote");
| }
|
| public static Context getRemoteInitialContext() throws NamingException {
| Properties p = new Properties();
| p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
| p.put(Context.PROVIDER_URL, "jnp://localhost:1099");
| return new InitialContext(p);
| }
|
This is all straight from the many examples and tutorials and works like a charm.
However, when I try to connect from the machine next to me, using the same code (but changing localhost into the IP number), it doesn't work. I started Jboss AS with -b 0.0.0.0:
| /opt/jdk1.6.0_12//bin/java -Djboss.server.log.threshold=WARN -Dprogram.name=run.sh -server -Xms128m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true -Djava.endorsed.dirs=/opt/jboss/lib/endorsed -classpath /opt/jboss/bin/run.jar:/opt/jdk1.6.0_12//lib/tools.jar org.jboss.Main -b 0.0.0.0
|
I also confirmed that port 1099 is reachable from the other machine via telnet and nmap. E.g.:
| telnet 10.0.0.2 1099
| Trying ::1...
| Connected to 10.0.0.2.
| Escape character is '^]'.
| ??srjava.rmi.MarshalledObject|???c?>IhashlocBytest
|
| nmap -sT -p 1099 10.0.0.2
|
| Starting Nmap 4.63a ( http://nmap.org ) at 2009-07-11 10:34 CEST
| Interesting ports on 10.0.0.2:
| PORT STATE SERVICE
| 1099/tcp open unknown
|
So the host is reachable and the port is open. However, when I now execute the following from host 10.0.0.1:
| public static void main(String[] args) throws Exception {
| Context context = getRemoteInitialContext();
| Object obj = context.lookup("EJBTest/SessionBean/remote");
| }
|
| public static Context getRemoteInitialContext() throws NamingException {
| Properties p = new Properties();
| p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
| p.put(Context.PROVIDER_URL, "jnp://10.0.0.2:1099");
| return new InitialContext(p);
| }
|
I get the following exception:
| log4j:WARN No appenders could be found for logger (org.jnp.interfaces.TimedSocketFactory).
| log4j:WARN Please initialize the log4j system properly.
| Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: 10.0.0.2:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server 10.0.0.2:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server 10.0.0.2:1099 [Root exception is java.net.ConnectException: Operation timed out]]]
| at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1727)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:680)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:673)
| at javax.naming.InitialContext.lookup(InitialContext.java:392)
| at client.TestRemoteClientAccess.main(TestRemoteClientAccess.java:23)
| Caused by: javax.naming.CommunicationException: Failed to connect to server 10.0.0.2:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server 10.0.0.2:1099 [Root exception is java.net.ConnectException: Operation timed out]]
| at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:311)
| at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1698)
| ... 4 more
| Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server 10.0.0.2:1099 [Root exception is java.net.ConnectException: Operation timed out]
| at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:281)
| ... 5 more
| Caused by: java.net.ConnectException: Operation timed out
| at java.net.PlainSocketImpl.socketConnect(Native Method)
| at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
| at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
| at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
| at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
| at java.net.Socket.connect(Socket.java:519)
| at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:97)
| at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:82)
| at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:277)
| ... 5 more
|
After googling around a little, I played with the jnp.localAddress property, but this didn't really helped. Setting it to some bogus address correctly gives a binding error, but when I enter my real local IP I pretty much get the same exception as above.
I wonder if anyone could help me with this or point me to documentation describing how to do this.
Many thanks in advance.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4243064#4243064
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4243064
17 years
[JBoss jBPM] - Re: jBPM3.2.3 with Tomcat 6
by melgamal
thanx 4 ur replay
I allready insert data in Identity tables like this:
| INSERT INTO JBPM_ID_GROUP VALUES(1,'G','sales','organisation',NULL);
| INSERT INTO JBPM_ID_GROUP VALUES(2,'G','hr','organisation',NULL);
| INSERT INTO JBPM_ID_GROUP VALUES(3,'G','participant','security-role',NULL);
| INSERT INTO JBPM_ID_GROUP VALUES(4,'G','manager','security-role',NULL);
| INSERT INTO JBPM_ID_GROUP VALUES(5,'G','administrator','security-role',NULL);
| INSERT INTO JBPM_ID_USER VALUES(1,'U','cookie monster','cookie.monster(a)sesamestreet.tv','cookie monster');
| INSERT INTO JBPM_ID_USER VALUES(2,'U','ernie','ernie(a)sesamestreet.tv','ernie');
| INSERT INTO JBPM_ID_USER VALUES(3,'U','bert','bert(a)sesamestreet.tv','bert');
| INSERT INTO JBPM_ID_USER VALUES(4,'U','grover','grover(a)sesamestreet.tv','grover');
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES(1,'M',NULL,NULL,1,3);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES(2,'M',NULL,NULL,2,3);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES(3,'M',NULL,NULL,4,2);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES(4,'M',NULL,NULL,4,3);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES(5,'M',NULL,NULL,3,3);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES(6,'M',NULL,NULL,3,2);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES(7,'M',NULL,NULL,2,2);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES(8,'M',NULL,NULL,2,4);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES(9,'M',NULL,NULL,2,5);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES(10,'M',NULL,'boss',2,1);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES(11,'M',NULL,NULL,1,1);
|
and also update data for oracl database using the following sql script:
| update jbpm_id_membership j
| set j.NAME_ = (SELECT u.NAME_ from jbpm_id_user u where j.USER_ = u.ID_)
|
|
| update jbpm_id_membership j
| set j.ROLE_ = (SELECT g.NAME_ from jbpm_id_group g where j.GROUP_ = g.ID_)
|
and define the realm as follow:
| <Context>
| <Realm className="org.apache.catalina.realm.JDBCRealm"
| driverName="oracle.jdbc.driver.OracleDriver"
| connectionURL="jdbc:oracle:thin:@localhost:1521:orcl"
| connectionName="****"
| connectionPassword="*****"
| userTable="JBPM_ID_USER"
| userNameCol="NAME_"
| userCredCol="PASSWORD_"
| userRoleTable="JBPM_ID_MEMBERSHIP"
| roleNameCol="NAME_" />
| </Context>
|
am I missing any thing else?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4243062#4243062
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4243062
17 years
[JBoss jBPM] - the GPD in jBPM 4.0
by sebastian.s
Hello folks,
I am trying out jBPM 4.0 and I am playing around with the GPD. From the information I got from manuals and websites which I've read before I understood that the designer is now using BPMN as notation. I noticed this in the designer since they symbols and elements changed compared with the previous version.
I also read that the processes designed in BPMN could then be exported into jPDL or BPEL but I could not find an appropiate entry in the Export-menu as described in the manual. Did I get something wrong or am I doing something wrongly? I am also wondering since the process definition files have got jpdl in their suffix.
Any enlightenment in this is highly appreciated.
Thanks a lot.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4243048#4243048
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4243048
17 years
[Installation, Configuration & DEPLOYMENT] - Unauthenticated caller null N sqlException
by ravirachannavar
Hi All
I have JBoss 5.1.0 GA and I want to connect the DB2 database.
I have made the required changes in db2-ds.xml,hsqldb-persistance-service.xml,web.xml.
But wen I run the run.bat .........it shows the folowing errors..
Please can u help me.......how to avoid these errors....(these are associasted with the JAAS)
Thanks in advance..
DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "jboss.j2ee:jar=profileservice-secured.jar,name=SecureDeploymentMan
ager,service=EJB3_endpoint" is missing the following dependencies:
Dependency "jboss.j2ee:jar=profileservice-secured.jar,name=SecureDeploymentM
anager,service=EJB3" (should be in state "Configured", but is actually in state
"**ERROR**")
Deployment "jboss.j2ee:jar=profileservice-secured.jar,name=SecureManagementVie
w,service=EJB3_endpoint" is missing the following dependencies:
Dependency "jboss.j2ee:jar=profileservice-secured.jar,name=SecureManagementV
iew,service=EJB3" (should be in state "Configured", but is actually in state "**
ERROR**")
Deployment "jboss.j2ee:jar=profileservice-secured.jar,name=SecureProfileServic
e,service=EJB3" is missing the following dependencies:
Dependency "<UNKNOWN jboss.j2ee:jar=profileservice-secured.jar,name=SecurePr
ofileService,service=EJB3>" (should be in state "Described", but is actually in
state "** UNRESOLVED Demands 'jndi:SecureManagementView/remote-org.jboss.deploye
rs.spi.management.ManagementView' **")
Deployment "jboss.j2ee:jar=profileservice-secured.jar,name=SecureProfileServic
e,service=EJB3_endpoint" is missing the following dependencies:
Dependency "jboss.j2ee:jar=profileservice-secured.jar,name=SecureProfileServ
ice,service=EJB3" (should be in state "Configured", but is actually in state "Pr
eInstall")
Deployment "jboss.jca:name=JmsXA,service=ConnectionFactoryBinding" is missing
the following dependencies:
Dependency "jboss.jca:name=JmsXA,service=TxCM" (should be in state "Create",
but is actually in state "Configured")
Deployment "jboss.jca:name=JmsXA,service=ManagedConnectionFactory" is missing
the following dependencies:
Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create"
, but is actually in state "Configured")
Deployment "jboss.jca:name=JmsXA,service=ManagedConnectionPool" is missing the
following dependencies:
Dependency "jboss.jca:name=JmsXA,service=ManagedConnectionFactory" (should b
e in state "Create", but is actually in state "Configured")
Deployment "jboss.jca:name=JmsXA,service=TxCM" is missing the following depend
encies:
Dependency "jboss.jca:name=JmsXA,service=ManagedConnectionPool" (should be i
n state "Create", but is actually in state "Configured")
Deployment "jboss.messaging.connectionfactory:service=ClusterPullConnectionFac
tory" is missing the following dependencies:
Dependency "jboss.messaging:service=PostOffice" (should be in state "Create"
, but is actually in state "Configured")
Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create"
, but is actually in state "Configured")
Deployment "jboss.messaging.connectionfactory:service=ClusteredConnectionFacto
ry" is missing the following dependencies:
Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create"
, but is actually in state "Configured")
Dependency "jboss.messaging:service=PostOffice" (should be in state "Create"
, but is actually in state "Configured")
Deployment "jboss.messaging.connectionfactory:service=ConnectionFactory" is mi
ssing the following dependencies:
Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create"
, but is actually in state "Configured")
Dependency "jboss.messaging:service=PostOffice" (should be in state "Create"
, but is actually in state "Configured")
Deployment "jboss.messaging.destination:name=DLQ,service=Queue" is missing the
following dependencies:
Dependency "jboss.messaging:service=PostOffice" (should be in state "Create"
, but is actually in state "Configured")
Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create"
, but is actually in state "Configured")
Deployment "jboss.messaging.destination:name=ExpiryQueue,service=Queue" is mis
sing the following dependencies:
Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create"
, but is actually in state "Configured")
Dependency "jboss.messaging:service=PostOffice" (should be in state "Create"
, but is actually in state "Configured")
Deployment "jboss.messaging:service=PostOffice" is missing the following depen
dencies:
Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create"
, but is actually in state "Configured")
Deployment "jboss.messaging:service=ServerPeer" is missing the following depen
dencies:
Dependency "jboss.messaging:service=PersistenceManager" (should be in state
"Create", but is actually in state "**ERROR**")
Deployment "jboss.mq:service=DestinationManager" is missing the following depe
ndencies:
Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create"
, but is actually in state "Configured")
DEPLOYMENTS IN ERROR:
Deployment "jboss.j2ee:jar=profileservice-secured.jar,name=SecureDeploymentMan
ager,service=EJB3" is in error due to the following reason(s): **ERROR**, java.l
ang.SecurityException: Unauthenticated caller:null
Deployment "jboss:service=KeyGeneratorFactory,type=HiLo" is in error due to th
e following reason(s): java.lang.SecurityException: Unauthenticated caller:null
Deployment "jboss.messaging:service=PersistenceManager" is in error due to the
following reason(s): **ERROR**, java.sql.SQLException: java.lang.UnsatisfiedLin
kError: no db2jdbc in java.library.path
Deployment "<UNKNOWN jboss.j2ee:jar=profileservice-secured.jar,name=SecureProf
ileService,service=EJB3>" is in error due to the following reason(s): ** UNRESOL
VED Demands 'jndi:SecureManagementView/remote-org.jboss.deployers.spi.management
.ManagementView' **
Deployment "jboss.j2ee:jar=profileservice-secured.jar,name=SecureManagementVie
w,service=EJB3" is in error due to the following reason(s): **ERROR**, java.lang
.SecurityException: Unauthenticated caller:null
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4243047#4243047
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4243047
17 years