You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Kenji Nakamura <na...@gmail.com> on 2006/03/16 21:29:57 UTC

Custom GBeans deployment in 1.0

Hi,

We've developed several custom GBeans on M5, and now considering to upgrade
to 1.0 release.
I came up with the following questions.

1) configID format changes
According to release note, configID convention has changed between M5 and
1.0 and refer to Wiki site, but I can't find the page mentioning about the
new configID and migration path. Where can I find the information?

2) Offline deployment
The custom GBeans are built in our Maven1.0 scripts, and deploy to Geronimo
with "--offline" option. I noticed the option was dropped, and the future
version will provide offline deployer, but what is the best way to deploy
our custom GBeans in the meanwhile? I tried to use packaging maven plugin
within our build system, but it seems to require the existence of maven
build environment AFAIK. I want to simply extract geronimo distirubution
package, deploy custom GBeans without launching the server, and then
re-package to ship.

3) Custom GBean hot deployment
Is it possible to deploy custom GBeans (such as HSQLDB launcher, custom
security realm, etc.) via hot deployment? Preferably, I'd like to package
the GBean into one file just like WAR or JAR (I guess CAR is for that
purpose?).

4) CAR file
Relating to 3), I'm interested in CAR format, but can't find the document
about it. Would you give me the pointer?

5) Future migration cost
Do you expect any major modification on custom GBean when upgrading to the
future version such as 1.1? If that's the case, I'll also consider the
option to skip to migrate to 1.0, and wait for another release.

Thanks in advance,

--
Kenj Nakamura

Re: Custom GBeans deployment in 1.0

Posted by Kenji Nakamura <na...@gmail.com>.
Aaron,

Here is the error message when I copy the plan to deploy directory. It
works fine if I deploy it via deployer utility. I attach the plan
file.

22:24:12,992 WARN  [DirectoryMonitor] Unable to calculate module ID
for module /Users/kenjin/palamida/p4/engineering/sandbox/kenjin/ipamp/trunk/assembly/assembly-server/target/assembly/deploy/gbean-plan.xml
[/Users/kenjin/palamida/p4/engineering/sandbox/kenjin/ipamp/trunk/assembly/assembly-server/target/assembly/deploy/gbean-plan.xml
is neither a JAR file nor a directory!]
22:24:17,004 INFO  [Hot Deployer] Deploying gbean-plan.xml
22:24:17,167 ERROR [Hot Deployer] Unable to deploy: Cound not open
module file: /Users/kenjin/palamida/p4/engineering/sandbox/kenjin/ipamp/trunk/assembly/assembly-server/target/assembly/var/temp/geronimo-deployer46436.tmpdir/gbean-plan.xml
org.apache.geronimo.common.DeploymentException: Cound not open module
file: /Users/kenjin/palamida/p4/engineering/sandbox/kenjin/ipamp/trunk/assembly/assembly-server/target/assembly/var/temp/geronimo-deployer46436.tmpdir/gbean-plan.xml
        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:209)
        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:102)
        at org.apache.geronimo.deployment.Deployer$$FastClassByCGLIB$$734a235d.invoke(<generated>)
        at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
        at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
        at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:118)
        at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:835)
        at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:178)
        at org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:106)
        at org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:59)
        at java.lang.Thread.run(Thread.java:552)
Caused by: java.util.zip.ZipException: error in opening zip file
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:111)
        at java.util.jar.JarFile.<init>(JarFile.java:127)
        at java.util.jar.JarFile.<init>(JarFile.java:92)
        at org.apache.geronimo.deployment.util.DeploymentUtil.createJarFile(DeploymentUtil.java:164)
        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:207)
        ... 10 more

I appreciate your insight.

Thanks,

Kenji


