Hibernate mapping exception

222 views
Skip to first unread message

netma...@gmail.com

unread,
Oct 20, 2018, 1:21:19 AM10/20/18
to jPOS Users
Hi,

I have created one Restful jpos projects using jetty, hibernate and jpos ee. 
I am able to start my q2 and able to hit to my webservice. However when i tried to fetch the data from database table, i received the below exception of "can not be cast"
Kindly check below q2 logs for more details

test@PC-32:~/Documents/myprojects/RestTest/build/install/RestTest$ bin/q2
<log realm="Q2.system" at="2018-10-20T02:10:23.007">
  <info>
    Q2 started, deployDir=/home/test/Documents/myprojects/RestTest/build/install/RestTest/deploy
  </info>
</log>
<log realm="Q2.system" at="2018-10-20T02:10:23.426" lifespan="412ms">
  <version>
    jPOS 2.1.2-SNAPSHOT master/759ae1e (2018-09-18 17:31:27 UTC)
RestTest 1.0.0 unknown/unknown (2018-10-20 10:40:16 IST)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

jPOS Community Edition, licensed under GNU AGPL v3.0.
This software is probably not suitable for commercial use.
Please see http://jpos.org/license for details.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iQEcBAEBAgAGBQJMolHDAAoJEOQyeO71nYtFv74H/3OgehDGEy1VXp2U3/GcAobg
HH2eZjPUz53r38ARPiU3pzm9LwDa3WZgJJaa/b9VrJwKvbPwe9+0kY3gScDE1skT
ladHt+KHHmGQArEutkzHlpZa73RbroFEIa1qmN6MaDEHGoxZqDh0Sv2cpvOaVYGO
St8ZaddLBPC17bSjAPWo9sWbvL7FgPFOHhnPmbeux8SLtnfWxXWsgo5hLBanKmO1
1z+I/w/6DL6ZYZU6bAJUk+eyVVImJqw0x3IEElI07Nh9MC6BA4iJ77ejobj8HI2r
q9ulRPEqH9NR79619lNKVUkE206dVlXo7xHmJS1QZy5v/GT66xBxyDVfTduPFXk=
=oP+v
-----END PGP SIGNATURE-----

  </version>
</log>
<log realm="slf4j::org.eclipse.jetty.util.log" at="2018-10-20T02:10:23.445">
  <info>
    Logging initialized @818ms to org.eclipse.jetty.util.log.Slf4jLog
  </info>
</log>
<log realm="slf4j::org.eclipse.jetty.util.log" at="2018-10-20T02:10:23.519">
  <warn>
    setDebugEnabled not implemented
  </warn>
</log>
<log realm="Q2.system" at="2018-10-20T02:10:23.546" lifespan="118ms">
  <info>
    deploy: /home/test/Documents/myprojects/RestTest/build/install/RestTest/deploy/90_jetty.xml
  </info>
</log>
<log realm="Q2.system" at="2018-10-20T02:10:23.552" lifespan="5ms">
  <info>
    deploy: /home/test/Documents/myprojects/RestTest/build/install/RestTest/deploy/99_sysmon.xml
  </info>
</log>
<log realm="slf4j::org.eclipse.jetty.server.Server" at="2018-10-20T02:10:23.554">
  <info>
    jetty-9.4.5.v20170502
  </info>
