-2

Trying to deploy an application ReportServer on WebSphere Application Server 8.5.5.6 which was running perfectly on apache-tomcat-7.0 but faced the following error :

java.lang.NoSuchMethodError: javax/persistence/Table.indexes()[Ljavax/persistence/Index

Following are the logs. Kindly suggest a solution.

[6/13/17 18:13:07:179 IST] 00000067 LogHelper     Z org.hibernate.jpa.internal.util.LogHelper logPersistenceUnitInformation HHH000204: Processing PersistenceUnitInfo [
    name: reportServerPU
    ...]
[6/13/17 18:13:07:195 IST] 00000067 deprecation   Z org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl populate HHH90000006: Attempted to specify unsupported NamingStrategy via setting [hibernate.ejb.naming_strategy]; NamingStrategy has been removed in favor of the split ImplicitNamingStrategy and PhysicalNamingStrategy; use [hibernate.implicit_naming_strategy] or [hibernate.physical_naming_strategy], respectively, instead.
[6/13/17 18:13:07:357 IST] 00000067 C3P0Connectio Z org.hibernate.c3p0.internal.C3P0ConnectionProvider configure HHH010002: C3P0 using driver: com.microsoft.sqlserver.jdbc.SQLServerDriver at URL: jdbc:sqlserver://10.80.49.34:21443;databaseName=RSReports
[6/13/17 18:13:07:359 IST] 00000067 C3P0Connectio Z org.hibernate.c3p0.internal.C3P0ConnectionProvider configure HHH000046: Connection properties: {user=rm_user, password=****, autocommit=false}
[6/13/17 18:13:07:360 IST] 00000067 C3P0Connectio Z org.hibernate.c3p0.internal.C3P0ConnectionProvider configure HHH000006: Autocommit mode: false
[6/13/17 18:13:07:487 IST] 00000067 C3P0Connectio Z org.hibernate.c3p0.internal.C3P0ConnectionProvider configure HHH000149: JDBC isolation level: <unknown>
[6/13/17 18:13:07:529 IST] 00000067 Dialect       Z org.hibernate.dialect.Dialect <init> HHH000400: Using dialect: net.datenwerke.rs.utils.hibernate.SQLServerDialect
[6/13/17 18:13:07:583 IST] 00000067 EnversService Z org.hibernate.envers.boot.internal.EnversServiceImpl configure Envers integration enabled? : true
[6/13/17 18:13:07:676 IST] 00000067 webapp        E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[GenericServletWrapper]: java.lang.NoSuchMethodError: javax/persistence/Table.indexes()[Ljavax/persistence/Index;
    at org.hibernate.cfg.annotations.EntityBinder.processComplementaryTableDefinitions(EntityBinder.java:1080)
    at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:765)
    at org.hibernate.boot.model.source.internal.annotations.AnnotationMetadataSourceProcessorImpl.processEntityHierarchies(AnnotationMetadataSourceProcessorImpl.java:245)
    at org.hibernate.boot.model.process.spi.MetadataBuildingProcess$1.processEntityHierarchies(MetadataBuildingProcess.java:222)
    at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:265)
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:770)
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:797)
    at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:58)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:152)
    at com.google.inject.persist.jpa.JpaPersistService.start(JpaPersistService.java:91)
    at com.google.inject.persist.PersistFilter.init(PersistFilter.java:77)
    at com.google.inject.servlet.FilterDefinition.init(FilterDefinition.java:114)
    at com.google.inject.servlet.ManagedFilterPipeline.initPipeline(ManagedFilterPipeline.java:98)
    at com.google.inject.servlet.GuiceFilter.init(GuiceFilter.java:172)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:145)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:607)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:514)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper(WebAppFilterManager.java:319)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:392)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:931)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1107)
    at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:939)
    at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:287)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
    at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
    at com.ibm.io.async.AsyncChannelFuture$1.run(AsyncChannelFuture.java:205)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1881)
kk.
  • 3,747
  • 12
  • 36
  • 67
  • 1
    Please refer to the [post](https://stackoverflow.com/questions/20734540/nosuchmethoderror-in-javax-persistence-table-indexesljavax-persistence-index) which might be helpful to solve your issue. – kk. Jun 13 '17 at 13:36
  • Just adding one line with what you want to achieve and add your stacktrace will not give you any answers. People are happy to help but will not find out what your problem is. So pls give more information, so others can help you – Jeroen van Dijk-Jun Jun 13 '17 at 14:04

1 Answers1

0

This type of errors occurs when you have a different from compile time library version during your runtime. Seems that your Websphere server uses JPA lib with version lesser than 2.1 as Table.indexes() appeared firstly in JPA 2.1. This post could be helpful in maintaining the right JPA dependency during the runtime: https://stackoverflow.com/a/34487223/4563745

Vasiliy Vlasov
  • 3,316
  • 3
  • 17
  • 20