OpenLiberty / liberty-arquillian

Arquillian Liberty Managed and Remote containers
Apache License 2.0
11 stars 29 forks source link

Deployment Timeout while waiting for "test" ApplicationMBean #94

Open hantsy opened 3 years ago

hantsy commented 3 years ago

In the former plain Jakarta EE 8 codes, just included some simple CDI codes, the Arquillian liberty managed container worked well.

In the latest days, I am trying to add EJB and JMS samples found OpenLIberty does not follow the default resources rule (DefaultDataSource, DefaultJMSConnectionFactory) as other application servers, and also did not support portable resource configuration eg @JMSDestinationDefinition in codes, etc.

I added a simple ejb branch to taste EJB features on the popular application servers, but OpenLiberty does not work as expected. I have already added DefaultDataSource configuration in the server.xml file.

But I can not make the test passed, and always got an error DeploymentException: Timeout while waiting for "test" ApplicationMBean to reach STARTED. Actual state: STARTING, when running the test:

mvn clean verify -Parq-liberty-managed -Dit.test=BasketEjbTest

I described the issue on StackOverflow, check here and this jms topic.

scottkurz commented 3 years ago

@hantsy have you tried increasing the appDeployTimeout in your src/test/arq-liberty-managed/arquillian.xml file? E.g.

         <configuration>
             ...
             <property name="appDeployTimeout">120</property>
         </configuration>

Your example seemed to work for me once I added that.

hantsy commented 3 years ago

@scottkurz Yeah, increasing the app deploy time resolved the issue. But from the log, there is an error like this.

8823 FINER: AppMBean for test is in state STARTING 8824 
[ERROR ] CWWKZ0013E: It is not possible to start two applications called test

It was deployed twice? I have searched this error, it seems it is also occured in the ci.maven Github issues.

scottkurz commented 3 years ago
[ERROR ] CWWKZ0013E: It is not possible to start two applications called test

@hantsy, I didn't observe that myself. Usually this comes up if you deploy the app to dropins and also explicitly configure it in server.xml. From your branch config I don't see the app configured in server.xml, it looks like you're only using one deployment to dropins. So I'm not sure why this would happen. Did you try a mvn clean first?

This has been an issue in ci.maven (liberty-maven-plugin)... however that's not directly relevant. In liberty-maven-plugin we handle deployment across three cases: dropins, apps with existing config, and we offer a third case where the plugin will generate config....and the issues you're probably seeing have been a couple bugs where we generated the app config but shouldn't have.

Again, I'm not sure that's directly relevant, but maybe some background context that can help.

hantsy commented 3 years ago

@scottkurz Thanks. Nevertheless, it resolved my issues.

hantsy commented 3 years ago

Personally, I hope Liberty Arquillian can provide more friendly exception info to guide developers to fix it.

Such as:

App deployment timeout....try adding a `appDeployTimeout` into the *arquillian.xml* to increase the deployment timeout

Secondly, hope the Liberty arquillian project internally applies a retry rule to reset the timeout counter and try again to check the deployment status if it is timeout. Some adapters have a retries property.