Forcibly releasing an already closed connection - eclipselink

I am using EclipseLink with JTA. when I run the application using WebLogic server version(12.2.1.3.0) faced the following issue
[EL Warning]: 2020-06-03 16:17:13.679--ClientSession(1584629836)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLRecoverableException: The connection has been administratively diabled. Try again later. The action was taken by a console or administrative command. java.lang.Exception: It was disabled at Wed Jun 03 16:17:13 IST 2020
at weblogic.jdbc.common.internal.ConnectionEnv.disable(ConnectionEnv.java:454)
at weblogic.jdbc.wrapper.JDBCWrapperImpl.removeConnFromPoolIfFatalError(JDBCWrapperImpl.java:159)
<Forcibly releasing an already closed connection "[weblogic.jdbc.wrapper.JTAConnection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_LogicalConnection-platform-2420, ]" back into the data source connection pool "platform".>
PS - Not facing this issue with WebLogic version(12.2.1.2.0)

As per a somewhat dated oracle article, there are a number of causes, such as the database going down (temporarily or longer), or bugs in WLS itself. The bugs mentioned have been fixed, but that doesn't mean something new wasn't introduced or just some setting you had in 12.2.1.2.0 doesn't work or apply the same in 12.2.1.3.0.
Solutions vary, but check that the datasource is disabled and manually enable it through the console, and change the datasource settings so that isn't disabled unnecessarily in the future:
https://docs.oracle.com/cd/E23943_01/web.1111/e13737/ds_tuning.htm#JDBCA180

Related

EJB Timer Service is not available, undeployment failed for context

