I have a maven dependency for javaee Bibliothek.
java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/mail/MessagingException
It doesn't work because classes from
javax/javaee-api/provided dependency are specially constructed. They are not usable runtime because implementation of methods is missing.
Simply adding classes from
javax.mail/mail/1.4.5 dependency to the classpath does not help, because classes from
javax/javaee-api/provided are already there. Having
javax.mail/mail/1.4.5 dependecy alone solves your problem, but most likely you also need other classes from
What you can do is to get rid of
javax/javaee-api/provided dependency and get these classes for example from the dependencies provided by target application server. You can use for example following:
<dependency> <groupId>org.jboss.spec</groupId> <artifactId>jboss-javaee-6.0</artifactId> <version>1.0.0.Final</version> <type>pom</type> <scope>provided</scope> </dependency>
Because scope is provided, it does not affect the artifact to be built. That's why you can use this one also with other application servers than JBoss. It is same API as in your original dependency, but it contains normal classes.