cargotracker icon indicating copy to clipboard operation
cargotracker copied to clipboard

Support WildFly

Open m-reza-rahman opened this issue 4 years ago • 26 comments

As an alternative to Payara or default runtime.

m-reza-rahman avatar Feb 14 '21 19:02 m-reza-rahman

WildFly/Hibernate is ok in my fork, I have not tried to run it in OpenLiberty.

hantsy avatar Mar 19 '21 02:03 hantsy

Does it also work with Payara? How about the Arquillian tests? If so, let me create a separate branch and you can issue the PR there. Once I can examine the code and do regression testing to verify everything is OK for both servers, we can merge it to master.

m-reza-rahman avatar Mar 19 '21 02:03 m-reza-rahman

Yes, I added Github Actions to build it and running tests. https://github.com/hantsy/cargotracker/

  1. JPA Entities, there are small fixes added due to some Hibernate-specific issues. Check notes in https://github.com/hantsy/cargotracker/blob/master/src/main/java/org/eclipse/cargotracker/domain/model/cargo/Itinerary.java
  2. Jackson is used by default in the latest WildFly, but not configure Java 8 DateTimeSupport. https://github.com/hantsy/cargotracker/blob/master/src/main/java-wildfly/org/eclipse/cargotracker/infrastructure/routing/client/JacksonObjectMapperContextResolver.java
  3. To avoid the famous lazy init exception from Hibernate etc, use a transaction to wrap the codes where some lazy access on a proxied object there, I added some @Transactional in some web layer codes, and use manual UserTransaction in the tests to make the codes work. https://github.com/hantsy/cargotracker/blob/master/src/test/java/org/eclipse/cargotracker/application/BookingServiceTest.java It seems the @Transactional did not work in Arquillian tests directly.

hantsy avatar Mar 19 '21 04:03 hantsy

Another issue I found about the LocalDateTime persistence in Hibernate, https://github.com/hantsy/cargotracker/blob/master/src/main/java/org/eclipse/cargotracker/domain/model/cargo/Leg.java#L66, the nano value is different when fetching from db.

Not sure there are some configuration in Hibernate to fix it.

hantsy avatar Mar 19 '21 04:03 hantsy

I just want to be clear - at this point do you have a codebase that works with both Payara and WildFly? Or is it the case that you have ported the code to WildFly and it no longer works with Payara? If it’s the latter, do you need help achieving the former?

m-reza-rahman avatar Mar 19 '21 12:03 m-reza-rahman

Yeah, my fork works both Payara and WildFly.

  1. The tests passed on both Payara and WildFly. My fork has more tests than the upstream.
  2. Manually deployed to WildFly successfully (but I am not sure everything is working well, not tried every links).

hantsy avatar Mar 20 '21 14:03 hantsy

OK, I have created a 'develop' branch you can issue PRs against. Hopefully we don't have to keep that branch longer term. It is a bit cumbersome.

m-reza-rahman avatar Mar 20 '21 19:03 m-reza-rahman

WildFly support is availble in #195

hantsy avatar Mar 21 '21 12:03 hantsy

I think the basic Hibernate/WildFly is included in the develop branch.

So it is better to split this issue into smaller issues.

Such as:

  • Open Liberty Support
  • Oracle Weblogic Support

hantsy avatar Apr 18 '21 13:04 hantsy

I wouldn't say this is a very big priority for us just yet. It is a good way to get contributions though. I would like to keep it as-is for now.

m-reza-rahman avatar Apr 18 '21 16:04 m-reza-rahman

For folks interested in WildFly support, there is an initial starting point here: https://github.com/eclipse-ee4j/cargotracker/tree/wildfly-experimental.

m-reza-rahman avatar May 08 '21 16:05 m-reza-rahman

I tried to run the Cargotracker application on OpenLiberty,

  1. All annotation-based configurations for DataSource and JMS Queue did not work. Check: https://twitter.com/hantsy/status/1401371324652691457?s=20 and https://twitter.com/hantsy/status/1401369955912781831?s=20 I am not sure if the configurations via web.xml are working?

  2. MyFaces is another challenge, there are some compatible issues when opening the pages.

Currently, I created a branch in my fork for running on OpenLiberty, https://github.com/hantsy/cargotracker/tree/openliberty-config Changes can be found in the PR: https://github.com/hantsy/cargotracker/pull/59/files

hantsy avatar Jun 06 '21 03:06 hantsy

Please post questions to the Open Liberty and MyFaces forums?

m-reza-rahman avatar Jun 06 '21 03:06 m-reza-rahman

Posted in OpenLiberty Gitter channels and groups.io, but Open liberty seems not active as others. In Gitter channels, only a few messages over months.

hantsy avatar Jun 07 '21 02:06 hantsy

Now the main problem is myfaces. For DataSource and JMS config, it seems I have to remove the global prefix(java:app/) from its JNDI name to make it work.

hantsy avatar Jun 07 '21 02:06 hantsy

@m-reza-rahman The portable @DataSourceDefinition and @JMSDestinationDefinition are required part of the Jakarta EE TCK?

hantsy avatar Jun 07 '21 02:06 hantsy

I don't know. I would ask on the TCK alias: https://accounts.eclipse.org/mailing-list/jakartaee-tck-dev.

m-reza-rahman avatar Jun 07 '21 03:06 m-reza-rahman

Some experimental work for Liberty support here: https://github.com/eclipse-ee4j/cargotracker/tree/liberty-experimental.

m-reza-rahman avatar Aug 06 '22 18:08 m-reza-rahman

I am working for documentation to use WIldFly as a runtime. Is it ok sir?

ojuschugh1 avatar Mar 25 '23 16:03 ojuschugh1

Sure, please go ahead?

m-reza-rahman avatar Mar 25 '23 17:03 m-reza-rahman

ok thanks i was waiting for permission :)

ojuschugh1 avatar Mar 25 '23 17:03 ojuschugh1

GlassFish port in progress here: https://github.com/eclipse-ee4j/cargotracker/pull/243.

m-reza-rahman avatar Mar 28 '23 21:03 m-reza-rahman

GlassFish support merged to main here: https://github.com/eclipse-ee4j/cargotracker/pull/282.

m-reza-rahman avatar Sep 17 '23 16:09 m-reza-rahman

Liberty support merged to main here: https://github.com/eclipse-ee4j/cargotracker/pull/283

m-reza-rahman avatar Sep 22 '23 23:09 m-reza-rahman