Skip to main content

Glassfish won't deploy EJB 3.0 Ear

23 replies [Last post]
Anonymous

Hi all,

I have been deploying an EJB 3.0 project on Sun App server 9.1. I want to upgrade the App server to Glassfish 3.0. The problem I am having is that I am getting the error message below when i tried to deploy the project through the Glassfish portal
What is confusing me is that I have went through the criteria in the error message and my EJB project should be deployable.

Have any of you any ideas how get past this? I have seen the issue on many forums but no one seems to have a valid answer.
Any suggestion are welcome.
Thanks

Exception while deploying the app : java.lang.IllegalArgumentException: Invalid ejb jar xxx-ejb.jar]: it contains zero ejb. Note: 1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or message-driven bean. 2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar. 3. If the jar file contains valid EJBs which are annotated with EJB component level annotations (@Stateless, @Stateful, @MessageDriven, @Singleton), please check server.log to se...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
hzhang_jn
Offline
Joined: 2005-07-22

If the EJB class is annotated with the EJB component annotation as
expected, most likely the annotation processing failed due to some
exception (hint #3 in the error message). Please take a look at
server.log to see what stack trace is. One of the common cases reported
for this is one of the classes that EJB bean class depends on can not be
found/loaded. As we enforced the jar visibility rules in v3, you can try
to deploy the application using the compatibility property to see if it
makes a difference:

asadmin deploy --property compatibility=v2 foo.ear

- Hong

On 11/3/2010 7:19 AM, noreply@java.net wrote:
> Hi all,
>
>
>
> I have been deploying an EJB 3.0 project on Sun App server 9.1. I want to
> upgrade the App server to Glassfish 3.0. The problem I am having is
> that I am
> getting the error message below when i tried to deploy the project
> through
> the Glassfish portal
>
> What is confusing me is that I have went through the criteria in the
> error
> message and my EJB project should be deployable.
>
>
>
> Have any of you any ideas how get past this? I have seen the issue on
> many
> forums but no one seems to have a valid answer.
>
> Any suggestion are welcome.
>
> Thanks
>
>
>
> Exception while deploying the app : java.lang.IllegalArgumentException:
> Invalid ejb jar [nic-bridge-ejb.jar]: it contains zero ejb. Note: 1. A
> valid
> ejb jar requires at least one session, entity (1.x/2.x style), or
> message-driven bean. 2. EJB3+ entity beans (@Entity) are POJOs and please
> package them as library jar. 3. If the jar file contains valid EJBs
> which are
> annotated with EJB component level annotations (@Stateless, @Stateful,
> @MessageDriven, @Singleton), please check server.log to se...
>
>

317 Guest
Offline
Joined: 2010-11-04

Thanks a million for you help.

My logs really don't give much else than I have said..

I see you suggest deploying from the command line. Can I not deploy from the
console?

Anyway, I have tried to deploy using your suggestion and I am not getting
that error message more. I am getting the following:

 

bash-3.00# asadmin deploy --property compatibility=v2 /export/home/xx.ear
com.sun.enterprise.admin.cli.CommandException: remote failure: Exception
while preparing the app : org.glassfish.deployment.common.DeploymentException
Module type not recognized

Again, I haven't got past this after some research. Any ideas?

Again, thanks for your help.
 

heyya99
Offline
Joined: 2010-11-03

Thanks a million for you help.
My logs really don't give much else than I have said..
I see you suggest deploying from the command line. Can I not deploy from the console?
Anyway, I have tried to deploy using your suggestion and I am not getting that error message more. I am getting the following:

bash-3.00# asadmin deploy --property compatibility=v2 /export/home/xx.ear
com.sun.enterprise.admin.cli.CommandException: remote failure: Exception while preparing the app : org.glassfish.deployment.common.DeploymentException
Module type not recognized
Again, I haven't got past this after some research. Any ideas?
Again, thanks for your help.

333 Guest
Offline
Joined: 2010-11-04

In the past, the admin console does not have the ability to allow user set a
property for the deployment. I know they have plans to improve this, not sure
if it's in place or not. If yes, you can use admin console to deploy as well.

From the error message, somehow the server cannot determine the module type
of the application after looking at the contents of the archive. Can you
share the packaging of the application, what's inside the ear and what's
inside each sub module etc? Of course if you could share the application (or
a test case) for us to reproduce the problem from our end, that will be even
more helpful.

Thanks,

- Hong

 

hzhang_jn
Offline
Joined: 2005-07-22

In the past, the admin console does not have the ability to allow user set a property for the deployment. I know they have plans to improve this, not sure if it's in place or not. If yes, you can use admin console to deploy as well.
From the error message, somehow the server cannot determine the module type of the application after looking at the contents of the archive. Can you share the packaging of the application, what's inside the ear and what's inside each sub module etc? Of course if you could share the application (or a test case) for us to reproduce the problem from our end, that will be even more helpful.
Thanks,
- Hong

800 Guest
Offline
Joined: 2010-11-09

Hi again,

 

I have just returned to this issue. In my Glassfish bin folder, I run the
following command:

asadmin deploy --property compatibility=v2 /export/home/xx.ear

I am getting the following error message:

CLI013 Option property does not apply to deploy.

I have had a look at the deploy command switches and i do not see --property.
I don't understand because I was able to run this command and get a different
erro message last time.

Any ideas what I have done since to cause this new error?

When i try to deploy without the --property switch, I gte this:

CLI171 Command deploy failed : Deployment of application failed - Remote host
closed connection during handshake

I didn't this error last time.

I appreciate you help on this matter.
 

heyya99
Offline
Joined: 2010-11-03

Hi again,

I have just returned to this issue. In my Glassfish bin folder, I run the following command:
asadmin deploy --property compatibility=v2 /export/home/xx.ear
I am getting the following error message:
CLI013 Option property does not apply to deploy.
I have had a look at the deploy command switches and i do not see --property. I don't understand because I was able to run this command and get a different erro message last time.
Any ideas what I have done since to cause this new error?
When i try to deploy without the --property switch, I gte this:
CLI171 Command deploy failed : Deployment of application failed - Remote host closed connection during handshake
I didn't this error last time.
I appreciate you help on this matter.

969 Guest
Offline
Joined: 2010-11-09

Ok. I opened a new command window and re-ran the following;

asadmin deploy --property compatibility=v2 /export/home/xx.ear

I'm now not getting the 'CLI013 Option property does not apply to deploy.'
message but am back to getting this:

com.sun.enterprise.admin.cli.CommandException: remote failure: Exception
while preparing the app : org.glassfish.deployment.common.DeploymentException
Module type not recognized.

Still investigating.

heyya99
Offline
Joined: 2010-11-03

Ok. I opened a new command window and re-ran the following;
asadmin deploy --property compatibility=v2 /export/home/xx.ear
I'm now not getting the 'CLI013 Option property does not apply to deploy.' message but am back to getting this:
com.sun.enterprise.admin.cli.CommandException: remote failure: Exception while preparing the app : org.glassfish.deployment.common.DeploymentException
Module type not recognized.
Still investigating.

472 Guest
Offline
Joined: 2010-11-09

Here is the structure of the Ear I'm trying to deploy:

MyApp.ear:
- META-INF        - sun-application.xml
                            - MANIFEST.MF
                            - application.xml
- MyApp.jar
- MyApp.war

530 Guest
Offline
Joined: 2010-11-09

I see. So the property did not help, it's probably some other reason. Could
you share the packaging of your application or share the test case?

heyya99
Offline
Joined: 2010-11-03

Here is the structure of the Ear I'm trying to deploy:
MyApp.ear:

- META-INF - sun-application.xml + MANIFEST.MF + application.xml
- MyApp.jar
- MyApp.war
---------------------------------------
MyApp.jar:

- wsdl
- META-INF - wsdl + MANIFEST.MF
- com
---------------------------------------
MyApp.war:

- jsp
- META-INF - classes + web.xml + sun-web.xml

667 Guest
Offline
Joined: 2010-11-09

yeah, let's start with this information.

What's inside your application.xml?

What is MyApp.jar, is it an ejb jar, does it contain any EJB bean class with
component annotations?

hzhang_jn
Offline
Joined: 2005-07-22

yeah, let's start with this information.
What's inside your application.xml?
What is MyApp.jar, is it an ejb jar, does it contain any EJB bean class with component annotations?

677 Guest
Offline
Joined: 2010-11-09

  MyApp
-
-
  MyApp.war
  /MyApp
 
 
-
  MyApp-ejb.jar
 
 

Yes, I forgot to add the -ejb part to the .jar title. MyApp-ejb.jar contains
ejb beans with annotations. It has @Stateless beans.

heyya99
Offline
Joined: 2010-11-03

application.xml:

<display-name>MyApp</display-name>
- <module>
- <web>
<web-uri>MyApp.war</web-uri>
<context-root>/MyApp</context-root>
</web>
</module>
- <module>
<ejb>MyApp-ejb.jar</ejb>
</module>
</application>
Yes, I forgot to add the -ejb part to the .jar title. MyApp-ejb.jar contains ejb beans with annotations. It has @Stateless session beans.

hzhang_jn
Offline
Joined: 2005-07-22

I see. So the property did not help, it's probably some other reason. Could you share the packaging of your application or share the test case?

892 Guest
Offline
Joined: 2010-11-09

I the above information ok? My application is huge so I cannot really
elaborate much more..

heyya99
Offline
Joined: 2010-11-03

I the above information ok? My application is huge so I cannot really elaborate much more..

heyya99
Offline
Joined: 2010-11-03

Joined: 2010-11-03
Points: 0

application.xml:
<display-name>MyApp</display-name>
- <module>
- <web>
<web-uri>MyApp.war</web-uri>
<context-root>/MyApp</context-root>
</web>
</module>
- <module>
<ejb>MyApp-ejb.jar</ejb>
</module>
</application>
Yes, I forgot to add the -ejb part to the .jar title. MyApp-ejb.jar contains ejb beans with annotations. It has @Stateless session beans.
I tried amending the application.xml and the sun-application.xml in the ear file but the outcome is the same.

heyya99
Offline
Joined: 2010-11-03

Am I correct in saying that using the compatibility option is basically turning off some checks that occur in GF3, so I am basically using GF2? I don't believe i should have to do this.
I am currently using Sun App server 9 and I am investigating to see if a move up to GF3 would be worthwhile and not too disruptive. I am beginning to think that it is not worth it. I am spending too much time on the upgrade as it is with much success.

687 Guest
Offline
Joined: 2010-11-10

No, the property is used to support the backward compatibility of the jar
visibility. Th v3 is enforcing the jar visibility rules defined in the
JavaEE 6 spec. For example, the jars at the ear root level should not be
automatically visible to the sub modules, but as these used to work in v2, we
put in this property to support the product backward compatibility of it.

In any case, in your application, if you have a top level
META-INF/application.xml which clearly defines the two modules in the ear, I
am not sure why you would get that error. Any other exceptions in the
server.log?

hzhang_jn
Offline
Joined: 2005-07-22

No, the property is used to support the backward compatibility of the jar visibility. Th v3 is enforcing the jar visibility rules defined in the JavaEE 6 spec. For example, the jars at the ear root level should not be automatically visible to the sub modules, but as these used to work in v2, we put in this property to support the product backward compatibility of it.
In any case, in your application, if you have a top level META-INF/application.xml which clearly defines the two modules in the ear, I am not sure why you would get that error. Any other exceptions in the server.log?