On 3/22/06, Aaron Mulder <am...@alumni.princeton.edu> wrote:
> Can you give more details on the error you got when you just copied
> the plan into the deploy directory?  That should work -- it should not
> try to unzip anything that's not an archive file.
>
> Thanks,
>     Aaron
>
> On 3/23/06, Kenji Nakamura <na...@gmail.com> wrote:
> > Aaron,
> >
> > Thank you for your reply. I followed the steps described below, and
> > chose hot deployment option. However, I was confused about the format
> > to deploy plan xml. Putting the xml file into deploy directory didn't
> > work, since deployer tried to unzip in vain. Next, I tried to put
> > "plan.xml" under a directory, and META-INF, but neither didn't work.
> > (i.e. deploy/foo/plan.xml, and deploy/foo/META-INF/plan.xml).
> >
> > How can I deploy a GBean with hot deployer?
> > I'm also wondering if there is a way to control the order of
> > deployment with hot deployment option.
> >
> > Thanks,
> >
> > Kenji
> >
> > > The normal procedure is:
> > >
> > >  - put code in a JAR
> > >  - put the JAR in the repository/ directory
> > >  - write a deployment plan with a <dependency> pointing to the JAR
> > >  - deploy the deployment plan using the hot deploy directory, Maven
> > > deployment tool, command-line deployer tool, or console.  However, in
> > > most of those cases, the server must be running.
> > >
> > > > 3) Custom GBean hot deployment
> > > > Is it possible to deploy custom GBeans (such as HSQLDB launcher, custom
> > > > security realm, etc.) via hot deployment? Preferably, I'd like to package
> > > > the GBean into one file just like WAR or JAR (I guess CAR is for that
> > > > purpose?).
> > >
> > > Yes.  I don't think we support a JAR with embedded service deployment
> > > plan, I think you usually split up the JAR and deployment plan as in
> > > the formula above.  A CAR is not quite that -- as I understand it it
> > > contains a post-processed binary version of the configuration.  If we
> > > don't support a service JAR as such, we probably should.
> >
> >
> > --
> > Kenj Nakamura
> >
>


--
Kenj Nakamura

Re: Custom GBeans deployment in 1.0

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
Can you give more details on the error you got when you just copied
the plan into the deploy directory?  That should work -- it should not
try to unzip anything that's not an archive file.

Thanks,
    Aaron

On 3/23/06, Kenji Nakamura <na...@gmail.com> wrote:
> Aaron,
>
> Thank you for your reply. I followed the steps described below, and
> chose hot deployment option. However, I was confused about the format
> to deploy plan xml. Putting the xml file into deploy directory didn't
> work, since deployer tried to unzip in vain. Next, I tried to put
> "plan.xml" under a directory, and META-INF, but neither didn't work.
> (i.e. deploy/foo/plan.xml, and deploy/foo/META-INF/plan.xml).
>
> How can I deploy a GBean with hot deployer?
> I'm also wondering if there is a way to control the order of
> deployment with hot deployment option.
>
> Thanks,
>
> Kenji
>
> > The normal procedure is:
> >
> >  - put code in a JAR
> >  - put the JAR in the repository/ directory
> >  - write a deployment plan with a <dependency> pointing to the JAR
> >  - deploy the deployment plan using the hot deploy directory, Maven
> > deployment tool, command-line deployer tool, or console.  However, in
> > most of those cases, the server must be running.
> >
> > > 3) Custom GBean hot deployment
> > > Is it possible to deploy custom GBeans (such as HSQLDB launcher, custom
> > > security realm, etc.) via hot deployment? Preferably, I'd like to package
> > > the GBean into one file just like WAR or JAR (I guess CAR is for that
> > > purpose?).
> >
> > Yes.  I don't think we support a JAR with embedded service deployment
> > plan, I think you usually split up the JAR and deployment plan as in
> > the formula above.  A CAR is not quite that -- as I understand it it
> > contains a post-processed binary version of the configuration.  If we
> > don't support a service JAR as such, we probably should.
>
>
> --
> Kenj Nakamura
>

Re: Custom GBeans deployment in 1.0

Posted by Kenji Nakamura <na...@gmail.com>.
Aaron,

Thank you for your reply. I followed the steps described below, and
chose hot deployment option. However, I was confused about the format
to deploy plan xml. Putting the xml file into deploy directory didn't
work, since deployer tried to unzip in vain. Next, I tried to put
"plan.xml" under a directory, and META-INF, but neither didn't work.
(i.e. deploy/foo/plan.xml, and deploy/foo/META-INF/plan.xml).

