[EJB 3.0] - How Can I get Seesion bean using embedded ejb
by sirajulmuneer
Hi all,
I am trying to lookup my seesion bean using context.lookup
Code is like this
EJB3StandaloneBootstrap.boot(null);
Context ctx=getInitalContext()
ctx.lookup("ConsumerProfileSession")
static InitialContext getInitialContext() throws Exception
{
Hashtable props = getInitialContextProperties();
return new InitialContext(props);
}
private static Hashtable getInitialContextProperties()
{
Hashtable props = new Hashtable();
props.put("java.naming.factory.initial", "org.jnp.interfaces.LocalOnlyContextFactory");
props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
return props;
}
Error is cant bind
Is it need any more additional information to be add about Session bean in xml files?
Please help me
Thanks
Muneer
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976216#3976216
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976216
19 years, 7 months
[EJB 3.0] - How Can I get Seesion bean using embedded ejb
by sirajulmuneer
Hi all,
I am trying to lookup my seesion bean using context.lookup
Code is like this
EJB3StandaloneBootstrap.boot(null);
Context ctx=getInitalContext()
ctx.lookup("ConsumerProfileSession")
static InitialContext getInitialContext() throws Exception
{
Hashtable props = getInitialContextProperties();
return new InitialContext(props);
}
private static Hashtable getInitialContextProperties()
{
Hashtable props = new Hashtable();
props.put("java.naming.factory.initial", "org.jnp.interfaces.LocalOnlyContextFactory");
props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
return props;
}
Error is cant bind
Is it need any more additional information to be add about Session bean in xml files?
Please help me
Thanks
Muneer
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976215#3976215
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976215
19 years, 7 months
[JCA/JBoss] - How to use Hashtable in JBoss Rules
by vivonpereira
I have an object containing Hashtable. I want to take the value from the hashtable and use it for the LHS side of the rule. How do I do that?
Object: Test
Hashtable in Test: inputHT (the hashtable contains the key as 'age' and value as '21'. Like: inputHT.put(age, new Integer(21)) )
The rule defined is:
rule "male"
when
t:Test(inputHT.get("age") >= 21)
then
System.out.println("Adult");
end
It throws error as: unexpected token 'inputHT'
mismatched token .... expecting type )......
Please reply soon
Also tell me how to use variables in Object within another object in Rules defining process.
For eg: A variable skill1 (String) present in Skill object, which in turn is present in Employee object. How to define the rule for skill1.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976211#3976211
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976211
19 years, 7 months
[EJB 3.0] - Eror while looking EJB...Urgent
by sirajulmuneer
I m getting an error as such shown below while trying to scan Class path of BootStrap.
I just put two lines of code in my sample app and classpath for some ejbs.
Code is-->
EJB3StandaloneBootstrap.boot(null);
System.out.println("----------------------------------------------------------");
EJB3StandaloneBootstrap.scanClasspath();
Error is ->
WARN 05-10 08:29:48,905 (BeanSchemaBinding.java:init:227) -You should use the 2.0 version of the Microcontainer xml. xmlns='urn:jboss:bean-deployer:2.0'
----------------------------------------------------------
java.lang.RuntimeException: java.lang.IllegalStateException: Already installed jboss.j2ee:service=EJB3,jar=ejb,name=ScheduleSessionBean
at org.jboss.ejb3.MCKernelAbstraction.install(MCKernelAbstraction.java:90)
at org.jboss.ejb3.Ejb3Deployment.registerEJBContainer(Ejb3Deployment.java:414)
at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:463)
at org.jboss.ejb3.embedded.EJB3StandaloneDeployer.start(EJB3StandaloneDeployer.java:450)
at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.scanClasspath(EJB3StandaloneBootstrap.java:238)
at test.TestMe.main(TestMe.java:11)
Caused by: java.lang.IllegalStateException: Already installed jboss.j2ee:service=EJB3,jar=ejb,name=ScheduleSessionBean
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:149)
at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:79)
at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:73)
at org.jboss.ejb3.MCKernelAbstraction.install(MCKernelAbstraction.java:86)
... 5 more
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: Already installed jboss.j2ee:service=EJB3,jar=ejb,name=ScheduleSessionBean
at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.scanClasspath(EJB3StandaloneBootstrap.java:243)
at test.TestMe.main(TestMe.java:11)
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Already installed jboss.j2ee:service=EJB3,jar=ejb,name=ScheduleSessionBean
at org.jboss.ejb3.MCKernelAbstraction.install(MCKernelAbstraction.java:90)
at org.jboss.ejb3.Ejb3Deployment.registerEJBContainer(Ejb3Deployment.java:414)
at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:463)
at org.jboss.ejb3.embedded.EJB3StandaloneDeployer.start(EJB3StandaloneDeployer.java:450)
at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.scanClasspath(EJB3StandaloneBootstrap.java:238)
... 1 more
Caused by: java.lang.IllegalStateException: Already installed jboss.j2ee:service=EJB3,jar=ejb,name=ScheduleSessionBean
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:149)
at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:79)
at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:73)
at org.jboss.ejb3.MCKernelAbstraction.install(MCKernelAbstraction.java:86)
... 5 more
embedded-jboss-beans.xml,
ejb3-interceptors-aop.xml
default.persistence.properties
log4j.xml
Files are present in class path.
persistence.xml is present in META_INF
the problem shows only when I am trying to add class path of EJB in my project.
Lest Booting and scanClasspath works fine.(Removing classpath of EJB)
Please help me ..Its quite urgent...
Thanks in advance
Regards
Muneer
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976209#3976209
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976209
19 years, 7 months