2

NOTE: I was using Maven 3+, see the comments.

I am trying to compile a project using Maven coupled with WAS7 but unfortunately seem to be receiving the following error:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[ERROR] Error executing Maven.
[ERROR] com.google.inject.ProvisionException: Guice provision errors:

1) Error in custom provider, java.lang.TypeNotPresentException: Type javax.enterprise.inject.Typed not present
  at ClassRealm[plexus.core, parent: null]
  at ClassRealm[plexus.core, parent: null]
  while locating org.sonatype.plexus.components.cipher.PlexusCipher
  while locating org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher
  at ClassRealm[plexus.core, parent: null]
  at ClassRealm[plexus.core, parent: null]
  while locating org.sonatype.plexus.components.sec.dispatcher.SecDispatcher annotated with @com.google.inject.name.Named(value=maven)
  while locating org.apache.maven.settings.crypto.DefaultSettingsDecrypter
  at ClassRealm[plexus.core, parent: null]
  at ClassRealm[plexus.core, parent: null]
  while locating org.apache.maven.settings.crypto.SettingsDecrypter
  while locating org.apache.maven.repository.legacy.LegacyRepositorySystem
  at ClassRealm[plexus.core, parent: null]
  at ClassRealm[plexus.core, parent: null]
  while locating org.apache.maven.repository.RepositorySystem
  while locating org.apache.maven.project.DefaultProjectBuildingHelper
  at ClassRealm[plexus.core, parent: null]
  at ClassRealm[plexus.core, parent: null]
  while locating org.apache.maven.project.ProjectBuildingHelper
  while locating org.apache.maven.project.DefaultProjectBuilder
  at ClassRealm[plexus.core, parent: null]
  at ClassRealm[plexus.core, parent: null]
  while locating org.apache.maven.project.ProjectBuilder
  while locating org.apache.maven.DefaultMaven
  at ClassRealm[plexus.core, parent: null]
  at ClassRealm[plexus.core, parent: null]
  while locating org.apache.maven.Maven

1 error
      role: org.apache.maven.Maven
  roleHint: 
[ERROR] Caused by: Guice provision errors:

1) Error in custom provider, java.lang.TypeNotPresentException: Type javax.enterprise.inject.Typed not present
  at ClassRealm[plexus.core, parent: null]
  at ClassRealm[plexus.core, parent: null]
  while locating org.sonatype.plexus.components.cipher.PlexusCipher
  while locating org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher
  at ClassRealm[plexus.core, parent: null]
  at ClassRealm[plexus.core, parent: null]
  while locating org.sonatype.plexus.components.sec.dispatcher.SecDispatcher annotated with @com.google.inject.name.Named(value=maven)
  while locating org.apache.maven.settings.crypto.DefaultSettingsDecrypter
  at ClassRealm[plexus.core, parent: null]
  at ClassRealm[plexus.core, parent: null]
  while locating org.apache.maven.settings.crypto.SettingsDecrypter
  while locating org.apache.maven.repository.legacy.LegacyRepositorySystem
  at ClassRealm[plexus.core, parent: null]
  at ClassRealm[plexus.core, parent: null]
  while locating org.apache.maven.repository.RepositorySystem
  while locating org.apache.maven.project.DefaultProjectBuildingHelper
  at ClassRealm[plexus.core, parent: null]
  at ClassRealm[plexus.core, parent: null]
  while locating org.apache.maven.project.ProjectBuildingHelper
  while locating org.apache.maven.project.DefaultProjectBuilder
  at ClassRealm[plexus.core, parent: null]
  at ClassRealm[plexus.core, parent: null]
  while locating org.apache.maven.project.ProjectBuilder
  while locating org.apache.maven.DefaultMaven
  at ClassRealm[plexus.core, parent: null]
  at ClassRealm[plexus.core, parent: null]
  while locating org.apache.maven.Maven

1 error
[ERROR] Caused by: Type javax.enterprise.inject.Typed not present
[ERROR] Caused by: javax.enterprise.inject.Typed

I have confirmed that the JRE System Library is WAS 7 by checking that it is JavaSE-1.6 which in my case points to WAS7.

I have tried looking for javax.enterprise.inject.Typed and it doesn't seem to appear anywhere, but it is a part of JavaEE6, which is what (I think) WAS 7 is built off of.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Jakub
  • 61
  • 2
  • 8
  • 6
    WAS7 only supports Java EE 5, not Java EE 6. So you won't have any luck with it. – SpaceTrucker Mar 24 '14 at 13:36
  • I see, thanks! I guess I made a typo looking up the environment. I don't seem to be explicitly including guice anywhere though.. Which really confuses me.. – Jakub Mar 24 '14 at 13:40
  • Could it be a transitive dependency? Try `mvn dependency:tree` to see where it comes from. – Ian McLaird Mar 24 '14 at 13:58
  • I'm beginning to suspect it's version of maven I am using itself, after some additional googling I discovered than Maven 3+ uses guice for dependency injection as opposed to plexus. It's kind of a last resort thing, but I'm going to try to bring maven back down to 2.2.1 and see what happens. – Jakub Mar 24 '14 at 14:10
  • I have confirmed my suspicions, switching to maven 2.2.1 resolves the issue! I will update the answer as such. – Jakub Mar 24 '14 at 14:19

3 Answers3

2

So essentially what happened is I was using an embedded version of Maven packaged with myeclipse.

This version of maven is v3.0.4 which uses guice as opposed to plexus in order to inject dependencies. Guice uses components of JavaEE6 which do not exist in JavaEE5 which is extended by WAS7.

So essentially to resolve this issue point to

Jakub
  • 61
  • 2
  • 8
0

SpaceTrucker's comment is spot on. The missing class is part of JavaEE 6, and WAS7 only supports JavaEE 5. For a feature comparison, see The Wikipedia entry

Ian McLaird
  • 5,507
  • 2
  • 22
  • 31
  • Yeah, I just noticed that, what's strange is that I don't explicitly use guice anywhere. So I'm going to have to figure out which dependencies do I guess. Thanks for your help guys! :) – Jakub Mar 24 '14 at 13:48
0

Go To RAD -> Window -->Preferences-->Maven-->Installations

Add your maven folder path

Now go to project and right click project -->Maven-->Update Project

vaquar khan
  • 10,864
  • 5
  • 72
  • 96