[EJB 3.0] - entity bean
by arrojusrikanth
when iam deploying entity bean it is deployed sucessfully
when i enter ant run at the command prompt
it is generating error
run:
[java] Exception in thread "main"
javax.naming.NameNotFoundException: remot
e not bound
[java] at
org.jnp.server.NamingServer.getBinding(NamingServer
.java:529)
[java] at
org.jnp.server.NamingServer.getBinding(NamingServer
.java:537)
[java] at
org.jnp.server.NamingServer.getObject(NamingServer.
java:543)
[java] at
org.jnp.server.NamingServer.lookup(NamingServer.jav
a:296)
[java] at
org.jnp.server.NamingServer.lookup(NamingServer.jav
a:270)
[java] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[java] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeM
ethodAcces
sorImpl.java:39)
[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Del
egatingMet
hodAccessorImpl.java:25)
[java] at
java.lang.reflect.Method.invoke(Method.java:597)
[java] at
sun.rmi.server.UnicastServerRef.dispatch(UnicastSer
verRef.jav
a:305)
[java] at
sun.rmi.transport.Transport$1.run(Transport.java:15
9)
[java] at
java.security.AccessController.doPrivileged(Native
Method)
[java] at
sun.rmi.transport.Transport.serviceCall(Transport.j
ava:155)
[java] at
sun.rmi.transport.tcp.TCPTransport.handleMessages(T
CPTranspor
t.java:535)
[java] at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandle
r.run0(TCP
Transport.java:790)
[java] at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandle
r.run(TCPT
ransport.java:649)
[java] at
java.util.concurrent.ThreadPoolExecutor$Worker.runT
ask(Thread
PoolExecutor.java:885)
[java] at
java.util.concurrent.ThreadPoolExecutor$Worker.run(
ThreadPool
Executor.java:907)
[java] at
java.lang.Thread.run(Thread.java:619)
[java] at
sun.rmi.transport.StreamRemoteCall.exceptionReceive
dFromServe
r(StreamRemoteCall.java:255)
[java] at
sun.rmi.transport.StreamRemoteCall.executeCall(Stre
amRemoteCa
ll.java:233)
[java] at
sun.rmi.server.UnicastRef.invoke(UnicastRef.java:14
2)
[java] at
org.jnp.server.NamingServer_Stub.lookup(Unknown
Source)
[java] at
org.jnp.interfaces.NamingContext.lookup(NamingConte
xt.java:62
5)
[java] at
org.jnp.interfaces.NamingContext.lookup(NamingConte
xt.java:58
7)
[java] at
javax.naming.InitialContext.lookup(InitialContext.j
ava:392)
[java] at x.Client.main(Client.java:12)
[java] Java Result: 1
BUILD SUCCESSFUL
Total time: 3 minutes 42 seconds
D:\software\jayendra\EJB\EntityBean>ant clean
Buildfile: build.xml
clean:
[delete] Deleting directory
D:\software\jayendra\EJB\EntityBean\build
[delete] Deleting: D:\Program
Files\jboss-4.0.5.GA\server\default\deploy\Ent.
jar
BUILD FAILED
D:\software\jayendra\EJB\EntityBean\build.xml:85:
Unable to delete file D:\Progr
am
Files\jboss-4.0.5.GA\server\default\deploy\Ent.jar
Total time: 2 seconds
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4133667#4133667
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4133667
18 years, 1 month
[JBoss jBPM] - Injecting the hibernate session
by chrisrjcox
Hi,
I have the following code within a Message Driven Bean, I can get it to create a JbpmContext however I'm getting stuck with regards to Injecting the hibernate session...
Eclipse is stating that I "cannot make a static reference to the none static ethod getCurrentSession() from the type SessionFactory"
I'm following this from Chaper 7 page 5 on the jbpm guide. (7.1.4)
| package com.distributed.jbpm.mdb;
|
| import javax.ejb.MessageDriven;
| import javax.ejb.ActivationConfigProperty;
|
| import javax.jms.JMSException;
| import javax.jms.Message;
| import javax.jms.MessageListener;
| import javax.jms.TextMessage;
|
| import org.jbpm.JbpmConfiguration;
| import org.jbpm.JbpmContext;
| import org.jbpm.graph.exe.ProcessInstance;
| import org.hibernate.*;
|
|
|
| @MessageDriven(activationConfig =
| {
| @ActivationConfigProperty(propertyName="acknowledgeMode", propertyValue = "Auto-acknowledge"),
| @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
| @ActivationConfigProperty(propertyName="destination", propertyValue="/queue/jbpmQueueTwo")
| })
|
| public class PartTwoMDB implements MessageListener
| {
| static JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
|
| public void onMessage(Message inMessage)
| {
| TextMessage textMessage = null;
| try
| {
| if(inMessage instanceof TextMessage)
| {
| textMessage = (TextMessage) inMessage;
| System.out.println("PartTwoMDB: Message received: "+ textMessage.getText());
|
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
| System.out.println("PartTwoMDB: jbpmContextCreated");
| try
| {
| jbpmContext.setSession(SessionFactory.getCurrentSession());
| String processDefinitionName = "processTwo";
| System.out.println("PartTwoMDB: processDefinitionName * " + processDefinitionName + " * String created.");
| ProcessInstance processInstance = jbpmContext.newProcessInstance(processDefinitionName);
| System.out.println("PartTwoMDB: Instance" + processInstance.toString() + " Loaded.");
| processInstance.signal();
| System.out.println("PartTwoMDB: Instance signal sent.");
| }
| finally
| {
| jbpmContext.close();
| }
|
| }
| else
| {
| System.out.println("PartTwoMDB: Message of wrong type: " + inMessage.getClass().getName());
| }
| }
| catch (JMSException e)
| {
| e.printStackTrace();
| }
| catch (Throwable t)
| {
| t.printStackTrace();
| }
|
| }
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4133664#4133664
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4133664
18 years, 1 month