Codehaus Cargo 1.8.2 is here!

49 views
Skip to first unread message

S. Ali Tokmen

unread,
Sep 27, 2020, 3:50:09 AM9/27/20
to Codehaus Cargo

Dear Codehaus Cargo enthusiasts

Shortly after our 1.8.0 and 1.8.1 releases, please welcome Codehaus Cargo 1.8.2. This new version comes with many changes under the hood:

  • We updated our code standards to Java 8 (actually, some were long due since Java 7), including:

    • Conversion to the easier to read constructs such as switch over Strings, the beautiful try-with-resources, the simplified for-each loops and compact multi-catch statements.

    • Switching to the better behaving Collection.addAll (instead of manual population of Lists / Sets) and String.join (instead of manually created for loops with booleans checking if it the first element).

    • Please note that we didn't go crazy with Lambda expressions: they bring very little benefit in the case of a very procedural process like Codehaus Cargo's (except perhaps for the XML-related parts where we do a lot of filtering), and in case something goes wrong the stack trace is very difficult to read...

  • While we did these updates, we also revised the Codehaus Cargo CI and enabled Java 6-based container tests. That implied further changes under the hood, for example changes in the version compatibility for the Cargo Samples Test Data modules. These obviously do not have much "visible" impact, yet enabled us to catch some long hidden bugs! See below...

  • Containers - Resin:

    • [CARGO-1530] We fixed the bug where the Resin 3.x container didn't work: ResinRun was being compiled to work with Java 7 onwards (since October 2018), yet due to incompatibilities between com.caucho.log.EnvironmentLogger and the behaviour described in JDK-8015098, Resin 3.x doesn't run on Java 7 and above! We hence also build the Codehaus Cargo Resin container with Java 6 as the minimum version, while Java 8 remains the standard for all others.

Lesson learnt from this release? Well, if something is not tested, one should assume it is broken...

To try out this latest version:

Enjoy!

-- 

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/

Hantsy Bai

unread,
Oct 28, 2020, 1:15:10 AM10/28/20
to Codehaus Cargo
Glassfish v6.0 is RC1 now, but unfounfortunately deployment client is not part of GF6, any update to control GF6 in Cargo maven plugin? Thanks.

S. Ali Tokmen

unread,
Oct 28, 2020, 4:32:40 AM10/28/20
to codehau...@googlegroups.com
Hi Hantsy

Great catch!! That also means, we should implement support for GlassFish 6.x soon 👍

It appears there’s another artifact called deployment-admin, did you try that one?

Regards

On 28 Oct 2020, at 06:15, Hantsy Bai <han...@gmail.com> wrote:

Glassfish v6.0 is RC1 now, but unfounfortunately deployment client is not part of GF6, any update to control GF6 in Cargo maven plugin? Thanks.
--
You received this message because you are subscribed to the Google Groups "Codehaus Cargo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codehaus-carg...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codehaus-cargo/829c6e0c-44a6-4417-86dd-81c958fee7f1n%40googlegroups.com.

hantsy bai

unread,
Oct 28, 2020, 6:59:48 AM10/28/20
to codehau...@googlegroups.com
I have tried to upgrade my example to Jakarta EE 9,  but when updating the Glassfish viersion to 6.x directly, and found the glassfish-client is not avialble for Glassfish v6, the Deployment JSR is decpreated in Jakarta EE9, I think GF 6.x have removed it.


If using 5.1 there, it did not work.


You received this message because you are subscribed to a topic in the Google Groups "Codehaus Cargo" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codehaus-cargo/cbnKzKgLQdQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codehaus-carg...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codehaus-cargo/8423242C-99A9-4B32-92B4-0CD8FE4C510D%40alishomepage.com.

S. Ali Tokmen

unread,
Oct 29, 2020, 2:40:48 AM10/29/20
to codehau...@googlegroups.com

Hi Hantsy

I looked deeper, and indeed the GlassFish remote container will have to be rewritten for Eclipse GlassFish 6: as explained in https://jakarta.ee/specifications/platform/8/platform-spec-8.html, the JSR-88 APIs have been made optional in Java EE 7 and they seem not to be part of Jakarta EE anymore.

That means, the new Codehaus Cargo GlassFish 6.x container will need to have a different remote deployer.

I created https://codehaus-cargo.atlassian.net/browse/CARGO-1532 for this, all contributions are welcome 😁

S. Ali Tokmen

unread,
Nov 2, 2020, 2:52:29 AM11/2/20
to codehau...@googlegroups.com

Hi Hantsy

This is much worse than I thought: Eclipse GlassFish 6 seems not to work with Java 11 😮 I tried both https://download.eclipse.org/ee4j/glassfish/glassfish-6.0.0-RC2.zip and https://download.eclipse.org/ee4j/glassfish/web-6.0.0-RC2.zip... I remember this was also an issue for pre-Payara GlassFish versions, and am surprised the Eclipse teams didn't port the associated fixes.