</log>
<log realm="slf4j::org.eclipse.jetty.deploy.providers.ScanningAppProvider" at="2018-10-20T02:10:23.565">
  <info>
    Deployment monitor [file:///home/test/Documents/myprojects/RestTest/build/install/RestTest/webapps/] at interval 1
  </info>
</log>
<log realm="slf4j::org.eclipse.jetty.annotations.AnnotationConfiguration" at="2018-10-20T02:10:23.664">
  <info>
    Scanning elapsed time=0ms
  </info>
</log>
<log realm="slf4j::org.eclipse.jetty.webapp.StandardDescriptorProcessor" at="2018-10-20T02:10:23.669">
  <info>
    NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
  </info>
</log>
<log realm="slf4j::org.eclipse.jetty.server.session" at="2018-10-20T02:10:23.719">
  <info>
    DefaultSessionIdManager workerName=node0
  </info>
</log>
<log realm="slf4j::org.eclipse.jetty.server.session" at="2018-10-20T02:10:23.719">
  <info>
    No SessionScavenger set, using defaults
  </info>
</log>
<log realm="slf4j::org.eclipse.jetty.server.session" at="2018-10-20T02:10:23.720">
  <info>
    Scavenging every 660000ms
  </info>
</log>
<log realm="slf4j::org.eclipse.jetty.server.handler.ContextHandler" at="2018-10-20T02:10:23.782">
  <info>
    Started o.e.j.w.WebAppContext@66c95454{/,file:///home/test/Documents/myprojects/RestTest/build/install/RestTest/webapps/root/,AVAILABLE}{/root}
  </info>
</log>
<log realm="slf4j::org.eclipse.jetty.annotations.AnnotationConfiguration" at="2018-10-20T02:10:24.231">
  <info>
    Scanning elapsed time=365ms
  </info>
</log>
<log realm="slf4j::org.eclipse.jetty.webapp.StandardDescriptorProcessor" at="2018-10-20T02:10:24.252">
  <info>
    NO JSP Support for /MyTest, did not find org.apache.jasper.servlet.JspServlet
  </info>
</log>
<log realm="slf4j::org.eclipse.jetty.server.handler.ContextHandler" at="2018-10-20T02:10:24.958">
  <info>
    Started o.e.j.w.WebAppContext@6bdcc566{/MyTest,file:///tmp/jetty-0.0.0.0-8080-RestTest-1.0.0.war-_RestTest-1.0.0-any-2722819249154261467.dir/webapp/,AVAILABLE}{/@warname@}
  </info>
</log>
<log realm="slf4j::org.eclipse.jetty.server.AbstractConnector" at="2018-10-20T02:10:24.964">
  <info>
    Started ServerConnector@771ab8b1{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
  </info>
</log>
<log realm="slf4j::org.eclipse.jetty.util.ssl.SslContextFactory" at="2018-10-20T02:10:24.967">
  <info>
    x509=X509@2753fc99(jetty,h=[jpos.org],w=[]) for SslContextFactory@341dd082(file:///home/test/Documents/myprojects/RestTest/src/dist/cfg/keystore.jks,null)
  </info>
</log>
<log realm="slf4j::org.eclipse.jetty.server.AbstractConnector" at="2018-10-20T02:10:24.973">
  <info>
    Started ServerConnector@81c34a6{SSL,[ssl, http/1.1]}{0.0.0.0:8443}
  </info>
</log>
<log realm="slf4j::org.eclipse.jetty.server.Server" at="2018-10-20T02:10:24.973">
  <info>
    Started @2347ms
  </info>
</log>
<log realm="org.jpos.q2.qbean.SystemMonitor" at="2018-10-20T02:10:24.974">
  <info>
    Starting SystemMonitor
  </info>
</log>
<log realm="org.jpos.q2.qbean.SystemMonitor" at="2018-10-20T02:10:24.974">
  <info>
               OS: Linux (4.4.0-130-generic)
             Java: 1.8.0_181 (Oracle Corporation) AES-secure
     process name: 7294@PC-32
        user name: test
             host: PC-32/127.0.1.1
              cwd: /home/test/Documents/myprojects/RestTest/build/install/RestTest
       free space: 852.6 GiB
     usable space: 806.6 GiB
          version: 2.1.2-SNAPSHOT (759ae1e)
         instance: 9638ef03-4597-4b86-a74d-9c2e338611b3
           uptime: 00:00:02.203 (1.730000)
       processors: 4
           drift : 0
    memory(t/u/f): 119/45/74
         encoding: UTF-8
         timezone: GMT-03:00 (GMT-03:00) -03:00
    watch service: sun.nio.fs.LinuxWatchService
            clock: 1540012225 2018-10-20T05:10:24.975Z
     thread count: 39
     peak threads: 39
     user threads: 36
            Thread[Reference Handler,10,system]
            Thread[Finalizer,8,system]
            Thread[Signal Dispatcher,9,system]
            Thread[pool-1-thread-1,5,main]
            Thread[Q2-9638ef03-4597-4b86-a74d-9c2e338611b3,5,main]
            Thread[DestroyJavaVM,5,main]
            Thread[Thread-1,5,main]
            Thread[Timer-0,5,main]
            Thread[org.eclipse.jetty.util.RolloverFileOutputStream,5,main]
            Thread[qtp1508273693-19,5,main]
            Thread[qtp1508273693-20-acceptor-0@37c9f0ff-ServerConnector@81c34a6{SSL,[ssl, http/1.1]}{0.0.0.0:8443},3,main]
            Thread[qtp1508273693-21,5,main]
            Thread[qtp1508273693-22,5,main]
            Thread[qtp1508273693-23,5,main]
            Thread[qtp1508273693-24,5,main]
            Thread[qtp1508273693-25,5,main]
            Thread[qtp1508273693-26-acceptor-0@687bae47-ServerConnector@771ab8b1{HTTP/1.1,[http/1.1]}{0.0.0.0:8080},3,main]
            Thread[qtp1508273693-27,5,main]
            Thread[qtp1508273693-28,5,main]
            Thread[Scheduler-1431386074,5,main]
            Thread[HttpClient@805433679-30,5,main]
            Thread[HttpClient@805433679-31,5,main]
            Thread[HttpClient@805433679-32,5,main]
            Thread[HttpClient@805433679-33,5,main]
            Thread[HttpClient@805433679-34,5,main]
            Thread[HttpClient@805433679-35,5,main]
            Thread[HttpClient@805433679-36,5,main]
            Thread[HttpClient@805433679-37,5,main]
            Thread[HttpClient@2146286950-38,5,main]
            Thread[HttpClient@2146286950-39,5,main]
            Thread[HttpClient@2146286950-40,5,main]
            Thread[HttpClient@2146286950-41,5,main]
            Thread[HttpClient@2146286950-42,5,main]
            Thread[HttpClient@2146286950-43,5,main]
            Thread[HttpClient@2146286950-44,5,main]
            Thread[HttpClient@2146286950-45,5,main]
            Thread[pool-3-thread-1,5,main]
            Thread[Scanner-0,5,main]
            Thread[SystemMonitor,5,main]
    name-registrar:
      Q2: org.jpos.q2.Q2
      logger.Q2: org.jpos.util.Logger
      logger.Q2.buffered: org.jpos.util.BufferedLogListener
  </info>
</log>
<log realm="stderr" at="2018-10-20T02:10:25.455" lifespan="501ms">
    Oct 20, 2018 2:10:24 AM org.glassfish.jersey.internal.Errors logErrors
    WARNING: The following warnings have been detected: WARNING: A HTTP GET method, public javax.ws.rs.core.Response com.iz.RestTest.controller.TxnController.echoGet(java.lang.String), should not consume any entity.
    
</log>
<log realm="slf4j::com.mchange.v2.log.MLog" at="2018-10-20T02:10:51.983">
  <info>
    MLog clients using slf4j logging.
  </info>
</log>
<log realm="slf4j::com.mchange.v2.c3p0.C3P0Registry" at="2018-10-20T02:10:52.042">
  <info>
    Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10]
  </info>
</log>
<log realm="slf4j::com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource" at="2018-10-20T02:10:52.091">
  <info>
    Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@e3b5cf91 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@a41e7782 [ acquireIncrement -> 3, acquireRetryAttempts -> 4, acquireRetryDelay -> 4, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, debugUnreturnedConnectionStackTraces -> false, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, identityToken -> z8kfsx9y13x7jhilzrfgv|2a34950b, idleConnectionTestPeriod -> 3000, initialPoolSize -> 2, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 1, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 2, maxStatements -> 300, maxStatementsPerConnection -> 0, minPoolSize -> 2, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@87392d76 [ description -> null, driverClass -> null, factoryClassLocation -> null, forceUseNamedDriverClass -> false, identityToken -> z8kfsx9y13x7jhilzrfgv|4254514e, jdbcUrl -> jdbc:mysql://192.168.1.7:3306/zealcimdev_usmgmt?autoReconnect=true, properties -> {user=******, password=******} ], preferredTestQuery -> select 1, privilegeSpawnedThreads -> false, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false; userOverrides: {} ], dataSourceName -> null, extensions -> {}, factoryClassLocation -> null, identityToken -> z8kfsx9y13x7jhilzrfgv|3fb15a56, numHelperThreads -> 3 ]
  </info>
</log>
<log realm="stderr" at="2018-10-20T02:10:52.116" lifespan="502ms">
    Oct 20, 2018 2:10:51 AM org.hibernate.Version logVersion
    INFO: HHH000412: Hibernate Core {5.2.17.Final}
    Oct 20, 2018 2:10:51 AM org.hibernate.cfg.Environment <clinit>
    INFO: HHH000206: hibernate.properties not found
    Oct 20, 2018 2:10:51 AM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
    INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
    Oct 20, 2018 2:10:51 AM org.hibernate.c3p0.internal.C3P0ConnectionProvider configure
    INFO: HHH010002: C3P0 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://192.168.1.7:3306/dev_usmgmt?autoReconnect=true
    Oct 20, 2018 2:10:51 AM org.hibernate.c3p0.internal.C3P0ConnectionProvider configure
    INFO: HHH10001001: Connection properties: {user=IZ, password=****}
    Oct 20, 2018 2:10:51 AM org.hibernate.c3p0.internal.C3P0ConnectionProvider configure
    INFO: HHH10001003: Autocommit mode: false
    Oct 20, 2018 2:10:51 AM org.hibernate.c3p0.internal.C3P0ConnectionProvider warnPropertyConflict
    WARN: HHH010001: Both hibernate-style property 'hibernate.c3p0.idle_test_period' and c3p0-style property 'hibernate.c3p0.idleConnectionTestPeriod' have been set in Hibernate properties.  Hibernate-style property 'hibernate.c3p0.idle_test_period' will be used and c3p0-style property 'hibernate.c3p0.idleConnectionTestPeriod' will be ignored!
    Oct 20, 2018 2:10:52 AM org.hibernate.c3p0.internal.C3P0ConnectionProvider configure
    INFO: HHH10001007: JDBC isolation level: READ_COMMITTED
</log>
<log realm="slf4j::net.sf.ehcache.config.ConfigurationFactory" at="2018-10-20T02:10:52.514">
  <warn>
    No configuration found. Configuring ehcache from ehcache-failsafe.xml  found in the classpath: jar:file:/home/test/Documents/myprojects/RestTest/build/install/RestTest/lib/ehcache-2.10.3.jar!/ehcache-failsafe.xml
  </warn>
</log>
<log realm="stderr" at="2018-10-20T02:10:52.758" lifespan="500ms">
    Oct 20, 2018 2:10:52 AM org.hibernate.dialect.Dialect <init>
    INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
    Oct 20, 2018 2:10:52 AM org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl useContextualLobCreation
    INFO: HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
    Oct 20, 2018 2:10:52 AM org.hibernate.envers.boot.internal.EnversServiceImpl configure
    INFO: Envers integration enabled? : true
    Oct 20, 2018 2:10:52 AM org.hibernate.cache.ehcache.AbstractEhcacheRegionFactory getCache
    WARN: HHH020003: Could not find a specific ehcache configuration for cache named [org.hibernate.cache.spi.UpdateTimestampsCache]; using defaults.
    Oct 20, 2018 2:10:52 AM org.hibernate.cache.spi.UpdateTimestampsCache <init>
    INFO: HHH000250: Starting update timestamps cache at region: org.hibernate.cache.spi.UpdateTimestampsCache
    Oct 20, 2018 2:10:52 AM org.hibernate.cache.ehcache.AbstractEhcacheRegionFactory getCache
    WARN: HHH020003: Could not find a specific ehcache configuration for cache named [org.hibernate.cache.internal.StandardQueryCache]; using defaults.
    Oct 20, 2018 2:10:52 AM org.hibernate.cache.internal.StandardQueryCache <init>
    INFO: HHH000248: Starting query cache at region: org.hibernate.cache.internal.StandardQueryCache
</log>
<log realm="TxnHistoryService" at="2018-10-20T02:10:52.934">
  <error>
    Exception while fetching txn history for fiidI0005 and exceptions are java.lang.ClassCastException: com.iz.RestTest.dao.model.TXNHistoryMaster cannot be cast to com.iz.RestTest.dao.model.TXNHistoryMaster
at com.iz.RestTest.service.TxnHistoryService$1.transformTuple(TxnHistoryService.java:107)
at org.hibernate.loader.criteria.CriteriaLoader.getResultColumnOrRow(CriteriaLoader.java:140)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:761)
at org.hibernate.loader.Loader.processResultSet(Loader.java:991)
at org.hibernate.loader.Loader.doQuery(Loader.java:949)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:341)
at org.hibernate.loader.Loader.doList(Loader.java:2692)
at org.hibernate.loader.Loader.doList(Loader.java:2675)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2507)
at org.hibernate.loader.Loader.list(Loader.java:2502)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:109)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1936)
at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:370)
at com.iz.RestTest.service.TxnHistoryService.getTxnHistoryList(TxnHistoryService.java:131)
at com.iz.RestTest.service.TxnHistoryService.executeService(TxnHistoryService.java:64)
at com.iz.RestTest.controller.TxnController.txnHistory(TxnController.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:471)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:425)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:383)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:336)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:223)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:833)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:206)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:219)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
at org.eclipse.jetty.server.handler.DebugHandler.handle(DebugHandler.java:83)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:564)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)
at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:126)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
at java.lang.Thread.run(Thread.java:748)

  </error>
