Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Test on TomEE #9

Closed
m-reza-rahman opened this issue Aug 23, 2018 · 8 comments
Closed

Test on TomEE #9

m-reza-rahman opened this issue Aug 23, 2018 · 8 comments

Comments

@m-reza-rahman
Copy link
Contributor

No description provided.

@felipe-alves-moraes
Copy link
Contributor

I'll try to test it. I'll post here the results as soon as possible.

@felipe-alves-moraes
Copy link
Contributor

felipe-alves-moraes commented Aug 27, 2018

[localhost-startStop-2] INFO org.axonframework.cdi.AxonCdiExtension - Axon Framework configuration complete.
26-Aug-2018 22:02:08.462 INFO [localhost-startStop-2] org.apache.webbeans.config.BeansDeployer.validateInjectionPoints All injection points were validated successfully.
26-Aug-2018 22:02:08.469 INFO [localhost-startStop-2] org.apache.openejb.cdi.OpenEJBLifecycle.startApplication OpenWebBeans Container has started, it took 1698 ms.
26-Aug-2018 22:02:08.501 INFO [localhost-startStop-2] org.apache.openejb.assembler.classic.Assembler.startEjbs Created Ejb(deployment-id=AccountApplication, ejb-name=AccountApplication, container=Default Singleton Container)
26-Aug-2018 22:02:08.545 INFO [localhost-startStop-2] org.axonframework.cdi.example.javaee.AccountApplication.run Initializing Account application.
26-Aug-2018 22:02:08.589 INFO [localhost-startStop-2] org.axonframework.cdi.example.javaee.command.Account.<init> Handling: Create Account Command with accountId=f62b648e-7d20-44ad-97ed-b291fe20a8b7, overdraftLimit=100.0.
26-Aug-2018 22:02:08.596 INFO [localhost-startStop-2] org.axonframework.cdi.example.javaee.command.Account.on Applying: Account Created Event with accountId=f62b648e-7d20-44ad-97ed-b291fe20a8b7, overdraftLimit=100.0.
[localhost-startStop-2] INFO org.axonframework.eventhandling.interceptors.EventLoggingInterceptor - Events published: [AccountCreatedEvent] while processing a [CreateAccountCommand] which yielded a [String] return value
[EL Fine]: 2018-08-26 22:02:08.749--ClientSession(135988133)--Connection(83579242)--Thread(Thread[localhost-startStop-2,5,main])--UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?
        bind => [50, SEQ_GEN]
[EL Fine]: 2018-08-26 22:02:08.756--ClientSession(135988133)--Connection(83579242)--Thread(Thread[localhost-startStop-2,5,main])--SELECT SEQ_COUNT FROM SEQUENCE WHERE SEQ_NAME = ?
        bind => [SEQ_GEN]