I have the following code:
package ejbs;
import javax.annotation.Resource;
import javax.ejb.Singleton;
import javax.ejb.Timeout;
import javax.ejb.Timer;
import javax.ejb.TimerConfig;
import javax.ejb.TimerService;
#Singleton
public class timerbackup {
#Resource
private TimerService timerservice;
#Timeout
public void methodTimeout(Timer timer)
{
System.out.println("timeout");
}
public void settimer(long in)
{
Timer timer=timerservice.createSingleActionTimer(in,new TimerConfig());
}
}
After deploying the application appeared the error message "EJB Timer Service is not available".
To solve the problem i followed these steps:
Access the glash fish admin console (http://localhost:4848)
Go to Configurations->server-config->EJB Container
Select the tab EJB Timer Service
Then fill out Timer Datasource: with your JDBC Resource (i used "jdbc/projecto_final")
Restart the server
As suggested in Set/configure the EJB Timer Service’s DataSource.
This resulted but after sometime the TimerService stopped working. After deploying the application appears the following error messages:
Severe: Exception while loading the app
Severe: Undeployment failed for context /ProjetoEE1
Info: /file:/E:/formacaoJAVA/2moduloJEE/pratica/projecto_final /projfinal2/ProjetoEE1/build/web/WEB-INF/classes/_DEFAULT_PU logout successful
Warning: EJB Timer Service is not available. Timers for application with id 96332697224871936 will not be deleted
The Set/configure the EJB Timer Service’s DataSource also mention this problem, and present a solution in Glassfish DeploymentException: Error in linking security policy for.
The solutions presented in Glassfish DeploymentException: Error in linking security policy for consists basically in delete some files. The answer more voted suggests basically the following:
Stoped the Glassfish server
Deleted all the content from glassfishhome/glassfish/domains/ yourdomainname/generated
Started Glassfish
I have installed the "GlassFish Server 4.1.1", and this doesn´t work.
The second answer more voted suggests the basically the following:
1.All that's needed to fix this problem is delete the entire OSGi cache under $GLASSFISH_HOME/glassfish/domains//osgi-cache
This also doesn´t work.
What i can do? Any help will be very appreciate
Best regards,
Rafael Costa
I have solved the "same" problem in
deleting glassfish/domains/domain-name/generated folder completely
building application again
restarting glassfish application
In my case, I have installed a new version of my application after a Pull/Push operation with GIT and my application has stopped to work. So I know that before this new build my application worked well and that nothing has been changed on Glassfish.
I have found some explanation on another following site
https://dzone.com/articles/solving-ejb-timer-service-not-available-error-in-g-1
The Glassfish application server uses its embedded JAVADB to persist the state of its available EJB timers. Not setting the data resource for the timer service correctly prevents the EJB timers from being restored and eventually from functioning properly. In this case, normally the “EJB timer service not available” error message is returned. This problem prevents any application that uses an EJB timer service from being started or deployed.
There are two procedures available to overcome such blocking situations:
The first solution is to go to JDBC connection pools and double check the health of the Timerpool connection pool by pinging it. If the ping fails then the connection pool needs to be checked or to be redefined.
If pinging the connection pool is successful, then the problem could be the presence of the EJB timer marker file. A marker file is created whenever a problem occurs during the EJB timer service start-up or restore.
Deleting the marker will solve the problem. The marker file "ejb-timer-service-app" located under as-install-parent/glassfish/domains/domain-name/generated/ejb/. Dont forget to restart Glassfish !
Replace
import javax.ejb.Singleton;
With
import javax.inject.Singleton;
It worked for me. I'm using Derby database is it the case for you?
I solved the problem. If i remenber, i created a new JDBC resource and a new JDBC Connection Pool.
The following link explains how to create a JDBC resource and a JDBC Connection Pool.
General Steps for Creating a JDBC Resource
The JDBC resource and the JDBC Connection Pool can be created using the admin console or the asadmin utility.
The following link explains how to use the asadmin utility.Using the asadmin Utility
(I used this utility because in the admin console when i tried to create a JDBC resource and a JDBC Connection Pool appeared an error)
In the admin console, in the created JDBC Resource the field "Pool Name" should equals the name of the created JDBC Connection Pool.
After that i followed these steps:
Configurations->server-config->EJB Container
Select the tab EJB Timer Service
Fill the field Timer Datasource with the name of the JDBC resource.
Restart the server
Any question please feel free.
Best Regards Rafael Santos Costa
Hello I met the same problem if you have glassfish 4.1.1 there is probably an instability in the server with respect to timer.
Solution: update glassfish 4.1 to glassfish 5 and deploy the web application in this new server

Endeca initialize_services.bat error

I'm trying to create a sample application in endeca. When i run the initailze_services.bat I'm getting the following error log.
[01.30.15 11:54:07] SEVERE: Caught an exception while checking provisioning.
Caused by com.endeca.soleng.eac.toolkit.exception.EacCommunicationException
com.endeca.soleng.eac.toolkit.application.Application setDefinition - Caught exception while defining application 'ATGen'.
Caused by com.endeca.eac.client.EACFault sun.reflect.NativeConstructorAccessorImpl newInstance0 - null
Failure to initialize EAC application.
I tried solving this issue by deleting the state folder in platform services and then running it again. But still the same issue persists. Any help appreciated.
EACCommunicationException can mean a few things:
The EAC Central Server isn't running (fixed by ensuring that you've successfully started all Endeca services (Platform Services and Tools and Frameworks)
EAC Central Server is running, but couldn't be reached (fixed by ensuring you have the correct port and hostname specified for eacHost and eacPort in config/scripts/AppConfig.xml, and that you have no firewall rules blocking communication with EAC Central Server)

BIRT report with web service data source throwing exception Unable to open connection. org.eclipse.datatools.connectivity.oda.OdaException

I am trying to user web service as a datasource for BIRT report.
Report run well in Eclipse but from the webviewer deployed in tomcat it doesn't.
BIRT version : 4.2.1
Tomcat: 6
Below is the exception I am getting.
Dec 6, 2012 3:00:01 PM org.eclipse.birt.data.engine.odaconsumer.ConnectionManager openConnection
SEVERE: Unable to open connection.
org.eclipse.datatools.connectivity.oda.OdaException
at org.eclipse.datatools.enablement.oda.ws.impl.Connection.open(Connection.java:81)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaConnection.open(OdaConnection.java:250)
at org.eclipse.birt.data.engine.odaconsumer.ConnectionManager.openConnection(ConnectionManager.java:165)
at org.eclipse.birt.data.engine.executor.DataSource.newConnection(DataSource.java:224)
at org.eclipse.birt.data.engine.executor.DataSource.open(DataSource.java:212)
at org.eclipse.birt.data.engine.impl.DataSourceRuntime.openOdiDataSource(DataSourceRuntime.java:217)
at org.eclipse.birt.data.engine.impl.QueryExecutor.openDataSource(QueryExecutor.java:407)
at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:317)
Is there a "Caused by:" in the stack trace?
As a wild guess, this is a network/firewall problem. I assume that he Tomcat server is running on a different machine and/or with a different OS account than your Eclipse IDE.

Liferay stopped at database shutdown caused a crash