</log>
<log realm="stderr" at="2018-10-20T02:10:53.399" lifespan="500ms">
    Oct 20, 2018 2:10:52 AM org.hibernate.internal.SessionImpl createCriteria
    WARN: HHH90000022: Hibernate's legacy org.hibernate.Criteria API is deprecated; use the JPA javax.persistence.criteria.CriteriaQuery instead
</log>
<log realm="stdout" at="2018-10-20T02:10:53.410" lifespan="500ms">
    Hibernate: 
        select
            this_.ISO_FIELD_2 as ISO_FIEL1_0_0_,
            this_.TRN_ID as TRN_ID2_0_0_,
            this_.ISO_FIELD_19 as ISO_FIEL3_0_0_,
            this_.ISO_FIELD_38 as ISO_FIEL4_0_0_,
            this_.ISO_FIELD_6 as ISO_FIEL5_0_0_,
            this_.ISO_FIELD_51 as ISO_FIEL6_0_0_,
            this_.ISO_FIELD_42 as ISO_FIEL7_0_0_,
            this_.ISO_FIELD_39 as ISO_FIEL8_0_0_,
            this_.ISO_FIELD_4 as ISO_FIEL9_0_0_,
            this_.ISO_FIELD_49 as ISO_FIE10_0_0_,
            this_.TRN_DATE_TIME as TRN_DAT11_0_0_,
            this_.ISO_FIELD_46 as ISO_FIE12_0_0_ 
        from
            cim_11_1101 this_ limit ?
