• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

.ear/ejb compile time OK, deployment time KO.  RSS feed

 
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a simple .ear.
It has an Ejb module (project) that depends on EjbClient (project).
Ejb project has implementation. EjbClient project has Interfaces

At compile time there is no error BUT at deployment time, there are errors/exception (below log): 1of which is java.lang.NoClassDefFoundError

Need your help. Thanks.

========================================
Code: JDK 1.6. JBoss AS 7.1.1.Final "Brontes"

Ejb project has implementation. EjbClient project has Interfaces



MANIFEST.MF



ejb-jar.xml




EjbClient project has Interfaces


 
author & internet detective
Posts: 39283
727
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The key in that error message is:

Unsupported major.minor version 52.0



This means that you compiled with a later version of Java than you are running with. I believe this one is compiling with Java 8 and running with Java 7. If you are compiling at the command line, you can type javac -target 1.6. If you are using an IDE, the target version of Java is a preference in the properties. If you can't find it, post what you are using to compile/build the ear.
 
H Paul
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apparently what you said is correctly.

But I have only JDK 1.6 on my machine.

Using STS IDE, Preferences, Java, Installed JRE

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

Java SE 6 [1.6.0_65-b14-462]

====

Edited: Just check
Java compiler, compliance level: 1.6
 
H Paul
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Trust but verify.



Thanks Jeanne

I found where the issue is:

1. Create Ear
2. Create Ejb + Add project to an Ear
3. Next screen
Create an Ejb Client JAR module to hold the client interfaces and classes

1. If I selected this option, then the EjbClient.jar will be created.
Here lies the issue: the EjbClient.jar is created with Compile compliance level set to 1.8 ( the STS IDE did it )

2. If I did not choose to create Ejb Client JAR, then there is no issue, the Ejb Project default to 1.6 which caused no issue when I deployed it
 
Jeanne Boyarsky
author & internet detective
Posts: 39283
727
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

H Paul wrote:Here lies the issue: the EjbClient.jar is created with Compile compliance level set to 1.8 ( the STS IDE did it )


I'm glad you found it. That error is very clear that it is a version mismatch issue .
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!