Heinz Uller

Greenhorn
+ Follow
since Jun 06, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Heinz Uller

Just to be sure (naive maybe): I also updated the SQL driver, restarted the SQL server, and restarted the GlassFish server (the GlassFish server actually many times, i.e. before each new test run).

The problem is still there.

Can somebody help me? Please?

Kind regards,

Heinz
10 years ago
Now, after a run of the application (not succesful), I also get the following two error logs.

Timestamp
Sep 15, 2013 11:15:57.641
Log Level
WARNING
Logger
com.sun.grizzly.config.GrizzlyServiceListener
Name-Value Pairs
_ThreadID=12;_ThreadName=Thread-2;
Record Number
2819
Message ID
Complete Message
GRIZZLY0023: Interrupting idle Thread: admin-thread-pool-4848(50).


AND



[#|2013-09-15T11:15:57.641+0000|WARNING|glassfish3.1.2|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=12;_ThreadName=Thread-2;|GRIZZLY0023: Interrupting idle Thread: admin-thread-pool-4848(50).|#]

[#|2013-09-15T11:15:57.723+0000|SEVERE|glassfish3.1.2|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=34;_ThreadName=Thread-2;|service exception
java.lang.RuntimeException: ClientAbortException: java.nio.channels.ClosedChannelException
at org.glassfish.admin.rest.LazyJerseyInit.reportError(LazyJerseyInit.java:198)
at org.glassfish.admin.rest.adapter.RestAdapter.reportError(RestAdapter.java:350)
at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:183)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:679)
Caused by: ClientAbortException: java.nio.channels.ClosedChannelException
at com.sun.grizzly.tcp.http11.GrizzlyOutputBuffer.doFlush(GrizzlyOutputBuffer.java:439)
at com.sun.grizzly.tcp.http11.GrizzlyOutputBuffer.flush(GrizzlyOutputBuffer.java:405)
at com.sun.grizzly.tcp.http11.GrizzlyOutputStream.flush(GrizzlyOutputStream.java:140)
at org.glassfish.admin.rest.LazyJerseyInit.reportError(LazyJerseyInit.java:195)
... 20 more
Caused by: java.nio.channels.ClosedChannelException
at java.nio.channels.spi.AbstractSelectableChannel.register(AbstractSelectableChannel.java:184)
at java.nio.channels.SelectableChannel.register(SelectableChannel.java:271)
at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:141)
at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:76)
at com.sun.grizzly.util.SSLOutputWriter.flushChannel(SSLOutputWriter.java:102)
at com.sun.grizzly.ssl.SSLOutputBuffer.flushChannel(SSLOutputBuffer.java:138)
at com.sun.grizzly.http.SocketChannelOutputBuffer.flushBuffer(SocketChannelOutputBuffer.java:489)
at com.sun.grizzly.http.SocketChannelOutputBuffer.flush(SocketChannelOutputBuffer.java:467)
at com.sun.grizzly.http.ProcessorTask.action(ProcessorTask.java:1276)
at com.sun.grizzly.ssl.SSLProcessorTask.action(SSLProcessorTask.java:164)
at com.sun.grizzly.tcp.Response.action(Response.java:268)
at com.sun.grizzly.tcp.http11.GrizzlyOutputBuffer.doFlush(GrizzlyOutputBuffer.java:434)
... 23 more
|#]


Can somebody please help me? Even a hint or a suggestion? This is getting out of control.

Kind regards,

Heinz
10 years ago
Dear All,

Summary of my problem/question

An application of mine ran succesfully for more than two months on a GlassFish server 3.1.2, collecting specific data from the web and writing this (processed) data in an SQL database.
Suddenly, two days ago, I started to get connection timed out messages quasi ad random. Sometimes the application works, sometimes it fails.

Note: I did not change anything to the application as well as nothing with respect to the Resource and Pool specifics. Everything is the same as before the problem (only a slight increase of data in the database, as the application accumulates more data throughout the days, but nothing extreme).

Here's a sample from the error in the logs:



[#|2013-09-13T02:46:43.352+0000|WARNING|glassfish3.1.2|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=31;_ThreadName=Thread-2;|javax.ejb.EJBException
at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:5215)
at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:5113)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4901)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2045)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1994)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:222)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
at $Proxy215.getNationCodeTranslation(Unknown Source)
at logic.__EJB31_Generated__AuxEJB__Intf____Bean__.getNationCodeTranslation(Unknown Source)
at logic.TEDTenderCrawler.visit(TEDTenderCrawler.java:168)
at edu.uci.ics.crawler4j.crawler.WebCrawler.processPage(WebCrawler.java:306)
at edu.uci.ics.crawler4j.crawler.WebCrawler.run(WebCrawler.java:189)
at java.lang.Thread.run(Thread.java:679)

Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: No operations allowed after connection closed.Connection was implicitly closed due to underlying exception/error:


** BEGIN NESTED EXCEPTION **

com.mysql.jdbc.CommunicationsException
MESSAGE: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: Connection timed out

STACKTRACE:

java.net.SocketException: Connection timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:146)
at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1994)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2411)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2916)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1467)
at com.sun.gjc.spi.jdbc40.PreparedStatementWrapper40.executeQuery(PreparedStatementWrapper40.java:642)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:931)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:607)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:535)
at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:1717)
at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:566)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:207)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:264)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:646)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2611)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2570)
at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:420)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1081)
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:844)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1040)
at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:392)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1128)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2871)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1516)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1498)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1463)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:485)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getResultList(EJBQueryImpl.java:742)
at logic.AuxEJB.getNationCodeTranslation(AuxEJB.java:89)
at sun.reflect.GeneratedMethodAccessor286.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5388)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:162)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:144)
at sun.reflect.GeneratedMethodAccessor269.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5360)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5348)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
at $Proxy215.getNationCodeTranslation(Unknown Source)
at logic.__EJB31_Generated__AuxEJB__Intf____Bean__.getNationCodeTranslation(Unknown Source)
at logic.TEDTenderCrawler.visit(TEDTenderCrawler.java:168)
at edu.uci.ics.crawler4j.crawler.WebCrawler.processPage(WebCrawler.java:306)
at edu.uci.ics.crawler4j.crawler.WebCrawler.run(WebCrawler.java:189)
at java.lang.Thread.run(Thread.java:679)