[EL Fine]: 2018-08-26 22:02:08.771--ClientSession(135988133)--Connection(83579242)--Thread(Thread[localhost-startStop-2,5,main])--INSERT INTO DOMAINEVENTENTRY (GLOBALINDEX, AGGREGATEIDENTIFIER, EVENTIDENTIFIER, METADATA, PAYLOAD, PAYLOADREVISION, PAYLOADTYPE, SEQUENCENUMBER, TIMESTAMP, TYPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
        bind => [1, f62b648e-7d20-44ad-97ed-b291fe20a8b7, 7eb4fd90-d6f3-4f33-8dd9-14b8c6152988, [B@3cf8344a, [B@32e413e6, null, org.axonframework.cdi.example.javaee.command.AccountCreatedEvent, 0, 2018-08-27T01:02:08.594Z, Account]
26-Aug-2018 22:02:08.783 INFO [localhost-startStop-2] org.axonframework.cdi.example.javaee.query.AccountProjection.on Projecting: Account Created Event with accountId=f62b648e-7d20-44ad-97ed-b291fe20a8b7, overdraftLimit=100.0.
26-Aug-2018 22:02:08.783 INFO [localhost-startStop-2] org.axonframework.cdi.example.javaee.query.GenericEventListener.on Received: Account Created Event with accountId=f62b648e-7d20-44ad-97ed-b291fe20a8b7, overdraftLimit=100.0.
26-Aug-2018 22:02:08.797 INFO [localhost-startStop-2] org.apache.openejb.assembler.classic.Assembler.startEjbs Started Ejb(deployment-id=AccountApplication, ejb-name=AccountApplication, container=Default Singleton Container)
26-Aug-2018 22:02:08.798 INFO [localhost-startStop-2] org.apache.openejb.assembler.classic.Assembler.createApplication Deployed Application(path=D:\dev\Servers\apache-tomee-plume-7.0.5\webapps\javaee-axon-example-0.1-SNAPSHOT)
26-Aug-2018 22:02:08.899 INFO [localhost-startStop-2] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
26-Aug-2018 22:02:08.942 INFO [localhost-startStop-2] sun.reflect.DelegatingMethodAccessorImpl.invoke Deployment of web application archive [D:\dev\Servers\apache-tomee-plume-7.0.5\webapps\javaee-axon-example-0.1-SNAPSHOT.war] has finished in [7,482] ms

Got the following output deploying on Apache TomEE 7.0.5!
Looks good!

Do I need to test anything else?

@m-reza-rahman
Copy link
Contributor Author

Awesome. It looks like you used Plume. I tried web, plain and plus but those failed due to OpenJPA issues. I'll update the readme and close this issue. Thanks!

@m-reza-rahman
Copy link
Contributor Author

I've updated the readme, closing this issue. I will make sure to add your name to our acknowledgements :-).

@m-reza-rahman
Copy link
Contributor Author

For sake of completeness, this is the root problem that occurs with OpenJPA and TomEE Plus:

Aug-2018 10:53:13.399 WARNING [localhost-startStop-1] null.openjpa.Runtime Found no persistent property in "org.axonframework.eventsourcing.eventstore.jpa.DomainEventEntry" [localhost-startStop-1] DEBUG org.axonframework.messaging.unitofwork.MessageProcessingContext - Notifying handlers for phase CLEANUP [localhost-startStop-1] DEBUG org.axonframework.messaging.unitofwork.MessageProcessingContext - Notifying handlers for phase CLOSED 30-Aug-2018 10:53:13.492 SEVERE [localhost-startStop-1] org.apache.openejb.core.transaction.EjbTransactionUtil.handleSystemException EjbTransactionUtil.handleSystemException: org.axonframework.eventsourcing.eventstore.AbstractSequencedDomainEventEntry.pcGetManagedFieldCount()I java.lang.NoSuchMethodError: org.axonframework.eventsourcing.eventstore.AbstractSequencedDomainEventEntry.pcGetManagedFieldCount()I at org.axonframework.eventsourcing.eventstore.jpa.DomainEventEntry.<clinit>(DomainEventEntry.java) at org.axonframework.eventsourcing.eventstore.jpa.JpaEventStorageEngine.createEventEntity(JpaEventStorageEngine.java:451) at org.axonframework.eventsourcing.eventstore.jpa.JpaEventStorageEngine.lambda$appendEvents$5(JpaEventStorageEngine.java:362) at org.axonframework.eventsourcing.eventstore.jpa.JpaEventStorageEngine$$Lambda$296/577227952.apply(Unknown Source) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502) at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) at org.axonframework.eventsourcing.eventstore.jpa.JpaEventStorageEngine.appendEvents(JpaEventStorageEngine.java:362) at org.axonframework.eventsourcing.eventstore.AbstractEventStorageEngine.appendEvents(AbstractEventStorageEngine.java:140) at org.axonframework.eventsourcing.eventstore.AbstractEventStore.prepareCommit(AbstractEventStore.java:66) at org.axonframework.eventhandling.AbstractEventBus$$Lambda$288/1170082317.accept(Unknown Source) at org.axonframework.eventhandling.AbstractEventBus.doWithEvents(AbstractEventBus.java:220) at org.axonframework.eventhandling.AbstractEventBus.lambda$null$8(AbstractEventBus.java:155) at org.axonframework.eventhandling.AbstractEventBus$$Lambda$275/947630374.accept(Unknown Source) at org.axonframework.messaging.unitofwork.MessageProcessingContext.notifyHandlers(MessageProcessingContext.java:68) at org.axonframework.messaging.unitofwork.DefaultUnitOfWork.notifyHandlers(DefaultUnitOfWork.java:91) at org.axonframework.messaging.unitofwork.AbstractUnitOfWork.changePhase(AbstractUnitOfWork.java:221) at org.axonframework.messaging.unitofwork.AbstractUnitOfWork.commitAsRoot(AbstractUnitOfWork.java:82) at org.axonframework.messaging.unitofwork.AbstractUnitOfWork.commit(AbstractUnitOfWork.java:70) at org.axonframework.messaging.unitofwork.DefaultUnitOfWork.executeWithResult(DefaultUnitOfWork.java:80) at org.axonframework.commandhandling.SimpleCommandBus.handle(SimpleCommandBus.java:148) at org.axonframework.commandhandling.SimpleCommandBus.doDispatch(SimpleCommandBus.java:121) at org.axonframework.commandhandling.SimpleCommandBus.dispatch(SimpleCommandBus.java:85) at org.axonframework.commandhandling.gateway.AbstractCommandGateway.send(AbstractCommandGateway.java:79) at org.axonframework.commandhandling.gateway.DefaultCommandGateway.send(DefaultCommandGateway.java:95) at org.axonframework.commandhandling.gateway.DefaultCommandGateway.send(DefaultCommandGateway.java:143) at org.axonframework.commandhandling.gateway.CommandGateway$$OwbNormalScopeProxy0.send(org/axonframework/commandhandling/gateway/CommandGateway.java) at org.axonframework.cdi.example.javaee.AccountApplication.run(AccountApplication.java:36) 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:497) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:205) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$LifecycleInvocation.invoke(ReflectionInvocationContext.java:237) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:186) at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:191) at org.apache.openejb.monitoring.StatsInterceptor.PostConstruct(StatsInterceptor.java:112) 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:497) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:205) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:186) at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:85) at org.apache.openejb.BeanContext.newInstance(BeanContext.java:1735) at org.apache.openejb.core.singleton.SingletonInstanceManager.createInstance(SingletonInstanceManager.java:179) at org.apache.openejb.core.singleton.SingletonInstanceManager.access$100(SingletonInstanceManager.java:69) at org.apache.openejb.core.singleton.SingletonInstanceManager$1.call(SingletonInstanceManager.java:120) at org.apache.openejb.core.singleton.SingletonInstanceManager$1.call(SingletonInstanceManager.java:118) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.openejb.core.singleton.SingletonInstanceManager.getInstance(SingletonInstanceManager.java:129) at org.apache.openejb.core.singleton.SingletonInstanceManager.initialize(SingletonInstanceManager.java:93) at org.apache.openejb.core.singleton.SingletonInstanceManager.start(SingletonInstanceManager.java:84) at org.apache.openejb.core.singleton.SingletonContainer.start(SingletonContainer.java:127) at org.apache.openejb.assembler.classic.Assembler.startEjbs(Assembler.java:1694) at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:997) at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:757) at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1303) at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1125) at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:133) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:629) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1839) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