How did you get Eclipse GlassFish 6 to work? Do you just use the very aging Java 8? Or perhaps some alternative JDK?

Please advise

han...@gmail.com

unread,
Nov 5, 2020, 1:28:40 AM11/5/20
to codehau...@googlegroups.com

Hi, as I know originally Jakarta EE 9  added Java 11 as an optional requirement, but it seems it is removed recently.

So in the glassfish plan, Glassfish v6 only supports Java 8, Glassfish v6.1 will add Java 11 support.

 

Personally, I have switched to use Java 11 as default JDK for a while, the simplest way to make to Glassfish v6 work is using NetBeans to manage it.

 

But Payara server supports Java 11 since 5.x.

 

Self-employed consultant, fullstack developer, agile coach

Github: https://github.com/hantsy

Twitter: https://twitter.com/@hantsy

Medium: https://medium.com/@hantsy

S. Ali Tokmen

unread,
Nov 10, 2020, 4:00:50 PM11/10/20
to codehau...@googlegroups.com

Hi Hantsy

All right - Our observations are then matching 👍

As GlassFish 6.0 lacks JSR-88 support and it is unclear whether this will be included in a future release, please follow the remote deployment instructions for GlassFish 6.x, you can even copy/paste directly from https://github.com/codehaus-cargo/cargo/blob/master/extensions/maven2/samples/glassfish6x-remoteDeploy-test/src/test/resources/pom.xml.

We didn't release Codehaus Cargo 1.8.3 yet (which will have the glassfish6x container), until then you can follow the instructions above with glassfish5x as container - They should work also with GlassFish 6.0.

Keep us posted if it works for you as well!

Regards

hantsy bai

unread,
Nov 12, 2020, 3:04:41 AM11/12/20
to codehau...@googlegroups.com
Many thanks for your work, I will update my Jakarta EE 9 sample[1] and try to use cargo maven plugin to deploy app to Glassfish v6.

Regards,
Hantsy



hantsy bai

unread,
Nov 12, 2020, 4:06:21 AM11/12/20
to codehau...@googlegroups.com
Read the links provided by you, so current solutoin is using a Glassfish dist as the original deployment client to deploy to the remote server?

hantsy bai

unread,
Nov 12, 2020, 5:33:25 AM11/12/20
to codehau...@googlegroups.com
I have tried the installed local deployer with existing and standalone config[1], it is possible to deploy to remote runtime container? My former configuration is using glassfish client there. [2]

The glassfishs v6 container does not support remote deployer and runtime configuration according to Cargo maven doc.

Personally, I do not understand the new docs about Glassfish v6 remote deployment, there it uses an installed local deloyer with standalone configuration

S. Ali Tokmen

unread,
Nov 12, 2020, 3:18:18 PM11/12/20
to codehau...@googlegroups.com

Hi Hantsy

You are correct: the idea is to use a "local" deployer to deploy to a remote server - Which, is the "only" way to do it (for now) with GlassFish 6.x. As explained on https://codehaus-cargo.github.io/cargo/Remote+deployments+to+GlassFish+6.x.html:

All Cargo GlassFish deployers use the GlassFish asadmin behind the scenes, and all of them set the cargo.hostname as the target host.

As a result, all GlassFish Installed Local Deployers can actually be used to perform remote deployments, the main "downside" being that this requires the GlassFish container ZIP file to be downloaded (which can be done transparently using an installer).

Does this help?

--
You received this message because you are subscribed to the Google Groups "Codehaus Cargo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codehaus-carg...@googlegroups.com.

hantsy bai

unread,
Nov 14, 2020, 3:37:20 AM11/14/20
to codehau...@googlegroups.com
Hi Ali, I tried to use glasfish5x to deploy a jakarata ee9 application to Glassfish v6, in the console log, I saw something like this.

[INFO] [talledLocalContainer] remote failure: The jdbc resource [ jdbc/__default ] cannot be deleted as it is required to be configured in the system.
[INFO] [talledLocalContainer] Command delete-jdbc-resource failed.
[INFO] [talledLocalContainer] JDBC Connection pool DerbyPool deleted successfully
[INFO] [talledLocalContainer] Command delete-jdbc-connection-pool executed successfully.
It tried to delete the default datasource config.


Regards,
Hantsy

You received this message because you are subscribed to a topic in the Google Groups "Codehaus Cargo" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codehaus-cargo/cbnKzKgLQdQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codehaus-carg...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codehaus-cargo/1a1afa76-a4e9-77b8-4903-5db61d91f6ea%40alishomepage.com.

S. Ali Tokmen

