You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by SergZ <se...@gmail.com> on 2007/12/26 14:23:33 UTC
creating and deploying ejb
Hello. I'm a newbie.
My ejbapp use external library(for example JAX-RPC), and archive ejbapp.jar
doesn't consist of any jaxrpc*.jar files. For devolipng I use Netbeans.
At attempt a deploying this ejb, I receive messages such that:
...
14:25:33,666 INFO [config] Configuring app:
default/hellobean/1198697132606/jar
14:25:33,827 ERROR [Deployer] Deployment failed due to
java.lang.NoClassDefFoundError: Lcom/sun/activation/viewers/TextViewer;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
at java.lang.Class.getDeclaredFields(Class.java:1743)
...
ejb-business-part is:
package hellopack;
import javax.ejb.Stateless;
import com.sun.activation.viewers.TextViewer;
@Stateless
public class NewSessionBean implements NewSessionRemote, NewSessionLocal {
/** Creates a new instance of NewSessionBean */
TextViewer tv;
public NewSessionBean() {
}
public String sayHello() {
//TODO implement sayHello
return "Hellqweqweqwo!";
}
}
I suppose that to achieve this is to use Common Libs in Services.
How to solve this problem.
--
View this message in context: http://www.nabble.com/creating-and-deploying-ejb-tp14502180s134p14502180.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: creating and deploying ejb
Posted by Viet Nguyen <vh...@gmail.com>.
After you have installed the library into Geronimo (you can do this
via the admin console) you can set a dependency in your application.
It is pretty simple, but here is a sample application that has a
dependency on OpenJPA ...
http://cwiki.apache.org/GMOxDOC20/ejb-sample-application.html.
--Viet
On Dec 26, 2007 1:14 PM, SergZ <se...@gmail.com> wrote:
>
> If include all libraries into ear or ejbapp.jar, size if this bean will be so
> much(~10Mb). And
> I think that it isn't a good idea. Otherwise why there is possibility to
> make jar-file without libraries.
> I think that one can "install" library into geronimo(Repository with
> appropriate Group, Artifact, Version and Type) and declares dependencies in
> openejb-jar.xml.
>
> if you or somebody give example if it implementation i'll be very much
> obliged to you)
>
>
>
>
> vhnguy2 wrote:
> >
> > You should package your deployable in the form of an EAR instead of a
> > JAR. Inside the EAR, you can have multiple JARs. You should place your
> > ejbapp.jar and the jaxrpc*.jar libraries inside this EAR. This way,
> > the ejbapp.jar will be able to see classes inside jaxrpc*.jar.
> >
> > --Viet
> >
> > On Dec 26, 2007 8:23 AM, SergZ <se...@gmail.com> wrote:
> >>
> >> Hello. I'm a newbie.
> >> My ejbapp use external library(for example JAX-RPC), and archive
> >> ejbapp.jar
> >> doesn't consist of any jaxrpc*.jar files. For devolipng I use Netbeans.
> >>
> >> At attempt a deploying this ejb, I receive messages such that:
> >>
> >> ...
> >> 14:25:33,666 INFO [config] Configuring app:
> >> default/hellobean/1198697132606/jar
> >> 14:25:33,827 ERROR [Deployer] Deployment failed due to
> >> java.lang.NoClassDefFoundError: Lcom/sun/activation/viewers/TextViewer;
> >> at java.lang.Class.getDeclaredFields0(Native Method)
> >> at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
> >> at java.lang.Class.getDeclaredFields(Class.java:1743)
> >> ...
> >>
> >> ejb-business-part is:
> >>
> >> package hellopack;
> >>
> >> import javax.ejb.Stateless;
> >> import com.sun.activation.viewers.TextViewer;
> >>
> >> @Stateless
> >> public class NewSessionBean implements NewSessionRemote, NewSessionLocal
> >> {
> >> /** Creates a new instance of NewSessionBean */
> >>
> >> TextViewer tv;
> >>
> >> public NewSessionBean() {
> >> }
> >>
> >> public String sayHello() {
> >> //TODO implement sayHello
> >> return "Hellqweqweqwo!";
> >> }
> >>
> >> }
> >>
> >> I suppose that to achieve this is to use Common Libs in Services.
> >> How to solve this problem.
> >> --
> >> View this message in context:
> >> http://www.nabble.com/creating-and-deploying-ejb-tp14502180s134p14502180.html
> >> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context: http://www.nabble.com/creating-and-deploying-ejb-tp14502180s134p14504720.html
>
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>
Re: creating and deploying ejb
Posted by SergZ <se...@gmail.com>.
If include all libraries into ear or ejbapp.jar, size if this bean will be so
much(~10Mb). And
I think that it isn't a good idea. Otherwise why there is possibility to
make jar-file without libraries.
I think that one can "install" library into geronimo(Repository with
appropriate Group, Artifact, Version and Type) and declares dependencies in
openejb-jar.xml.
if you or somebody give example if it implementation i'll be very much
obliged to you)
vhnguy2 wrote:
>
> You should package your deployable in the form of an EAR instead of a
> JAR. Inside the EAR, you can have multiple JARs. You should place your
> ejbapp.jar and the jaxrpc*.jar libraries inside this EAR. This way,
> the ejbapp.jar will be able to see classes inside jaxrpc*.jar.
>
> --Viet
>
> On Dec 26, 2007 8:23 AM, SergZ <se...@gmail.com> wrote:
>>
>> Hello. I'm a newbie.
>> My ejbapp use external library(for example JAX-RPC), and archive
>> ejbapp.jar
>> doesn't consist of any jaxrpc*.jar files. For devolipng I use Netbeans.
>>
>> At attempt a deploying this ejb, I receive messages such that:
>>
>> ...
>> 14:25:33,666 INFO [config] Configuring app:
>> default/hellobean/1198697132606/jar
>> 14:25:33,827 ERROR [Deployer] Deployment failed due to
>> java.lang.NoClassDefFoundError: Lcom/sun/activation/viewers/TextViewer;
>> at java.lang.Class.getDeclaredFields0(Native Method)
>> at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
>> at java.lang.Class.getDeclaredFields(Class.java:1743)
>> ...
>>
>> ejb-business-part is:
>>
>> package hellopack;
>>
>> import javax.ejb.Stateless;
>> import com.sun.activation.viewers.TextViewer;
>>
>> @Stateless
>> public class NewSessionBean implements NewSessionRemote, NewSessionLocal
>> {
>> /** Creates a new instance of NewSessionBean */
>>
>> TextViewer tv;
>>
>> public NewSessionBean() {
>> }
>>
>> public String sayHello() {
>> //TODO implement sayHello
>> return "Hellqweqweqwo!";
>> }
>>
>> }
>>
>> I suppose that to achieve this is to use Common Libs in Services.
>> How to solve this problem.
>> --
>> View this message in context:
>> http://www.nabble.com/creating-and-deploying-ejb-tp14502180s134p14502180.html
>> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/creating-and-deploying-ejb-tp14502180s134p14504720.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: creating and deploying ejb
Posted by Viet Nguyen <vh...@gmail.com>.
You should package your deployable in the form of an EAR instead of a
JAR. Inside the EAR, you can have multiple JARs. You should place your
ejbapp.jar and the jaxrpc*.jar libraries inside this EAR. This way,
the ejbapp.jar will be able to see classes inside jaxrpc*.jar.
--Viet
On Dec 26, 2007 8:23 AM, SergZ <se...@gmail.com> wrote:
>
> Hello. I'm a newbie.
> My ejbapp use external library(for example JAX-RPC), and archive ejbapp.jar
> doesn't consist of any jaxrpc*.jar files. For devolipng I use Netbeans.
>
> At attempt a deploying this ejb, I receive messages such that:
>
> ...
> 14:25:33,666 INFO [config] Configuring app:
> default/hellobean/1198697132606/jar
> 14:25:33,827 ERROR [Deployer] Deployment failed due to
> java.lang.NoClassDefFoundError: Lcom/sun/activation/viewers/TextViewer;
> at java.lang.Class.getDeclaredFields0(Native Method)
> at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
> at java.lang.Class.getDeclaredFields(Class.java:1743)
> ...
>
> ejb-business-part is:
>
> package hellopack;
>
> import javax.ejb.Stateless;
> import com.sun.activation.viewers.TextViewer;
>
> @Stateless
> public class NewSessionBean implements NewSessionRemote, NewSessionLocal {
> /** Creates a new instance of NewSessionBean */
>
> TextViewer tv;
>
> public NewSessionBean() {
> }
>
> public String sayHello() {
> //TODO implement sayHello
> return "Hellqweqweqwo!";
> }
>
> }
>
> I suppose that to achieve this is to use Common Libs in Services.
> How to solve this problem.
> --
> View this message in context: http://www.nabble.com/creating-and-deploying-ejb-tp14502180s134p14502180.html
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>