@rmannibucau
Copy link
Contributor

This is cause the persistence.xml does not list the mappedsuperclass which are therefore not enhanced (since it was not done at build time too). Add in your persistence.xml:

<class>org.axonframework.eventsourcing.eventstore.AbstractEventEntry</class>
<class>org.axonframework.eventsourcing.eventstore.AbstractDomainEventEntry</class>
 <class>org.axonframework.eventsourcing.eventstore.AbstractSequencedDomainEventEntry</class>

And it works

@m-reza-rahman
Copy link
Contributor Author

m-reza-rahman commented Aug 30, 2018

While adding the inherited classes prevented the deployment from completely failing (and is probably a good idea anyway), there still seems to be OpenJPA issues causing a transaction rollback at the end (before that OpenJPA spits out a bunch of warnings). Do you have any idea what is going on? It is certainly the case that I don't think anyone has tested Axon against OpenJPA before. Maybe there are things we can do to become more JPA compliant? By far the most common JPA implementation our customers use is Hibernate FYI.

Here are some log entries in case it helps:

30-Aug-2018 12:57:31.172 WARNING [http-nio-8080-exec-9] null.openjpa.Runtime Found no persistent property in "org.axonframework.eventhandling.saga.repository.jpa.SagaEntry" 30-Aug-2018 12:57:31.172 WARNING [http-nio-8080-exec-9] null.openjpa.Runtime Fields "org.axonframework.eventhandling.saga.repository.jpa.AbstractSagaEntry.serializedSaga" are not a default persistent type, and do not have any annotations indicating their persistence strategy. They will be treated as non-persistent. If you intended for these fields to be persistent, be sure to annotate them appropriately or declare them in orm.xml. Otherwise annotate them with @Transient. 30-Aug-2018 12:57:31.172 WARNING [http-nio-8080-exec-9] null.openjpa.MetaData The class "org.axonframework.eventhandling.saga.repository.jpa.SagaEntry" listed in the openjpa.MetaDataFactory configuration property could not be loaded by TomEEWebappClassLoader

@m-reza-rahman
Copy link
Contributor Author

Outstanding TomEE issues resolved with this PR: #14. Thanks Romain Manni-Bucau. I will make sure to give due credit for full TomEE support for Axon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants