geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thebugslayer <thebugsla...@gmail.com>
Subject Re: deploying minimal gbean jar file
Date Mon, 10 Sep 2007 18:16:28 GMT
Hooray! It works this time. Thanks Viet!

Correction on one of the command your send though:
javac -classpath <geronimo_home>/lib/geronimo- kernel-2.0.1.jar
example1/MyGBean.jar

should be:
javac -classpath <geronimo_home>/lib/geronimo- kernel-2.0.1.jar
example1/MyGBean.java

I think my previous attempt failed because my jar wasn't packaged
correctly along with it's package name, and thus resulted in not able
to find the class.

Thanks for everyone's help... Now I can move on to explore more on GBean.

I will try to contribute on updating the doc when time is allow.
Cheers,
Zemian

On 9/10/07, Viet Nguyen <vhnguy2@gmail.com> wrote:
> Try this:
>
> NOTE: this file is in the folder labeled "example1"
>
> ====example1/MyGBean.java====
>   1 package example1;
>   2
>   3 import org.apache.geronimo.gbean.GBeanInfo;
>   4 import org.apache.geronimo.gbean.GBeanInfoBuilder ;
>   5
>   6 public class MyGBean {
>   7
>   8     public static final GBeanInfo GBEAN_INFO;
>   9
>  10     static {
>  11         GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder("MyGBean",
> MyGBean.class );
>  12         GBEAN_INFO = infoBuilder.getBeanInfo();
>  13     }
>  14
>  15     public static GBeanInfo getGBeanInfo() {
>  16         return GBEAN_INFO;
>  17     }
>  18 }
>
> ====mygbean.xml====
>   1 <?xml version=" 1.0" encoding="UTF-8"?>
>   2 <module
> xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
>   3     <environment>
>   4         <moduleId>
>   5             <groupId>example1</groupId>
>   6             <artifactId>MyGBean</artifactId>
>   7             <version>1.0</version>
>   8             <type>jar</type>
>   9         </moduleId>
>  10     </environment>
>  11     <gbean name="MySimpleGBean" class="example1.MyGBean"/>
>  12 </module>
>
> 1. Execute these commands
> javac -classpath <geronimo_home>/lib/geronimo- kernel-2.0.1.jar
> example1/MyGBean.jar
> jar -cvf mygbean.jar example1/*.class
>
> 2. Run the server
>
> 3. Execute this command from <geronimo_home>/bin dir
> java -jar ./deployer.jar -u system -p manager deploy
> <mygbeanDir>/mygbean.jar <mygbeanDir>/mygbean.xml
>
> I hope this works for you,
> Viet
>


-- 
/bugslayer

Mime
View raw message