[EJB/JBoss] - local entity bean lookup from session bean goes wrong
by y0ur1
I have an EJB21 session bean that uses an entity bean.
This is located in the ejb-jar:
<entity>
| <ejb-name>Book</ejb-name>
| <local-home>BookHome</local-home>
| <local>Book</local>
| <ejb-class>BookEntity</ejb-class>
| <persistence-type>Container</persistence-type>
| <prim-key-class>java.lang.String</prim-key-class>
| <reentrant>false</reentrant>
| <cmp-version>2.x</cmp-version>
| <abstract-schema-name>Book</abstract-schema-name>
| <cmp-field>
| <field-name>title</field-name>
| </cmp-field>
|
| <primkey-field>title</primkey-field>
|
|
| <ejb-local-ref>
| <ejb-ref-name>ejb/Book</ejb-ref-name>
| <ejb-ref-type>Entity</ejb-ref-type>
| <local-home>BookHome</local-home>
| <local>Book</local>
| <ejb-link>Book</ejb-link>
| </ejb-local-ref>
| </entity>
|
JNDI:
| java:comp namespace of the Book bean:
|
| +- env (class: org.jnp.interfaces.NamingContext)
| | +- ejb (class: org.jnp.interfaces.NamingContext)
| | | +- Book[link -> local/Book@16126503] (class: javax.naming.LinkRef)
|
But my lookup says: javax.naming.NameNotFoundException: ejb not bound
This code is inside the session bean is as follow:
| try {
| InitialContext ic = new InitialContext();
|
| book = (BookHome) ic.lookup("java:comp/env/ejb/Book");
|
| } catch (NamingException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
|
Any suggestions? I can't get the local entity bean to work with the session bean.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136916#4136916
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136916
18 years, 1 month
[Installation, Configuration & DEPLOYMENT] - JBOSS 5.0 BETA 4 and EAR deployment w/ Persistence Unit JAR
by Funks
Hello,
Does anybody here know why EAR's with JPA Persistence Units packaged as utilty jars have to be listed in the application.xml in order for it to work on JBOSS5B4?
Basically, In order for a Utility jar JPA to be deployed in JBOSS 5 BETA 4 packaged with an EAR, it has to be listed as an EJB Module?
eq.
APP.ear
APPModel.jar (this is the JPA Persistence Unit JAR)
APPEJB.jar
APPWeb.war
META-INF\application.xml
(in order for such an ear to deploy on JBOSS 5B4 - APPModel has to be listed as an EJB module in the application.xml - else the PU doesn't start).
Is this just a bug or a problem with JBOSS or an ambiguity in the JEE5 spec? Using GlassFish 2, the APPModel.jar doesn't have to be listed as an EJB module in the application.xml (listing the PU as an EJB module will make it fail to validate with the verifier) and the EAR deploys fine.
So basically, if I want my EAR to deploy in JBOSS 5 - I have to mangle my EAR file and hack the application.xml then list the Persistence Unit JAR file as an EJB Module even though its not.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136913#4136913
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136913
18 years, 1 month
[JBossWS] - Re: Call a web service
by rodosa
If I run the client as Java application the following exception it's thrown:
| java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/C:/jboss-4.2.2.GA/client/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
| at com.sun.xml.bind.v2.model.impl.ModelBuilder.<clinit>(ModelBuilder.java:172)
| at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:422)
| at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
| at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
| at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
| at javax.xml.bind.ContextFinder.find(Unknown Source)
| at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
| at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
| at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:186)
| at com.sun.xml.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:65)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
| at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
| at java.lang.reflect.Constructor.newInstance(Unknown Source)
| at java.lang.Class.newInstance0(Unknown Source)
| at java.lang.Class.newInstance(Unknown Source)
| at javax.xml.ws.spi.FactoryFinder.newInstance(Unknown Source)
| at javax.xml.ws.spi.FactoryFinder.find(Unknown Source)
| at javax.xml.ws.spi.Provider.provider(Unknown Source)
| at javax.xml.ws.Service.<init>(Unknown Source)
| at client.JbpmServiceService.<init>(JbpmServiceService.java:42)
| at client.JbpmWSClient.<clinit>(JbpmWSClient.java:85)
| Exception in thread "main"
|
I've put jaxb-api.jar in the lib/endorsed folder but it doesn't work.
Any ideas?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136910#4136910
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136910
18 years, 1 month
[EJB 3.0] - Persistence confusion in EJB 3.0 .........
by sajhak
hi ,
i m new to EJB development .. the question im going to ask might be a dumb one , if so pls excuse me ....
the question is ..
Does entity beans are a replacement for relational databases or it provides a layer on top of the database ??
what is actually doing by an Entity Bean ( or persistence object ) ?
does it saves the entity into a database table or does it keep the information about the entity in the application server's memory ?
because , i tried several examples from several tutorials , but i couldnt find any one of them "writes" the entity into a database ....
but i think a relational database must involve in this case , cos otherwise it will be impossible for entity be persistent ..
so , how we can define the database that we need to use ?? ( i need to use a MySQL datastore )
if i can get more help (regarding this prob) than this forum please give me the links of such resources ....
Thanks in advance
Saj
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136909#4136909
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136909
18 years, 1 month
[Beginners Corner] - Where to put application- AND layer-specific jar-files withi
by j0llyr0g3r
Hi folks,
i am writing a simple jboss / ear application to get myself used to dealing with Jboss and EJB.
I googled a lot, but i couldn't find an answer to the problem i have right now:
My project has the common EAR-layout:
- common
- ejb
- webapp
- build.xml
Now my EJB-layer uses one ActiveMQ jar file.
Now i don't know where to put this jar within my EAR-file?
First - in lack of better knowledge and for testing purposes - i put the jar-file just in the root of my EAR-file.
This is simply ignored by Jboss:
java.lang.NoClassDefFoundError: org/apache/activemq/ActiveMQConnectionFactory
But this class is deinitely in the ActiveMQ-jar which resides on the root-level of my EAR:
jar tf activemq-core-5.0-SNAPSHOT.jar | grep -i ActiveMQConnectionFactory
| org/apache/activemq/ActiveMQConnectionFactory$1.class
| org/apache/activemq/ActiveMQConnectionFactory.class
| org/apache/activemq/spring/ActiveMQConnectionFactory.class
So, finally my question......:-)
Where to put application- AND layer-specific jar-files within an EAR?
More specific:
Where to put the ActiveMQ jar-file within my EAR and how do i get Jboss to put it in the classpath?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136903#4136903
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136903
18 years, 1 month