Duplicate a liberty server, application won't start - java-8

I have installed on my laptop a Liberty server, just unzipped, launched server create <name> and copied some files from the remote server test environment and put a .war with a local configuration.
Run the server through command line and the application is working.
Now I tried to do the same on a colleague laptop, but the application seems that is started, but when I call a rest endpoint I have no response, just an ERR_CONNECTION_REFUSED from browser.
I tried to copy my exact folder on his laptop, same problem. I tried to copy my server folder on another folder in my laptop, same problem. I tried with different version of the server, but nothing change. I tried to copy the server from test environment on my laptop and using my .war, no way. The .war is always the same, the one that's working on my first attempt, I checked to not have hard-coded path.
The log:
...
com.ibm.ws.http.internal.VirtualHostImpl A CWWKT0016I: Web application available (default_host): http://localhost:9080/idsWS/
com.ibm.ws.session.WASSessionCore I SESN0176I: A new session context will be created for application key default_host/idsWS
com.ibm.ws.util I SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.
io.jaegertracing.Configuration I Initialized tracer=JaegerTracer(version=Java-0.34.0, serviceName=ws-ids, reporter=RemoteReporter(sender=UdpSender(), closeEnqueueTimeout=1000), sampler=RemoteControlledSampler(maxOperations=2000, manager=HttpSamplingManager(hostPort=localhost:5778), sampler=ProbabilisticSampler(tags={sampler.type=probabilistic, sampler.param=0.001})), tags={hostname=CTXW10VDDN-006, jaeger.version=Java-0.34.0, ip=26.0.226.195}, zipkinSharedRpcSpan=false, expandExceptionLogs=false, useTraceId128Bit=false)
m.ibm.ws.microprofile.opentracing.jaeger.JaegerTracerFactory I CWMOT1001I: A JaegerTracer instance was created for the ws-ids application. Tracing information is sent to localhost:6831.
com.ibm.ws.app.manager.AppMessageHelper A CWWKZ0001I: Application ws-ids started in 39.529 seconds.
<-------------------------------------------->
com.ibm.ws.webcontainer.extension W SRVE0190E: File not found: /openapi/ui/
.jaxrs20.cdi.component.JaxRsFactoryImplicitBeanCDICustomizer W CWWKW1002W: The CDI scope of JAXRS Provider FakeRestFilter is javax.enterprise.context.Dependent. Liberty gets the provider instance from CDI.
.jaxrs20.cdi.component.JaxRsFactoryImplicitBeanCDICustomizer W CWWKW1002W: The CDI scope of JAXRS Provider PortaleCookieFilterRest is javax.enterprise.context.Dependent. Liberty gets the provider instance from CDI.
.jaxrs20.cdi.component.JaxRsFactoryImplicitBeanCDICustomizer W CWWKW1002W: The CDI scope of JAXRS Provider BusinessExceptionMapper is javax.enterprise.context.Dependent. Liberty gets the provider instance from CDI.
.jaxrs20.cdi.component.JaxRsFactoryImplicitBeanCDICustomizer W CWWKW1002W: The CDI scope of JAXRS Provider GenericExceptionMapper is javax.enterprise.context.Dependent. Liberty gets the provider instance from CDI.
.jaxrs20.cdi.component.JaxRsFactoryImplicitBeanCDICustomizer W CWWKW1002W: The CDI scope of JAXRS Provider UnknownUrlExceptionMapper is javax.enterprise.context.Dependent. Liberty gets the provider instance from CDI.
.jaxrs20.cdi.component.JaxRsFactoryImplicitBeanCDICustomizer W CWWKW1002W: The CDI scope of JAXRS Provider ValidationExceptionMapper is javax.enterprise.context.Dependent. Liberty gets the provider instance from CDI.
.apache.cxf.cxf.core.3.2:1.0.71.cl221220221107-1900(id=116)] I Setting the server's publish address to be /api/
com.ibm.ws.webcontainer.servlet I SRVE0242I: [ws-ids] [/idsWS] [it.sogei.dichiarazioneids.ws.server.JAXRSActivator]: Initialization successful.
eclipselink I CWWJP9990I: [eclipselink] EclipseLink, version: Eclipse Persistence Services - 2.7.11.v20220804-52dea2a3c0
com.ibm.ws.rsadapter.impl.DatabaseHelper I DSRA8203I: Database product name : Oracle
com.ibm.ws.rsadapter.impl.DatabaseHelper I DSRA8204I: Database product version : Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
com.ibm.ws.rsadapter.impl.DatabaseHelper I DSRA8205I: JDBC driver name : Oracle JDBC driver
com.ibm.ws.rsadapter.impl.DatabaseHelper I DSRA8206I: JDBC driver version : 12.2.0.1.0
Before the line the logs are the same, below the line only the working application write the logs after that an endpoint is called. If I call the same api url on my colleague laptop, too if as written in the logs above the application ws-ids seems started, no others logs are written.
I understand that I'm not giving much information, but the server.xml, server.env and the .war and all the other configuration file are really the same.
It seems like the server is starting my application, without loading it to the server. Any idea? Which information could I add?

