0 Replies Latest reply on Aug 1, 2011 5:08 AM by Michal Huniewicz

    Arquillian + Hibernate 4 + JBoss 7 Embedded/Remote fails with a NPE

    Michal Huniewicz Newbie

      Hi,

       

      I'm getting the same error as the one described here: http://community.jboss.org/message/618455#618455

       

      It's a NullPointerException in Hibernate at

      See the source code for this class: https://github.com/hibernate/hibernate-core/blob/4.0.0.Beta1/hibernate-core/src/main/java/org/hibernate/engine/transaction/internal/jta/JtaStatusHelper.java

       

      Caused by: java.lang.NullPointerException
          at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:72) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

       

      I tried updating my JBoss 7 to use a newer version of Hibernate (Beta4), but with no luck.

       

      I assume it's something to do with transaction manager being not available.

       

      The code I wrote is available here: https://github.com/m1key/audiolicious/tree/WithJBossIntegrationTests

       

      Below, my deployment method.

       

       

      @Deployment
      public static WebArchive createTestArchive()
      throws IllegalArgumentException, IOException {
      return ShrinkWrap
      .create(WebArchive.class,
      MacOsLibraryWithServiceIT.class.getSimpleName()
      + ".war")
      .addAsWebInfResource(EmptyAsset.INSTANCE,
      ArchivePaths.create("beans.xml"))
      .addAsResource("META-INF/persistence.xml",
      "META-INF/persistence.xml")
      .addClasses(AggregateMapper.class, AggregateTrackMapper.class,
      Album.class, AlbumRepository.class, Artist.class,
      ArtistRepository.class, AudiobookMapper.class,
      AudiobookTo.class, AudiobookToBuilder.class,
      CannotMapTrackValuesException.class,
      DataExtractor.class,
      DefaultEnglishValuesProvider.class,
      DefaultObjectTrackDataHandler.class,
      DefaultSongService.class, EnglishValuesProvider.class,
      I18nDataExtractor.class, JpaAlbumRepository.class,
      JpaArtistRepository.class, JpaSongRepository.class,
      LibraryParser.class, MacOsLibraryWithServiceIT.class,
      NonAggregateTrackMapper.class, NoopHandler.class,
      NoopTrackHandler.class, NullAlbum.class,
      NullArtist.class, NullEntitiesFactory.class,
      ObjectMappingException.class,
      ObjectTrackDataHandler.class, PodcastMapper.class,
      PodcastTo.class, Rating.class, RatingTo.class,
      RawTrackDataCallback.class, RawTrackDataHandler.class,
      Song.class, SongHandler.class, SongMapper.class,
      SongRepository.class, SongService.class, SongTo.class,
      TrackHandler.class, TrackHandlersFactory.class,
      TrackMapper.class, TrackMappersFactory.class,
      TrackTo.class, TrackToType.class, VideoMapper.class,
      VideoTo.class, VtdItunesLibraryParser.class,
      XmlNodeName.class, XmlParseException.class)
      .addAsLibraries(
      DependencyResolvers.use(MavenDependencyResolver.class)
      .loadDependenciesFromPom("pom.xml")
      .exclusions("org.hibernate:*")
      .resolveAsFiles(new ScopeFilter("test")));