[JNDI and Naming] - Get ejb3 from remote host (jboss 5.1) to jboss 4.x
by Michele Furlan
Michele Furlan [https://community.jboss.org/people/clanfur] created the discussion
"Get ejb3 from remote host (jboss 5.1) to jboss 4.x"
To view the discussion, visit: https://community.jboss.org/message/646964#646964
--------------------------------------------------------------
Hi,
I'm trying to get an ejb3 from a remote host (that uses jboss 5.1) inside jboss 4.x. The code I use is the following:
public void myFunction() {
Properties jndiProps = new Properties();
jndiProps.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
jndiProps.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interface");
jndiProps.setProperty(Context.PROVIDER_URL, "jnp://{*host-ip*}:{*host-jndi-port*}");
try {
FooInterface foo = (FooInterface)(new InitialContext(jndiProps)).lookup("{*jndi-name*}");
foo.doSomething();
} catch (Exception e) {
e.printStackTrace();
}
}
But doing that, I get a ClassCastException here "FooInterface foo = (FooInterface)(new InitialContext(jndiProps)).lookup("{*jndi-name*}");":
java.lang.ClassCastException: javax.naming.Reference cannot be cast to my.package.FooInterface
at com.phi.phirxportal.SecondOpinionRequestBean.myFunction(SecondOpinionRequestBean.java:272)
at com.phi.phirxportal.SecondOpinionRequestBean.checkExam(SecondOpinionRequestBean.java:170)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
Host ip, jndi name and host jndi port are correct. I can't figure out how to get my FooInterface from a javax.naming.Reference object.
The Reference object toString method returns something like:
Reference Class Name: Proxy for: my.package.FooInterface
Type: ProxyFactoryKey
Content: ProxyFactory/.....
Type: EJB Container Name
Content: jboss.j2ee:ear=xxx.ear,jar=xxx.jar,name=FooBean,service=EJB3
Type: Proxy Factory is Local
Content: false
Type: Remote Business Interface
Content: my.package.FooInterface
Type: Remoting Host URL
Content: socket://hostpcname:3873/?
Is there a way to do that or does it depends on something else (libraries, configuration, jboss version...)?
Thanks in advance.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/646964#646964]
Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
14 years, 2 months
[jBPM] - Share drools fact declaration between rules
by sandeep rao
sandeep rao [https://community.jboss.org/people/sandeepraopk] created the discussion
"Share drools fact declaration between rules"
To view the discussion, visit: https://community.jboss.org/message/646499#646499
--------------------------------------------------------------
Hi,
I am trying to get a sample of JBPM process design to work with constraints coded in drools. I am trying to evaluate my condition based on a process parameter.
So, I inserted processInstance into the working memory by adding a script task before my Gateway.
Here i added this code to onEntryAction: (This defines an instance of Stage that i want to access in my constraint)
import org.drools.runtime.process.WorkflowProcessInstance
global WorkflowProcessInstance processInstance;
declare Stage
status1 : String
status2 : String
status3 : String
end
rule
when
processInstance : WorkflowProcessInstance()
then
Stage stage=new Stage();
stage.setStatus1( processInstance.getVariable("status1") );
stage.setStatus2( processInstance.getVariable("status2") );
stage.setStatus3( processInstance.getVariable("status3") );
insert (stage);
end
In the condition Expression section of the outgoinglink of my gateway I added
Stage(status1=="open")
This results in an error
Unable to resolve ObjectType 'Stage'
How do I access this objectType?
-Sandeep
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/646499#646499]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
14 years, 2 months
[jBPM] - jBPM5 Demo - Trying to view Demo Human Task Server schema
by jemmerling
jemmerling [https://community.jboss.org/people/jemmerling] created the discussion
"jBPM5 Demo - Trying to view Demo Human Task Server schema"
To view the discussion, visit: https://community.jboss.org/message/646481#646481
--------------------------------------------------------------
Hi,
I modified build.xml so that it launches the H2 Web Console.
Having done that, and logging in to the H2 Console using the credentials from the persistence.xml used by the Demo Task Service, I see what appears to be an empty DB. Both before and after running the Human Task Example.
-TABLE_CATALOG is MYDB (but that is implied by the URL used to connect).
-Only system tables are visible.
-A query against any of the application tables that should have been created by Hibernate indicates the table does not exist (e.g. TASK).
I tried changing hibernate.show_sql to true so I can see the SQL output to the console where the server was launched. This SQL seems to suggest that these tables should exist (and when connected as "sa" should not require any prefix to query against them). I will admit I have no prior experience with H2 although substantial experience with a number of other RDBMSs.
I tried changing hibernate.connection.autocommit to true (although this is not something I would ordinarily change) without any different result.
To log into the H2 Console I am using http://localhost:8082/ http://localhost:8082/ and http://127.0.0.1:8082 http://127.0.0.1:8082/ (in addition to the URL that is created automatically when H2 is started).
Does anybody know why I can see nothing in the H2 Console or can suggest a different (free) approach e.g. an Eclipse plug-in?
Thanks!
--JE
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/646481#646481]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
14 years, 2 months