How can I deploy a GBean with hot deployer?
I'm also wondering if there is a way to control the order of
deployment with hot deployment option.

Thanks,

Kenji

> The normal procedure is:
>
>  - put code in a JAR
>  - put the JAR in the repository/ directory
>  - write a deployment plan with a <dependency> pointing to the JAR
>  - deploy the deployment plan using the hot deploy directory, Maven
> deployment tool, command-line deployer tool, or console.  However, in
> most of those cases, the server must be running.
>
> > 3) Custom GBean hot deployment
> > Is it possible to deploy custom GBeans (such as HSQLDB launcher, custom
> > security realm, etc.) via hot deployment? Preferably, I'd like to package
> > the GBean into one file just like WAR or JAR (I guess CAR is for that
> > purpose?).
>
> Yes.  I don't think we support a JAR with embedded service deployment
> plan, I think you usually split up the JAR and deployment plan as in
> the formula above.  A CAR is not quite that -- as I understand it it
> contains a post-processed binary version of the configuration.  If we
> don't support a service JAR as such, we probably should.


--
Kenj Nakamura

Re: Custom GBeans deployment in 1.0

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
On 3/16/06, Kenji Nakamura <na...@gmail.com> wrote:
> Hi,
>
> We've developed several custom GBeans on M5, and now considering to upgrade
> to 1.0 release.
> I came up with the following questions.
>
> 1) configID format changes
> According to release note, configID convention has changed between M5 and
> 1.0 and refer to Wiki site, but I can't find the page mentioning about the
> new configID and migration path. Where can I find the information?

Between M5 and 1.0, if I remember correctly, we changed the config ID
format used by all the Geronimo configurations (e.g. from
org/apache/geronimo/Server to geronimo/j2ee-server/1.0/car).  However,
this is not a mandatory change for GBeans -- because the Geronimo
names changed you'll need to update any references to core Geronimo
services (e.g. in references or parentId attributes), but your
configurations can still use arbitrary config IDs.

In 1.1, there are changes that will require GBeans to use an updated
deployment plan format with more structured config ID information, so
that will require changes to your config files even if you don't
explicitly refer to Geronimo services.

> 2) Offline deployment
> The custom GBeans are built in our Maven1.0 scripts, and deploy to Geronimo
> with "--offline" option. I noticed the option was dropped, and the future
> version will provide offline deployer, but what is the best way to deploy
> our custom GBeans in the meanwhile? I tried to use packaging maven plugin
> within our build system, but it seems to require the existence of maven
> build environment AFAIK. I want to simply extract geronimo distirubution
> package, deploy custom GBeans without launching the server, and then
> re-package to ship.

The normal procedure is:

 - put code in a JAR
 - put the JAR in the repository/ directory
 - write a deployment plan with a <dependency> pointing to the JAR
 - deploy the deployment plan using the hot deploy directory, Maven
deployment tool, command-line deployer tool, or console.  However, in
most of those cases, the server must be running.

> 3) Custom GBean hot deployment
> Is it possible to deploy custom GBeans (such as HSQLDB launcher, custom
> security realm, etc.) via hot deployment? Preferably, I'd like to package
> the GBean into one file just like WAR or JAR (I guess CAR is for that
> purpose?).

Yes.  I don't think we support a JAR with embedded service deployment
plan, I think you usually split up the JAR and deployment plan as in
the formula above.  A CAR is not quite that -- as I understand it it
contains a post-processed binary version of the configuration.  If we
don't support a service JAR as such, we probably should.

> 4) CAR file
> Relating to 3), I'm interested in CAR format, but can't find the document
> about it. Would you give me the pointer?

Not sure there is one -- maybe on the wiki?

> 5) Future migration cost
> Do you expect any major modification on custom GBean when upgrading to the
> future version such as 1.1? If that's the case, I'll also consider the
> option to skip to migrate to 1.0, and wait for another release.

I think the M5->1.0 change will be smaller than the 1.1->1.1 change,
but I expect them both to require mainly configuration changes, not
GBean code changes.  Dain and David J are working on the biggest 1.1
config ID related features, and can probably give you a more complete
answer.

Thanks,
    Aaron