</log>


Need help on urgent.


Thanks.

Andrés Alcarraz

unread,
Oct 20, 2018, 2:59:47 AM10/20/18
to jPOS Users
That's seem to be an error on your hibernate setup. Is more a Hibernate issue than a jpos one

Maybe there's a chance someone here can help you out pinpointing the issue but I think you would have more luck in a Hibernate specific forum.


Best regards


Enviado desde el móvil

Andrés Alcarraz

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/4a5c35ca-f12e-4993-bf02-d6c292614fce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

chhil

unread,
Oct 20, 2018, 8:39:58 AM10/20/18
to jpos-...@googlegroups.com

netma...@gmail.com

unread,
Oct 23, 2018, 8:30:51 AM10/23/18
to jPOS Users
Hi Chill,

How can i get that 2 different class loader are getting load for one Class.

As i have integrated my hibernate database models in jpos ee, rest jetty based project.

I have created the project using http://jpos.org/doc/tutorials/jpos-rest.pdf

and integrated hibernate into this.


Thanks,

chhil

unread,
Oct 23, 2018, 8:51:22 AM10/23/18
to jpos-...@googlegroups.com
I don't know, are you trying to use sessions across threads? (just brain storming) 

-chhil



Alejandro Revilla

unread,
Oct 23, 2018, 4:05:46 PM10/23/18
to jpos-...@googlegroups.com
Probably a missing `providedCompile` instead of `compile` in the dependencies.



To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+unsubscribe@googlegroups.com.

To post to this group, send email to jpos-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/9bbfe51c-b3b6-4e47-a9a8-dff84ce9a87e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+unsubscribe@googlegroups.com.

To post to this group, send email to jpos-...@googlegroups.com.

netma...@gmail.com

unread,
Oct 24, 2018, 12:25:17 AM10/24/18
to jPOS Users
Below is my build.gradle:

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'war'

buildscript {
    repositories { jcenter() }
}

group = 'org.jpos.template'
version = '1.0.0'
sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
    mavenCentral()
    maven { url 'http://jpos.org/maven' }
    maven { url 'http://download.oracle.com/maven' }
    mavenLocal()
}

dependencies {
    compile ('org.jpos:jpos:2.1.1') {
        exclude(module: 'junit')
        exclude(module: 'hamcrest-core')
    }
    compile fileTree(dir: 'lib', include: ['*.jar'])
    testCompile 'junit:junit:4.8.2'
    providedCompile "org.jpos.ee:jposee-eerest:2.2.5-SNAPSHOT"
providedCompile "org.jpos.ee:jposee-jetty:2.2.5-SNAPSHOT"
providedCompile "javax.ws.rs:javax.ws.rs-api:2.0.1"
providedCompile "org.glassfish.jersey.media:jersey-media-json-jackson:2.22.1"
providedCompile "org.glassfish.jersey.core:jersey-server:2.22.1"
providedCompile "org.glassfish.jersey.containers:jersey-container-servlet:2.22.1"
compile 'io.swagger:swagger-jersey2-jaxrs:1.5.3'
}

