Search This Blog

2009-11-01

Netbeans, Maven, JavaEE, new snapshot version problem

Hi guys,
instead of celebrating Halloween I struggled with a problem building my maven based javaEE Trainer application in Netbeans 6.7.1. A few minutes ago, I finally found out what was wrong. The problem I am telling you took me about 3 hours to fix...grrrr

So, what was the problem?
I have an Ear project, consisting of a web project, an ejb project and a jar project, all maven projects created with Netbeans.
When I changed the IceFaces Libraries of the web project I also updated all of the projects pom.xml files, as I created a new snapshot version.
From this point on, I wasn't able to deploy/publish the application anymore! The error message I received was: invalid ejb jar it contains zero ejb

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), please check
server.log to see whether the annotations were processed properly.


The problem was, that I forgot updating the application.xml within the EAR project. In it, I was still using the older snapshot version of the EJB project. So in my projects target folder, the gfdeploy folder had both the older and the latest snapshot version, which made publishing to glassfish impossible. So never forget to update both your poms and your applicationx.xml, if you are creating a new snaphot version!

Enjoy your weekend!
Daniel

No comments:

Post a Comment