I was stopping the Liferay portal, but few seconds after, I stopped the database (db2 quiesce, that means, that the connections are closed) and apparently, Liferay did not stopped correctly its execution.
After that, I restarted the database and liferay, but the portal does not work now. It shows this message in the browser:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet execution threw an exception
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
...
root cause
java.lang.NoSuchMethodError: com.liferay.portal.util.PortalUtil.getCDNHostHttp()Ljava/lang/String;
com.liferay.portal.events.ServicePreActionExt.servicePre(ServicePreActionExt.java:937)
After looking in the logs, I found the following messages (they are edited):
SEVERE: Error waiting for multi-thread deployment of directories to completehostConfig.deployWar=Deploying web application archive {0}
java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1000)
WARN [DefaultConnectionTester:203] SQL State '08001' of Exception which occurred during a Connection test (fallback DatabaseMetaData test) implies that the database is invalid, and the pool should refill itself with fresh Connections.
com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException: [jcc][t4][2030][11211][3.63.75] A communication error occurred during operations on the connection's underlying socket, socket input stream, or socket output stream. Error location: Reply.fill() - insufficient data (-1). Message: Insufficient data. ERRORCODE=-4499, SQLSTATE=08001
at com.ibm.db2.jcc.am.fd.a(fd.java:321)
WARN [DefaultConnectionTester:136] SQL State '08001' of Exception tested by statusOnException() implies that the database is invalid, and the pool should refill itself with fresh Connections.
WARN [C3P0PooledConnectionPool:708] A ConnectionTest has failed, reporting that all previously acquired Connections are likely invalid. The pool will be reset.
WARN [NewPooledConnection:486] [c3p0] A PooledConnection that has already signalled a Connection error is still in use!
WARN [NewPooledConnection:487] [c3p0] Another error has occurred [ com.ibm.db2.jcc.am.SqlNonTransientConnectionException: [jcc][t4][10335][10366][3.63.75] Invalid operation: Connection is closed. ERRORCODE=-4470, SQLSTATE=08003 ] which will not be reported to listeners!
com.ibm.db2.jcc.am.SqlNonTransientConnectionException: [jcc][t4][10335][10366][3.63.75] Invalid operation: Connection is closed. ERRORCODE=-4470, SQLSTATE=08003
WARN [BasicResourcePool:1841] com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask#4fad5112 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (3). Last acquisition attempt exception:
com.ibm.db2.jcc.am.SqlNonTransientConnectionException: DB2 SQL Error: SQLCODE=-20157, SQLSTATE=08004, SQLERRMC=FUT5MAN;QUIESCE DATABASE;;, DRIVER=3.63.75
ERROR [PortalJobStore:109] MisfireHandler: Error handling misfires: Unexpected runtime exception: null
org.quartz.JobPersistenceException: Unexpected runtime exception: null [See nested exception: java.lang.reflect.UndeclaredThrowableException]
Caused by: java.lang.reflect.UndeclaredThrowableException
at $Proxy279.prepareStatement(Unknown Source)
at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.countMisfiredTriggersInState(StdJDBCDelegate.java:413)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319)
Now, I see that it is almost impossible to start the current Liferay installation. However, I have the database (I made a full backup), and the lucene's data directory. How can I recreate a Liferay installation with these two things? I would like to recover some of this data in a new installation, but I do not how.
This is not the best solution, but I installed Liferay with a new database. Once it was configured, I change the database configuration in order to use the other one.
Probably, it was a problem with the ROOT deployment, but this is very weird.
I could recover all the data from the Lucene and the database.
The database is still quiesced and the Liferay user doesn't have the QUIESCE_CONNECT privilege.
Unquiesce the database and restart Liferay.
Using DB2 instance owner (if you're on Windows, any administrator):
db2 connect to DBNAME
db2 unquiesce database
db2 connect reset
Regards.

glassfish server admin console stalls saying: The admin console application is loaded

I am having some trouble getting into my glassfish server admin console (although I think it may actually be a symptom of a larger problem)
What I am seeing is that when I go to: http://localhost:4848/ I get a page that says: Welcome to glassfish server open source edition 3.1 (build 43) and then a status section below that. The status makes it to "The admin console application is loaded" but seems to stall there. If I refresh the page, it is just a blank page. I have to reboot the glassfish server from eclipse in order to get back to that "welcome to glassfish" page.
I looked in my server logs and found a ton of "SEVERE" problems, all of which seem to relate to this one:
[#|2011-10-06T18:03:10.869-0500|SEVERE|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=100;_ThreadName=Thread-1;|Exception while invoking class com.sun.enterprise.web.WebApplication start method
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Error reading configuration file
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:130)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:286)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:364)
at com.sun.enterprise.v3.admin.adapter.InstallerThread.load(InstallerThread.java:210)
at com.sun.enterprise.v3.admin.adapter.InstallerThread.run(InstallerThread.java:108)
|#]
Has anyone have any thoughts on what might be going on here? I'm very new to glassfish and rather confused! Thanks in advance.
Avtar
I think I had similar problem when running on Open JDK, check which JDK are you using, if its' openjdk then dowload and set as your default sun-jdk