apply from: 'jpos-app.gradle'
installApp.dependsOn('war')
dist.dependsOn('war')



Thanks.


--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.

netma...@gmail.com

unread,
Oct 24, 2018, 12:30:14 AM10/24/18
to jPOS Users
Hi Chhil,

yes, trying to use db sessions across threads, as it's rest webservice, it has controller and multiple web api's.

below is the code of my Conrtoller.java

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.jpos.transaction.Context;
import org.jpos.util.Log;

import com.google.gson.Gson;

@Path("/transaction")
public class TxnController {

private Log log = Log.getLog("Q2", this.getClass().getSimpleName());

@POST
@Produces({ MediaType.APPLICATION_JSON })
@Path("/txnHistory")
public String txnHistory(String txnJson) {
Gson gson = new Gson();
DB db = new DB();
TxnHistoryApi txnHistoryApi = gson.fromJson(txnJson, TxnHistoryApi.class);
Context ctx = createContext(getClass().getSimpleName().toLowerCase() + "::get");
ctx.put(Constants.DB, db);
ctx.put(Constants.HISTORY_REQ, txnHistoryApi);
TxnHistoryService txnHistoryService = TxnHistoryService.getInstance();
txnHistoryService.executeService(ctx);
String response = gson.toJson(txnHistoryApi);

return response;
}

@POST
@Produces({ MediaType.APPLICATION_JSON })
@Path("/register")
public String register(String txnJson) {
String response = "";
Gson gson = new Gson();
UserRegisterApi registerApi = gson.fromJson(txnJson, UserRegisterApi.class);
DB db = new DB();
Context ctx = createContext(getClass().getSimpleName().toLowerCase() + "::get");
ctx.put(Constants.DB, db);
ctx.put(Constants.REGISTER_REQ, registerApi);
UserRegistrationService regService = new UserRegistrationService();//.getInstance();
regService.executeService(ctx);
response = gson.toJson(registerApi);
return response;
}

@GET
@Produces({ MediaType.APPLICATION_JSON })
@Path("/echo")
public Response echoGet(String txnJson) {
Map<String, Object> resp = new HashMap<>();
resp.put("success", "true");
Response.ResponseBuilder rb = Response.ok(resp, MediaType.APPLICATION_JSON).status(Response.Status.OK);
return rb.build();
}
}


Thanks.

Alejandro Revilla

unread,
Oct 24, 2018, 11:05:35 AM10/24/18
to jpos-...@googlegroups.com
You are certainly missing a couple providedCompile (see the 3 'compile' you have there), but the problem is probably related to the fact that your classes are probably within src/main/java on the same module you're building the war, so they end up both in the main 'jar' as well as the 'war'.

If you use the multimodule template ('multimodule' branch in the jPOS-template project) you can use a different module for your entities and for your app (see the 'testbed' module in jPOS-EE, in puarticular its 'build.gradle').

As an alternative, you can exclude some files from the war, (see https://github.com/jpos/jPOS-EE/blob/master/modules/testbed/build.gradle#L33-L45) so that your entities just remain in the main jar and not in the war.


chhil

unread,
Oct 25, 2018, 1:12:17 AM10/25/18
to jpos-...@googlegroups.com
I would go with Alejandro's recommendations.

-chhil

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.

chhil

unread,
Oct 25, 2018, 1:26:42 AM10/25/18
to jpos-...@googlegroups.com
You may want to try the following to see class loading info.

java -verbose


-chhil

netma...@gmail.com

unread,
Oct 25, 2018, 3:31:27 AM10/25/18
to jPOS Users
Hi Alejandro,

Below is my updated build.gradle

war {
 classpath = configurations.runtime
   webInf {
  into('classes') {
   from sourceSets.main.output
   exclude('**/com/web/model/*.class')
   exclude('**/com/web/dao/model/*.class')
   exclude('**/com/web/runtime/*.class')
   exclude('**/com/web/service/*.class')
   exclude('**/com/web/util/*.class')
   
  }
  
 }

}
apply from: 'jpos-app.gradle'
installApp.dependsOn('war')
dist.dependsOn('war')


Now my war doesn't contain the customized classes.

Now below is the exception which is getting now:

<log realm="slf4j::org.eclipse.jetty.webapp.JettyWebXmlConfiguration" at="2018-10-25T12:56:24.202">
  <warn>
    Error applying file:///tmp/jetty-0.0.0.0-8080-WEBtranslater-1.0.0.war-_WEBtranslater-1.0.0-any-307544844805550105.dir/webapp/WEB-INF/jetty-web.xml
  </warn>
</log>
<log realm="slf4j::org.eclipse.jetty.webapp.WebAppContext" at="2018-10-25T12:56:24.203">
  <warn>
    Failed startup of context o.e.j.w.WebAppContext@6a6b9493{/WEBtranslater-1.0.0,file:///tmp/jetty-0.0.0.0-8080-WEBtranslater-1.0.0.war-_WEBtranslater-1.0.0-any-307544844805550105.dir/webapp/,UNAVAILABLE}{/WEBtranslater-1.0.0.war}
    <exception name="Object of class 'org.eclipse.jetty.webapp.WebAppContext' is not of type 'org.eclipse.jetty.webapp.WebAppContext'. Object Class and type Class are from different loaders. in file:/tmp/jetty-0.0.0.0-8080-WEBtranslater-1.0.0.war-_WEBtranslater-1.0.0-any-307544844805550105.dir/webapp/WEB-INF/jetty-web.xml">
    java.lang.IllegalArgumentException: Object of class 'org.eclipse.jetty.webapp.WebAppContext' is not of type 'org.eclipse.jetty.webapp.WebAppContext'. Object Class and type Class are from different loaders. in file:/tmp/jetty-0.0.0.0-8080-WEBtranslater-1.0.0.war-_WEBtranslater-1.0.0-any-307544844805550105.dir/webapp/WEB-INF/jetty-web.xml
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:295)
at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:245)
at org.eclipse.jetty.webapp.JettyWebXmlConfiguration.lambda$configure$0(JettyWebXmlConfiguration.java:96)
at org.eclipse.jetty.webapp.WebAppClassLoader.runWithServerClassAccess(WebAppClassLoader.java:159)
at org.eclipse.jetty.webapp.JettyWebXmlConfiguration.configure(JettyWebXmlConfiguration.java:96)
at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:517)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1458)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:785)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:41)
at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:188)
at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:502)
at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:150)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:180)
at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:447)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:64)
at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:610)
at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:529)
at org.eclipse.jetty.util.Scanner.scan(Scanner.java:392)
at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:313)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:150)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:564)
at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:239)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
at org.eclipse.jetty.server.Server.start(Server.java:452)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.Server.doStart(Server.java:419)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.jpos.q2.jetty.Jetty.startService(Jetty.java:45)
at org.jpos.q2.QBeanSupport.start(QBeanSupport.java:137)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46)
at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.jpos.q2.QFactory.startQBean(QFactory.java:187)
at org.jpos.q2.Q2.start(Q2.java:624)
at org.jpos.q2.Q2.deploy(Q2.java:408)
at org.jpos.q2.Q2.run(Q2.java:259)
at java.lang.Thread.run(Thread.java:748)
    </exception>
  </warn>