unread,
Nov 14, 2020, 9:33:25 AM11/14/20
to codehau...@googlegroups.com

Hi Hantsy

Good catch - You can use the cargo.glassfish.removeDefaultDatasource property to instruct Codehaus Cargo to not even try to remove that default datasource (and hence avoid confusing log messages).

Your guide looks good 👍 The only part which would not work is what you have for the remote deployment: you'll have to use the instructions on https://codehaus-cargo.github.io/cargo/Remote+deployments+to+GlassFish+6.x.html, where:

  • (Confusingly), do not set the container type (and it will be a local one)
  • Make sure cargo.hostname is set to the remote host (either in the pom.xml or via a Java property when running Maven)

I'd also suggest you enrich your guide with the cargo.glassfish.admin.port (defaults to 4848), as many people tend to change that (especially for remote containers).

By the way, do you mind if we refer to youe beautiful guide from the https://codehaus-cargo.github.io/cargo/Articles.html page?

Regards

hantsy bai

unread,
Nov 15, 2020, 1:01:24 AM11/15/20
to codehau...@googlegroups.com
Hi Ali, I think I will add another additional doc for using glassfish6x container and the limitation there when Cargo 1.8.3( and maybe Glassfish v6) is ready for GA. 
Currently, I just verified GFv6 is working well with cargo 1.8.2 glassfish5x containerId.
It's my pleasure to add my doc link to the Codehaus Articles page.
Thanks.

S. Ali Tokmen

unread,
Nov 15, 2020, 7:42:59 AM11/15/20
to codehau...@googlegroups.com

Hi Hantsy

Excellent - Thanks a lot!

I meanwhile noticed that the latest Eclipse GlassFish artifacts made it to Central, which makes the Codehaus Cargo Maven2/Maven3 configuration easier as it enables the usage of the Artifact Installer:

<plugin>
  <groupId>org.codehaus.cargo</groupId>
  <artifactId>cargo-maven2-plugin</artifactId>
  <version>${cargo.version}</version>
  <configuration>
    <container>
      <containerId>glassfish6x</containerId>
      <artifactInstaller>
        <groupId>org.glassfish.main.distributions</groupId>
        <artifactId>glassfish</artifactId>
        <version>6.0.0-RC2</version>
      </artifactInstaller>
    </container>
    <configuration>
      <home>${project.build.directory}/glassfish6x-home</home>
      <properties>
        <cargo.hostname>${cargo.hostname}</cargo.hostname>
        <cargo.servlet.port>${cargo.servlet.port}</cargo.servlet.port>
        <cargo.glassfish.admin.port>${cargo.glassfish.admin.port}</cargo.glassfish.admin.port>
      </properties>
    </configuration>
    <deployables>
      <deployable>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>simple-war</artifactId>
        <type>war</type>
      </deployable>
    </deployables>
  </configuration>
</plugin>

hantsy bai

unread,
Nov 15, 2020, 11:55:13 PM11/15/20
to codehau...@googlegroups.com
Hi Ali,

Tried to add arquillian glassfish managed container to run my test, got an error when retrieving glassfish zip by dependency plugin. https://github.com/hantsy/jakartaee9-starter-boilerplate/pull/40/checks?check_run_id=1404528172

Not sure why a zip file has some extra dependencies.

Hantsy


S. Ali Tokmen

unread,
Nov 16, 2020, 3:03:04 PM11/16/20
to codehau...@googlegroups.com

Hi Hantsy

The builds has an error:

Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.2:unpack (unpack) on project jakartaee9-starter-boilerplate: Unable to find/resolve artifact.: Failed to read artifact descriptor for org.glassfish.main.distributions:glassfish:zip:6.0.0-RC2: Could not find artifact org.glassfish.tyrus:tyrus-bom:pom:2.0.0-RC1 in central (https://repo.maven.apache.org/maven2) -> [Help 1]

That's a problem with Eclipse GlassFish's Maven artifacts: the GlassFish 6.0.0-RC2 distribution depends on Tyrus 2.0.0-RC1, which they forgot to deploy in Central: https://mvnrepository.com/artifact/org.glassfish.tyrus/tyrus-bom. Why the ZIP has extra dependencies is a good question - My guess is that the Eclipse GlassFish package has not been done with the utmost care yet 😕

Hopefully, they get things right when they package and publish the actual 6.0.0 release.

S. Ali Tokmen

unread,
Nov 16, 2020, 3:10:21 PM11/16/20
to codehau...@googlegroups.com

hantsy bai

unread,
Nov 20, 2020, 10:53:21 PM11/20/20
to codehau...@googlegroups.com
Hi Ali, I have tried it, it does not work with the unpack goal[1], I've filed an issue on Glassfish, but no response till now.


Regards,
Hantsy

Reply all
Reply to author
Forward
0 new messages