Need to recompile Java Service after package reload or IS restarted

Product/components used and version/fix level:

10.15

Detailed explanation of the problem:

Hello,

I have a small Java program in my package, but every time the package is reloaded or the IS is restarted, I encounter an error that requests recompiling the Java program.

Any idea to get rid of this issue?

Error messages / full error message screenshot / log file:

com.wm.app.b2b.server.ServiceException: [ISS.0026.9102] Service ‘endsWith’ is not operational. To run this service, first recompile the Java source.

Question related to a free trial, or to a production (customer) instance?

You may find info in this thread helpful.

The suggested URL for correction is not accessible in the ticket.

The suggested URL is another thread in this community forum. If you have access to this current thread, you have access to the thread in my post.

Referring to the provided URL as a “correction” is not really accurate. It is an exchange which may have information that may apply to the issue you’re facing.

Referring to this thread as a “ticket” implies this is a help desk system or official support. It is not. It is a community forum where mostly SAG customers exchange info and try to assist each other. SAG employees often participate as well but in an informal manner.

I mention these terminology items only to guide expectations. If you want/need official support, you’ll want to create a ticket with SAG on Empower.

Hi Rob,

the post you mentioned can be accessed, but it contains another link to the documentation section of the community, which is not working. It is leading to a 404 “not found” error.

Regards,
Holger

@Holger_von_Thomsen - Thanks for the info!

I’m having a hard time understanding how a package reload or server restart could make a Java service “not operational”. Is there a startup or shutdown service in that package (or dependent package) that is doing something unusual? Is this occurring in a local development environment or a regular environment? Is someone opening the service and editing it before the service is executed again?

If the Integration Server itself is “breaking” the service upon restart, this would constitute a bug so you may need a support ticket. It would be a pretty significant and unlikely bug though. Feel free to share your package if you’d like us to try it out ourselves.

Percio

1 Like

It is because there is a class that is referenced by the java service that has compilation errors.

The integration server doesn’t change anything in the standard java runtime except place the class files in he right place and set the classpath. So if just a simple restart is making the service go from available to unavailable, it’s either a bug or some code is removing a dependency somewhere. Can you please archive the package when it’s working and then reboot and archive it again when its not working ? A diff on those will confirm nothing is broken in the package. Another aspect to compare is the server classpath before and after. It may help if you can include the code of your service too. I am assuming its trivial.

Rupinder

Hello,

Thanks for your reply
I have archived the packages as you requested, but I can’t find any difference between the two packages; they are identical. I also don’t see any difference in the classpath.
It’s really strange.

Hi,

might it be that this a package load order issue?

That the package with the affected service gets loaded before the package containing the jar on which this service depends?
In this case you will have to define a package dependency in the package properties in Designer to correct the load order.

Regards,
Holger

I have no dependencies on JAR files or services. It’s a Java program that simply uses the .endsWith method.

Can you please share the code of the entire class ? Not the service but the .java file.

Rupinder Singh

The code of the entire class :

java.java (2.0 KB)

Hi,

I cannot see anything problematic here.

Regards,
Holger

There are no dependencies here. So I don’t see any problem. The reasons that you get such an error:

  1. The class was not compiled. In that case, the code\classes\S103\priv\java.class would be missing.
  2. The class was compiled but with the wrong JVM version. In that case the class would exist but be incompatible with the JVM that the server is running under. But that cannot be the case here as it works and then stops working on restart. Could there be a situation where you restart the server and somehow change the JVM that the server is running under ?

One additional thing to try could be to rename your folder from java to something else. Unlikely that is an issue but just want to make sure java isnt a reserved word that confuses the server. But that is pure guess and unlikely.

I think you may have run into a bug.

Rupinder Singh

If it’s not an issue, can you share the package ?

Rupinder Singh

The endsWith method can be replaced by a FLOW service. There is no need to use Java in this case.

What is the folder structure of the package? Are there nested folders with Java code in multiple levels? This can cause naming conflicts.

1 Like

Hi,

regarding the second point of your list:

This would only be an issue when class was compiled with a newer major version java as the one the IS is running on.
In this case there should be an error message with a class file version conflict.

When viewing the class file with a hex editor, the first 4 Bytes should read as “CAFEBABE” and the next 2 Bytes after this contain the hexadecimal representation of the class file version. See Wikipedia which java version uses which class file version.

Regards,
Holger

1 Like

I’ve tried all the suggested solutions, but it doesn’t resolve my issue.
For your information, in the log traces, I have the following message:

2023-10-23 14:09:53 CEST [ISS.0055.0003E] (tid=337) Initialization of Java Service failed due to error:
com.wm.app.b2b.server.ServiceSetupException: java.lang.NoClassDefFoundError: IData