[EJB 3.0] - Can I reference or inheritance between two jar files?
by joeyli
I have two EJB3 subsystem:
Auth system: was packed in auth.jar file
and
Order system: was packed in order.jar file
Now, I have a entity bean that's name is EOlocation, and it was packed in auth.jar:
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class EOlocation implements Serializable {
@ManyToOne
@JoinColumn(name = "eoaccount_id")
private EOaccount account;
.....
}
Another entity bean is EOorderLocation, it's a subclass for EOlocation, but was packed in order.jar
@Entity
public class EOorderLocation extends EOlocation {
.......
}
I am deploy the auth.jar before than deploy the order.jar file.
Than I get the exception like the following:
15:15:15,897 WARN [ServiceController] Problem starting service persistence.units:unitName=EatOutDS
org.hibernate.AnnotationException: @OneToOne or @ManyToOne on com.tweatout.auth.domain.EOlocation.account references an unknown entity: com.tweatout.auth.domain.EOaccount
at org.hibernate.cfg.FkSecondPass.doSecondPas(FkSecondPass.java:40)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(Annotatio
nConfiguration.java:288)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1034
)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.j
ava:1015)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerCo
nfigurator.java:154)
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Co
How can I implement the reference or inheritance entity bean between two jar files?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980632#3980632
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980632
19 years, 6 months
[JBoss jBPM] - Re: Has someone managed to build the code from CVS (HEAD)?
by clandestino_bgd
Hi Kukeltje, Koen and all JBPM Community,
The reason that I moved this issue into this topic is because the subject of the former one is not appropriate (it is related with my first problem - missing docbook support) and I did not get any solution there.
I have spent a lot of time trying to isolate the error in JBPM build procedure and I really need your assistence.
I have checked out the latest source version from CVS and invoke get.dependencies (nothing has been modified in the meanwhile).
I have also run both build scripts (Main one and GPD).
As far as I can see GPD fails here:
[java] [eclipse.buildScript] An error occured while generating manifest for D:\work\java\jbpm.3\designer\jpdl\org.jbpm.gd.jpdl.build\target\workspace.
and the Main build fails here:
[java] generateScript:
[java] [eclipse.buildScript] Some inter-plug-in dependencies have not been satisfied.
[java] [eclipse.buildScript] Bundle org.jbpm.gd.jpdl.core:
[java] [eclipse.buildScript] Missing required plug-in org.eclipse.wst.xml.core_0.0.0.
[java] [eclipse.buildScript] Missing required plug-in org.eclipse.wst.sse.core_0.0.0.
[java] [eclipse.buildScript] Bundle org.jbpm.gd.jpdl.ui:
[java] [eclipse.buildScript] Missing required plug-in org.eclipse.draw2d_0.0.0.
[java] [eclipse.buildScript] Missing required plug-in org.eclipse.gef_0.0.0.
[java] [eclipse.buildScript] Missing required plug-in org.eclipse.wst.sse.core_0.0.0.
[java] [eclipse.buildScript] Missing required plug-in org.eclipse.wst.xml.core_0.0.0.
[java] [eclipse.buildScript] Missing required plug-in org.eclipse.wst.xml.ui_0.0.0.
[java] [eclipse.buildScript] Missing required plug-in org.eclipse.wst.sse.ui_0.0.0.
[java] [eclipse.buildScript] Missing required plug-in org.eclipse.wst.common.ui_0.0.0.
[java] [eclipse.buildScript] Missing required plug-in org.jbpm.gd.jpdl.core_0.0.0.
The complete trace sections of relevant run-eclipse-plugin-builder targets in both build scripts you can find at:
MAIN: http://www.geocities.com/clandestino_bgd/Main.html
GPD: http://www.geocities.com/clandestino_bgd/GPD.html
The problematic parts (by my opinion) are Bolded .
Thank you for your help and patience.
I begin to lose mine, therefore I asked if someone (especially among users) managed to build the code
Regards
Milan Agatonovic
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980630#3980630
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980630
19 years, 6 months
[JBoss Getting Started Documentation] - Re: how to deploy the hellowworld bean in JBOSS-i dont find
by singam_19
This document is completely for the JBOSS- Remote home interface.---SingamGiridharaReddy(TataElxsi)-singam_19(a)yahoo.com
1)
a)META-INF
Ejb-jar.xml
Jboss.xml
b)Clinet/demo
HellowWorldTest
c)Ejb/demo
HellowWorld
HellowWorldBean
HellowWorldHome
d)JNDI.properties:keep this parellel to your META-INF folder.
2)The contents of ejb-jar file
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--Here the encoding typs is very important.and dtd is also very important.And also it is very important not to have any spaces in this xml file.-->
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN'
'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<ejb-jar>
<enterprise-beans>
<![CDATA[Interface Session Bean]]>
<display-name>HellowWorldDemo</display-name>
<ejb-name>HellowWorldDemo</ejb-name>
ejb.demo.HellowWorldHome
ejb.demo.HellowWorld
<ejb-class>ejb.demo.HellowWorldBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</enterprise-beans>
</ejb-jar>
3)The contents of jboss.xml file
<?xml version="1.0" encoding="UTF-8"?>
<enterprise-beans>
<ejb-name>HellowWorldDemo</ejb-name>
<jndi-name>HellowWorldDemo</jndi-name>
</enterprise-beans>
4)The contents of jndi.properties
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp\://127.0.0.1\:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
5)change the configuration in the following way in the jboss-service.xml
<mbean code="org.jboss.naming.NamingService"
name="jboss:service=Naming"
xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
<!-- The call by value mode. true if all lookups are unmarshalled using
the caller's TCL, false if in VM lookups return the value by reference.
-->
false
<!-- The listening port for the bootstrap JNP service. Set this to -1
to run the NamingService without the JNP invoker listening port.
-->
1099
<!-- The bootstrap JNP server bind address. This also sets the default
RMI service bind address. Empty == all addresses
-->
${jboss.bind.address}
<!-- The port of the RMI naming service, 0 == anonymous -->
1098
<!-- The RMI service bind address. Empty == all addresses
-->
${jboss.bind.address}
<!-- The thread pool service used to control the bootstrap lookups -->
<depends optional-attribute-name="LookupPool"
proxy-type="attribute">jboss.system:service=ThreadPool
6)
a)The jar file that need to in classpath while compiling server files
javac -classpath D:\jboss-4.0.4.GA\client\jboss-j2ee.jar ejb\demo\*.java
b)The content that need to be in server jar file are
jar cvf HellowWorldDemoEJB.jar ejb\demo\* META-INF\
c)Keep the HellowWorldDemoEJB.jar under the
D:\jboss-4.0.4.GA\server\default\deploy
d)The jar files that need to be in classpath while compiling client files
javac -classpath D:\project7\HellowWorldDemoEJB.jar;D:\jboss-4.0.4.GA\client\jboss-j2ee.jar client\demo\*.java
e)The content that need to be in client jar file are
D:\project7>jar cvf HellowWorldDemoclient.jar ejb/demo/HellowWorld.class HellowWorldHome.class client/demo/*.class jndi.properties
f)Copy the client jar under
D:\jboss-4.0.4.GA\client\HellowWorldDemoclient.jar;
g)The Jar files that need to be in class path while running client .
D:\project7>D:\dev\vendor\Windows\sun\jdk\jdk1.5.0_03\bin\java -Djava.security.policy=java.policy -classpath D:\jboss.0.4.GA\client\HellowWorldDemoclient.jar;
D:\jboss-4.0.4.GA\client\jnp-client.jar;D:\jboss-4.0.4.GA\client\jboss-j2ee.jar;
D:\jboss-4.0.4.GA\client\jboss-common-client.jar;D:\jboss-4.0.4.GA\client\jbossa
ll-client.jar;. client.demo.HellowWorldTest
7) -Djava.security.policy=java.policy is must to pass as the argument.
Java,policy file which will be under D:\dev\vendor\Windows\sun\jdk\jdk1.5.0_03\jre\lib\security need to altered or added
As the following
permission java.util.PropertyPermission "org.jboss.security.SecurityAssociation.ThreadLocal", "read";
permission java.lang.RuntimePermission "org.jboss.security.SecurityAssociation.getPrincipalInfo";
permission java.io.SerializablePermission "enableSubstitution";
permission java.net.SocketPermission "*:1024-65535", "listen,connect,accept,resolve";
8)The source files:
Server files:
package ejb.demo;
//import java.rmi.Remote;
//import java.rmi.RemoteException;
import javax.ejb.EJBException;
import javax.ejb.EJBObject;
import java.rmi.RemoteException;
public interface HellowWorld
extends EJBObject
{
public String hellow()
throws RemoteException;
}
b)
package ejb.demo;
import java.rmi.RemoteException;
import javax.ejb.CreateException;
import javax.ejb.EJBHome;
// Referenced classes of package ejb.demo:
// HellowWorld
public interface HellowWorldHome
extends EJBHome
{
public HellowWorld create()
throws RemoteException,CreateException;
}
c)
package ejb.demo;
//import java.rmi.RemoteException;
import javax.ejb.*;
public class HellowWorldBean
implements SessionBean
{
public HellowWorldBean()
{
}
public void ejbCreate()
{
}
public void ejbActivate()
throws EJBException
{
}
public void ejbPassivate()
throws EJBException
{
}
public void ejbRemove()
throws EJBException
{
}
public void setSessionContext(SessionContext sessioncontext)
throws EJBException
{
this.ctx=sessioncontext ;
}
public String hellow()
throws EJBException
{
return "hello world";
}
private SessionContext ctx;
static final boolean verbose = true;
}
client file:
package client.demo;
import javax.naming.*;
import ejb.demo.HellowWorldHome;
import ejb.demo.HellowWorld;
import java.util.Properties;
import javax.rmi.*;
import java.rmi.RMISecurityManager;
/**
*
* @author Singam.Reddy
*/
public class HellowWorldTest {
/** Creates a new instance of HellowWorldTest */
public HellowWorldTest() {
}
public static void main(String args[])
{
HellowWorldHome hw=null;
Context context1=null;
HellowWorld hwa = null;
try{
/* Properties env = new Properties();
System.out.println("got here 1a");
env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
env.setProperty("java.naming.provider.url", "localhost:1099");
env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
System.out.println("got here 1b");
*/
context1 = new InitialContext();
System.out.println("got here 1c");
/*hw=(HellowWorldLocalHome)PortableRemoteObject.narrow(context1.lookup("HellowWorldDemoLocal"),HellowWorldLocalHome.class);
*/
hw = ( HellowWorldHome)context1.lookup("HellowWorldDemo");
System.out.println("got here 1");
if (System.getSecurityManager() == null)
{
System.setSecurityManager(new RMISecurityManager());
}
hwa = hw.create();
System.out.println("hellow"+hwa.hellow());
}catch(Exception e)
{
e.printStackTrace() ;
}
}
public static void close(Context context2)
{
try{
System.out.println("got here 4");
context2.close();
}catch(NamingException namingException)
{
namingException.printStackTrace();
}
}
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980629#3980629
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980629
19 years, 6 months