[EJB 3.0] - Problem with EJB Injection in Servlet
by sarabjit
Hey Guys,
I know there is another similar thread but i couldn't find an answer there. It might be because am really new to EJB so well, please bear with me.
I have a war and an ejb.jar which i package in an ear. I have 2 questions
1. Am not able to access the ejb from the servlet. Can someone tell me what all configurations are needed in which all descriptors.
2. I've put shared libraries directly under the ear but they are not visible to my war. How can i fix that?
My ear structure is
EAR
|->Meta-inf
|->application.xml (defines the two ejb and war modules)
|->jboss-app.xml (empty)
|->my war.war
|->WEB-INF
|->web.xml (no declaration of ejb here)
|->myejb.jar
|->META-INF
|->jboss.xml (which is basically empty - just usual xml markup)
|->ejb-jar.xml(which is empty too)
|->all shared libraries
I have a servlet in my war
TestServelet.java
public class TestServlet extends HttpServlet {
@EJB
MySessionBean mybean;
@Override
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
system.out.println(mybean);
}
}
I have an interface in myejb.jar
MySessionBean.java
public interface MySessionBean{
void myFunc();
}
MySessionBeanImpl.java
public class MySessionBeanImpl Implements MySessionBean{
public void myFunc(){
system.out.println("Bean Called");
}
}
Am using jboss 4.2.3. Servelet gives me an npe at system.out so the injection isn't working.
Any help on this would be really awesome.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249394#4249394
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4249394
16 years, 9 months
[JBoss jBPM] - Re: <duedatetime> in timer
by bestage
The previous problem has disappeared after I changed my jbpm.cgf.xml like this:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <jbpm-configuration xmlns="http://jbpm.org/xsd/cfg">
|
|
| <process-engine-context>
|
| <repository-service />
| <repository-cache />
| <execution-service />
| <history-service />
| <management-service />
| <identity-service />
| <task-service />
|
|
| <string name="jbpm.duedatetime.format" value="HH:mm dd/MM/yyyy" />
| ....
|
But now I am getting another exception:
13:13:51,115 INF | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.SignalCmd@c940c94
org.jbpm.api.JbpmException: text is null
at org.jbpm.pvm.internal.cal.Duration.(Duration.java:77)
at org.jbpm.pvm.internal.job.TimerImpl.setDueDateDescription(TimerImpl.java:78)
at org.jbpm.pvm.internal.model.ScopeInstanceImpl.createTimer(ScopeInstanceImpl.java:294)
at org.jbpm.pvm.internal.model.ScopeInstanceImpl.initializeTimers(ScopeInstanceImpl.java:
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249390#4249390
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4249390
16 years, 9 months
[JBoss jBPM] - jbpm4 and oracle application server integration
by stup
Hi friends!
I am facing some problems during jbpm4 and OAS integration.
I am using default jbpm configs with one exception - i switched to JTA transaction interceptor to use oas bean-managed transactions. I configured hibernate to use my datasource also.
My test process could not connect to database, so i started debugging jbpm and this is what i found:
at org.jbpm.pvm.internal.tx.jta.JtaTransaction User transaction is looked up using
public static final String JNDINAME_USERTRANSACTION_JBOSS_GLOBAL = "UserTransaction";
JNDI. But in OAS UserTransaction is bound to "java:comp/UserTransaction".
Ive changed JNDINAME_USERTRANSACTION_JBOSS_GLOBAL to "java:comp/UserTransaction" and everything start working correctly.
Now i am wondering if there is any way to do same stuff without changing your sources?
Any help will be appreciated
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249384#4249384
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4249384
16 years, 9 months