Related

Weblogic Database Connectionpool Unbinds , when the spring application is undeployed

I'm developing a spring(4.3.2 release) application and it uses 2 connectionpool for the database operations.
The problem is that the connectionpool is unbinded from JNDI , when the application is un-deployed and it's not available for the next deployment.
This issue is happening only in the PRE-PRODUCTION environment and doesn't occur in the TEST.
Please help me with your thoughts
Thanks,
Vimal

JSTL SQL setDataSource not working with Webshpere 8.5

<sql:setDataSource var="TCIT" scope="application"
driver="${driver}"
url="${url}"
user="${username}"
password="${password}" />
The above code is used in a legacy application deployed in OC4J that is being migrated to WebSphere 8.5. The properties in {} above are fetched from a property file. Ensured the values are coming correctly form there. However, when the database connection is created the application is encountering the following exception: Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver" . I have the ojdbc14.jar in the WEB-INF/lib folder, still facing the issue.
Finally the issue got resolved creating a JDBC connection pool at Application server level. Turns out Websphere does not allow the connection to be created using the above method. Below is the modified tag that is using JNDI lookup for accessing the JDBC connection pool at application level.
<sql:setDataSource var="connPool" scope="application" dataSource="${jndi.devPool}"/>

How to have Liberty Profile eagerly load apps on startup

Liberty Profile is loading EARs and WARs we deploy to it only when the server receives it's first request. How can we tell it to eagerly load applications upon server start?
We're using the latest 8.5.5 WLP.
Thanks,
Stu
You can configure the WebContainer to fully initialize the application prior to the first request by adding the following to your server.xml:
<webContainer deferServletLoad="false"/>

EJB Reference Configuration Error

I have 2 ears—say, Ear1 and Ear2—for my application, which are deployed in clusters. Ear2 is having Ejb which is being called from Ear1. EJB reference is required for communication between Ear2 and Ear1. I am setting the below value to
Target Resource JNDI Name: corbaloc::ClusterServer1:2810,:ClusterServer2:2810/cell/clusters/Cluster1/ejb/com/mycompanyName/projectName/ejb/facade/EjbFacadeHome
But I am getting the below error:
Caused by: javax.naming.ServiceUnavailableException: A communication failure occurred while attempting to obtain an initial context with the provider URL: "corbaloc::mums00100251.in.net.intra:2810,:mums00100392.in.net.intra:2810/cell/clusters/Cluster1/ejb/com/bnpparibas/tradefinance/ejb/facade/EjbFacadeHome". Make sure that any bootstrap address information in the URL is correct and that the target name server is running.
Please help.
The correct format for referencing remote EJB with WebSphere Application Server 6.1 in this case would be like:
corbaloc:iiop:mums00100251.in.net.intra:2810/ejb/com/bnpparibas/tradefinance/ejb/facade/EjbFacadeHome,iiop:mums00100392.in.net.intra:2810/ejb/com/bnpparibas/tradefinance/ejb/facade/EjbFacadeHome
2810 suggests you attempted to use either the bootstrap port of node agents or deployment manager. I would check the ports (you can find the BOOTSTRAP port from the management console under Ports section of the server preferences), and if they still fail use the actual application servers' bootstrap ports.
There could also be a scoping issue which would mandate that. If you deployed your application to the Cluster scope it is possible that the naming service only in the cluster members can actually resolve the EJB.

Hot deploy problem in Tomcat with proxool and oracle

I have a problem concerning with proxool and oracle driver in Tomcat.
The web application I use contains a webservice jar file using metro and a servlet to initialize / start the proxool pool. The proxool pool is configured with an oracle connection. When the service is called, it fetches a connection from the pool, executes a statement and returns. I close the resultset, the statement and the connection in the service method afterwards.
When I now try to hot undeploy the web application, the servlet stops proxool pool by ProxoolFacade.shutdown(); in it's destroy method.
The problem is, that the hot undeploy can not finish because the Oracle driver ojdbc5.jar can not be deleted from the folder of the extracted web application.
Trying the same with a SQL server database and the jtds driver it works without this problem.
Used versions:
Apache Tomcat 6.0.18
Oracle 11g JDBC driver 11.1.0.6.0
Proxool 0.9.1
Anyone has an idea?
Regards Timo
You must add the Oracle driver to the Tomcat instance and configure Tomcat JNDI with an Oracle datasoure.
This way, the driver will stay alive when the app is terminated and Tomcat will control the pooling of the DB connections. The reason for your problem is that some DB drivers "hook" into the VM. This means that Tomcat can't unload the classes during redeploy -- there are still references around.
I'd even suggest to try to move proxool into the Tomcat server and have Tomcat manage the pools for you. That would make hot deploy much faster and more reliable, even if you leak connections.

Resources