** END NESTED EXCEPTION **


Last packet sent to the server was 814981 ms ago.


When this problem occurs during a run of the application (it runs one time every day), its eventually breaks the cycle of the application: logging stops, and the application is 'dead'.
When I restart the application, it sometimes works again, and then it fails again.

I truly hope somebody can help me? This is getting out of control and the problem is very time critical!

Truly thanks in advance!

Heinz
10 years ago

K. Tsang wrote:Did you put in the parameters like URL, user, password etc in Glassfish?

I set mine JDBC resource like I described it and work for me.



Yes, I did put all the parameters like URL, user, password, port, etc. in place in the GlassFish at the JDBC Pool 'FunkPool' under 'additional properties', and filled them in correctly (I verified this via a ping on the database funkOneDB from my IDE NetBeans via jdbc:mysql://localhost:33066/funkOneDB using the same credentials for user and password).

In order to deblock my problem, I tried something else (a bit more out of the box).

I replaced the file mysql-connector-java-5.1.18-bin.jar at ..\GlassFish3\GlassFish\domains\domain1\lib by the file mysql-connector-java-5.1.14-bin.jar (as this is the one talked about in the original GlassFish Oracle documentation). Then I restarted the server, just to be sure. After another ping from the JDBC Pool 'FunkPool', I got the following error again:

Ping Connection Pool failed for FunkPool. WEB9031: WebappClassLoader unable to load resource [com.mysql.jdbc.SQLError], because it has not yet been started, or was already stopped.

I am walking in the dark here. Any other suggestions?

Kind regards for your assistance,

Heinz




10 years ago

K. Tsang wrote:Try put the mysql jdbc jar file one level up eg ..\GlassFish3\GlassFish\domains\domain1\lib\

And for the pool settings use "java.sql.Driver" as the resource type and "com.mysql.jdbc.Driver" and driver classname



Thanks for your quick reply! I implemented your suggested changes.

Now I get another error:

Ping Connection Pool failed for FunkPool. Class name is wrong or classpath is not set for : com.mysql.jdbc.Driver

Have you got any ideas on how to proceed?

Kind regards,

Heinz
10 years ago
Dear all,

I am using a brand new developing pc and need to test a personal application that runs on a local GlassFish server 3.1.2 and should connect with a local SQL database called 'funkOneDB' (my IDE is NetBeans 7.2.1). But I can't get the GlassFish server to connect with the database (problem specifics in a few lines).

I am fairly certain I correctly set up the related JDBC Resource and Connection Pool on the GlassFish Server (as I mimic a set-up already existing and working properly on another developing pc).

The Resource specifics are:
  • jndi name: jdbc/FunkResource
  • pool name: FunkPool

  • The (most important) Pool specifics are:
  • pool name: FunkPool
  • resource type: javax.sql.Datasource
  • datasource classname: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
  • additional properties correspond to the specifics in the XML GlassFish-resources of the application, namely:

  • <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://GlassFish.org/dtds/GlassFish-resources_1_5.dtd">
    <resources>
    <jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="FunkPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
    <property name="serverName" value="localhost"/>
    <property name="portNumber" value="33066"/>
    <property name="databaseName" value="funkOneDB"/>
    <property name="User" value="[USERNAME]"/>
    <property name="Password" value="[PASSWORD]"/>
    <property name="URL" value="jdbc:mysql://localhost:33066/funkOneDB"/>
    <property name="driverClass" value="com.mysql.jdbc.Driver"/>
    </jdbc-connection-pool>
    <jdbc-resource enabled="true" jndi-name="jdbc/FunkResource" object-type="user" pool-name="FunkPool"/>
    </resources>

    I placed the necessary SQL driver in the GlassFish Server's directories, i.e. the file mysql-connector-java-5.1.18-bin.jar at ..\GlassFish3\GlassFish\domains\domain1\lib\ext.

    Yet, when I perform a ping test from the JDBC Pool 'FunkPool' at the GlassFish server, I get the following error:

    Ping Connection Pool failed for FunkPool. WEB9031: WebappClassLoader unable to load resource [com.mysql.jdbc.SQLError], because it has not yet been started, or was already stopped Please check the server.log for more details.

    In the server.log I only find the following extra logging exception and failure info:

    (i) Exception while creating an unpooled [test] connection for pool [ FunkPool ], WEB9031: WebappClassLoader unable to load resource [com.mysql.jdbc.SQLError], because it has not yet been started, or was already stopped

    (ii) RestResponse.getResponse() gives FAILURE. endpoint = 'http://localhost:4848/management/domain/resources/ping-connection-pool.json'; attrs = '{id=FunkPool}'

    Note however, that when I ping the database funkOneDB from my IDE NetBeans via jdbc:mysql://localhost:33066/funkOneDB , it's succesful. As already mentioned, the credentials and other data I use for this IDE-based ping are the same data I use in the JDBC Connection Pool.

    I don't know what to do. I googled the problem for quite some time. And I did find some people talking about it, like

    http://tamanmohamed.blogspot.be/2012/03/GlassFish-312-unable-to-load-resource.html

    But when I tried their suggestions nothing changed.

    Can somebody help me solve this problem? Many thanks in advance!

    With kind regards,

    Heinz
    10 years ago