</log>

Victor Salaman

unread,
Oct 25, 2018, 3:39:42 AM10/25/18
to jpos-...@googlegroups.com, netma...@gmail.com
Hi:

This is happening to you because you have chosen to load Jetty as a QBean from within Q2, but some of your code is loaded from within the 'war' classloader. Consider loading all your classes from within the Q2's classloader and not Jetty's.

/V

netma...@gmail.com wrote on 10/25/18 3:31 AM:
--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.

netma...@gmail.com

unread,
Oct 25, 2018, 5:04:37 AM10/25/18
to jPOS Users
Hi Victor,

I am getting jetty exception, war is not containing any of my custom classes. and getting exception
  <exception name="Object of class 'org.eclipse.jetty.webapp.WebAppContext' is not of type 'org.eclipse.jetty.webapp.WebAppContext'. Object Class and type Class are from different loaders. in file:/tmp/jetty-0.0.0.0-8080-WEBtranslater-1.0.0.war-_WEBtranslater-1.0.0-any-307544844805550105.dir/webapp/WEB-INF/jetty-web.xml">
    java.lang.IllegalArgumentException: Object of class 'org.eclipse.jetty.webapp.WebAppContext' is not of type 'org.eclipse.jetty.webapp.WebAppContext'. Object Class and type Class are from different loaders. in file:/tmp/jetty-0.0.0.0-8080-WEBtranslater-1.0.0.war-_WEBtranslater-1.0.0-any-307544844805550105.dir/webapp/WEB-INF/jetty-web.xml
 

Can you more elaborate on Q2's classloader? How can i load my classes from within Q2? so that I can accept the request on webservice.


Thanks.

Victor Salaman

unread,
Oct 25, 2018, 8:53:23 AM10/25/18
to jpos-...@googlegroups.com
Hi:

Java loads Q2 using it's base classloader.
When deploying Jetty, Q2 creates its own nested classloader for it, so it can control its lifecycle (unload it)..
Jetty in turn by default, creates a  new nested classloader for loading the contents of WEB-INF/classes and  WEB-INF/lib/*.jar in your war.

So these classloaders being nested, create a dilema... A class can only access other classes loaded by its own classloader or any of its parents (by delegation - remember they are nested). So Q2 cannot access the classes that you put in your WAR's WEB-INF/classes or any of the jars you put in WEB-INF/lib.

Easiest fix for you would be to get rid of the 'war' altogether and just deploy the jetty webapp contents with a plain descriptor (cfg/jetty.xml). Of course, it's 2018 and people don't entertain this kind of torture and just go for Spring Boot, nonetheless it's the way this works today with the Jetty module.

/V

netma...@gmail.com wrote on 10/25/18 5:04 AM:

netma...@gmail.com

unread,
Oct 26, 2018, 2:28:03 AM10/26/18
to jPOS Users
Hi Victor,

Thanks for the information. I tried with excluding all classes from war. But the problem persists.

I didn't get the what you are trying to say about jetty.xml.

Below is my jetty.xml

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">

<Configure id="Server" class="org.eclipse.jetty.server.Server">
    <Get name="ThreadPool">
      <Set name="minThreads" type="int"><Property name="threads.min" default="10"/></Set>
      <Set name="maxThreads" type="int"><Property name="threads.max" default="200"/></Set>
      <Set name="idleTimeout" type="int"><Property name="threads.timeout" default="60000"/></Set>
      <Set name="detailedDump">false</Set>
    </Get>

    <Call name="addBean">
      <Arg>
        <New class="org.eclipse.jetty.util.thread.ScheduledExecutorScheduler"/>
      </Arg>
    </Call>

    <New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
      <Set name="secureScheme">https</Set>
      <Set name="securePort"><Property name="jetty.secure.port" default="8443" /></Set>
      <Set name="outputBufferSize"><Property name="jetty.output.buffer.size" default="32768" /></Set>
      <Set name="requestHeaderSize"><Property name="jetty.request.header.size" default="8192" /></Set>
      <Set name="responseHeaderSize"><Property name="jetty.response.header.size" default="8192" /></Set>
      <Set name="sendServerVersion"><Property name="jetty.send.server.version" default="true" /></Set>
      <Set name="sendDateHeader"><Property name="jetty.send.date.header" default="false" /></Set>
      <Set name="headerCacheSize">512</Set>
      <!-- Uncomment to enable handling of X-Forwarded- style headers
      <Call name="addCustomizer">
        <Arg><New class="org.eclipse.jetty.server.ForwardedRequestCustomizer"/></Arg>
      </Call>
      -->
    </New>


    <New id="RewriteHandler" class="org.eclipse.jetty.rewrite.handler.RewriteHandler">
        <Set name="rules">
            <Array type="org.eclipse.jetty.rewrite.handler.Rule">
                <Item>
                    <New id="header-xframe" class="org.eclipse.jetty.rewrite.handler.HeaderPatternRule">
                        <Set name="pattern">*</Set>
                        <Set name="name">X-Frame-Options</Set>
                        <Set name="value">SAMEORIGIN</Set>
                    </New>
                </Item>
                <Item>
                    <New id="header-xxss" class="org.eclipse.jetty.rewrite.handler.HeaderPatternRule">
                        <Set name="pattern">*</Set>
                        <Set name="name">X-XSS-Protection</Set>
                        <Set name="value">1; mode=block</Set>
                    </New>
                </Item>
                <Item>
                    <New id="header-xcontenttype" class="org.eclipse.jetty.rewrite.handler.HeaderPatternRule">
                        <Set name="pattern">*</Set>
                        <Set name="name">X-Content-Type-Options</Set>
                        <Set name="value">nosniff</Set>
                    </New>
                </Item>
                <Item>
                    <New id="header-sts" class="org.eclipse.jetty.rewrite.handler.HeaderPatternRule">
                        <Set name="pattern">*</Set>
                        <Set name="name">Strict-Transport-Security</Set>
                        <Set name="value">max-age=31536000; includeSubDomains; preload</Set>
                    </New>
                </Item>
                <Item>
                    <New id="header-csp" class="org.eclipse.jetty.rewrite.handler.HeaderPatternRule">
                        <Set name="pattern">*</Set>
                        <Set name="name">Content-Security-Policy</Set>
                        <Set name="value">default-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; frame-ancestors 'self'</Set>
                    </New>
                </Item>
            </Array>
        </Set>
    </New>


    <Set name="handler">
      <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
        <Set name="handlers">
         <Array type="org.eclipse.jetty.server.Handler">
           <Item>
             <New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
           </Item>
           <Item>
             <New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/>
           </Item>
           <Item>
             <Ref refid="RewriteHandler"/>
           </Item>
         </Array>
        </Set>
      </New>
    </Set>

    <!-- =========================================================== -->
    <!-- extra server options                                        -->
    <!-- =========================================================== -->
    <Set name="stopAtShutdown">true</Set>
    <Set name="stopTimeout">5000</Set>
    <Set name="dumpAfterStart"><Property name="jetty.dump.start" default="false"/></Set>
    <Set name="dumpBeforeStop"><Property name="jetty.dump.stop" default="false"/></Set>

    <Call name="addConnector">
      <Arg>
        <New class="org.eclipse.jetty.server.ServerConnector">
          <Arg name="server"><Ref refid="Server" /></Arg>
          <Arg name="factories">
            <Array type="org.eclipse.jetty.server.ConnectionFactory">
              <Item>
                <New class="org.eclipse.jetty.server.HttpConnectionFactory">
                  <Arg name="config"><Ref refid="httpConfig" /></Arg>
                </New>
              </Item>
            </Array>
          </Arg>
          <Set name="host"><Property name="jetty.host" /></Set>
          <Set name="port"><Property name="jetty.port" default="8080" /></Set>
          <Set name="idleTimeout"><Property name="http.timeout" default="30000"/></Set>
          <Set name="soLingerTime"><Property name="http.soLingerTime" default="-1"/></Set>
        </New>
      </Arg>
    </Call>

    <New id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory">
        <Set name="KeyStorePath"><Property name="jetty.home" default="/home/test/WEBtranslater/src/dist" />/cfg/keystore.jks</Set>
        <Set name="KeyStorePassword">jposjposjposjpos</Set>
        <Set name="ExcludeCipherSuites">
            <Array type="java.lang.String">
                <Item>SSL_DHE_RSA_WITH_DES_CBC_SHA</Item>
                <Item>SSL_DHE_DSS_WITH_DES_CBC_SHA</Item>
                <Item>SSL_RSA_EXPORT_WITH_RC4_40_MD5</Item>
                <Item>SSL_RSA_EXPORT_WITH_DES40_CBC_SHA</Item>
                <Item>SSL_RSA_WITH_DES_CBC_SHA</Item>
                <Item>SSL_RSA_WITH_3DES_EDE_CBC_SHA</Item>
                <Item>SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA</Item>
                <Item>SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA</Item>
                <Item>SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA</Item>
                <Item>TLS_DHE_RSA_WITH_AES_128_CBC_SHA</Item>
                <Item>TLS_DHE_RSA_WITH_AES_128_CBC_SHA256</Item>
                <Item>TLS_DHE_RSA_WITH_AES_128_GCM_SHA256</Item>
                <Item>TLS_DHE_RSA_WITH_AES_256_CBC_SHA</Item>
                <Item>TLS_DHE_RSA_WITH_AES_256_CBC_SHA256</Item>
                <Item>TLS_DHE_RSA_WITH_AES_256_GCM_SHA384</Item>
                <Item>TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA</Item>
            </Array>
        </Set>
        <Set name="ExcludeProtocols">
            <Array type="java.lang.String">
                <Item>SSLv3</Item>
                <Item>TLSv1</Item>
            </Array>
        </Set>
    </New>

    <Call name="addConnector">
        <Arg>
            <New class="org.eclipse.jetty.server.ServerConnector">
                <Arg name="server"><Ref refid="Server" /></Arg>
                <Arg name="factories">
                    <Array type="org.eclipse.jetty.server.ConnectionFactory">
                        <Item>
                            <New class="org.eclipse.jetty.server.SslConnectionFactory">
                                <Arg name="next">http/1.1</Arg>
                                <Arg name="sslContextFactory"><Ref refid="sslContextFactory"/></Arg>
                            </New>
                        </Item>
                        <Item>
                            <New class="org.eclipse.jetty.server.HttpConnectionFactory">
                                <Arg name="config"><Ref refid="httpConfig" /></Arg>
                            </New>
                        </Item>
                    </Array>
                </Arg>
                <Set name="host"><Property name="jetty.host" /></Set>
                <Set name="port"><Property name="jetty.secure.port" default="8443" /></Set>
                <Set name="idleTimeout"><Property name="http.timeout" default="30000"/></Set>
                <Set name="soLingerTime"><Property name="http.soLingerTime" default="-1"/></Set>
            </New>
        </Arg>
    </Call>

    <Call class="org.eclipse.jetty.util.log.Log" name="getRootLogger">
      <Call name="setDebugEnabled">
        <Arg type="boolean">true</Arg>
      </Call>
    </Call>

    <Call class="org.eclipse.jetty.webapp.Configuration$ClassList" name="setServerDefault">
      <Arg><Ref refid="Server" /></Arg>
      <Call name="addBefore">
        <Arg name="beforeClass">org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Arg>
        <Arg>
          <Array type="String">
            <Item>org.eclipse.jetty.annotations.AnnotationConfiguration</Item>
          </Array>
        </Arg>
      </Call>
    </Call>

    <Get id="oldhandler" name="handler"/>
    <Set name="handler">
      <New id="DebugHandler" class="org.eclipse.jetty.server.handler.DebugHandler">
        <Set name="handler"><Ref refid="oldhandler"/></Set>
        <Set name="outputStream">
          <New class="org.eclipse.jetty.util.RolloverFileOutputStream">
            <Arg type="String"><Property name="jetty.logs" default="./log"/>/yyyy_mm_dd.debug.log</Arg>
            <Arg type="boolean">true</Arg> <!-- append -->
            <Arg type="int">90</Arg> <!-- retain days -->
          </New>
        </Set>
      </New>
    </Set>

    <Call name="addBean">
      <Arg>
        <New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager">
          <Set name="contexts">
            <Ref refid="Contexts" />
          </Set>
          <Call name="setContextAttribute">
            <Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
            <Arg>.*/[^/]*servlet-api-[^/]*\.jar$|.*/javax.servlet.jsp.jstl-.*\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\.jar$</Arg>
          </Call>
            <Call id="webappprovider" name="addAppProvider">
                <Arg>
                    <New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
                        <Set name="monitoredDirName">
                            <Property>
                                <Name>jetty.deploy.monitoredPath</Name>
                                <Default>
                                    <Property name="jetty.base" default="." />/<Property name="jetty.deploy.monitoredDir" deprecated="jetty.deploy.monitoredDirName" default="webapps"/>
                                </Default>
                            </Property>
                        </Set>
                        <Set name="defaultsDescriptor">
                            <Property>
                                <Name>jetty.deploy.defaultsDescriptorPath</Name>
                                <Default>
                                    <Property name="jetty.home" default="/home/test/WEBtranslater/src/dist" />/cfg/webdefault.xml
                                </Default>
                            </Property>
                        </Set>
                        <Set name="scanInterval"><Property name="jetty.deploy.scanInterval" default="1"/></Set>
                        <Set name="extractWars"><Property name="jetty.deploy.extractWars" default="true"/></Set>
                        <Set name="configurationManager">
                            <New class="org.eclipse.jetty.deploy.PropertiesConfigurationManager">
                                <!-- file of context configuration properties
                                <Set name="file"><SystemProperty name="jetty.base"/>/etc/some.properties</Set>
                                -->
                                <!-- set a context configuration property
                                <Call name="put"><Arg>name</Arg><Arg>value</Arg></Call>
                                -->
                            </New>
                        </Set>
                    </New>
                </Arg>
            </Call>
        </New>
      </Arg>
    </Call>
</Configure>

chhil

unread,
Oct 26, 2018, 4:04:23 AM10/26/18
to jpos-...@googlegroups.com
Are you deploying Jetty using the 90_jetty.xml ?
Here the q2 classloader loads the jetty server (embedded) via a regular qbean Jetty.java.

Jetty module can be found at 

-chhil

netma...@gmail.com

unread,
Oct 26, 2018, 4:43:55 AM10/26/18
to jPOS Users
Hi Chhil,

Yes, I am deploying Jetty using 90_jetty.xml. If i removed it, then how will it my descriptor will be deployed?


Thanks.

chhil

unread,
Oct 26, 2018, 5:00:22 AM10/26/18
to jpos-...@googlegroups.com
Not asking to remove it. 

My  setup  uses jetty xml deploy (custom jetty.java, to set up paths and mapped resources, so I don't do it using the xml descriptors, which I feel shouldn't matter) , no war file, the classes exist in the modules, are compiled and built  into the regular jar. Q2 loads the classes. 

-chhil

Reply all
Reply to author
Forward
0 new messages