users@glassfish.java.net

Setting the Hibernate logger level to FINEST causes exceptions that do not

From: <forums_at_java.net>
Date: Wed, 28 Sep 2011 01:07:01 -0500 (CDT)

Configuring the Hibernate root logger (org.hibernate) with a level of FINEST
to the Glassfish logging.properties file, results in weird behaviors observed
by end-users.

For example, the following output was produced on running asadmin
add-resources from the command line:

C:\glassfish3\bin>asadmin add-resources
D:\git-repos\arquillian-container-glassfish\glassfish-embedded-3.1\src\test\resources\sun-resources.xml
remote failure: add-resources <sun-resources.xml> failed Command : JDBC
connection pool ArquillianEmbeddedDerbyPool creation failed. No corresponding
property found for method: public java.lang.String
java.lang.Object.toString() Command : Attribute value (pool-name =
ArquillianEmbeddedDerbyPool) is not found in list of jdbc connection pools.
Command add-resources failed.
This occured when the Glassfish domain's logging.properties file contained
the following entry:

org.hibernate.level=FINEST
On removing the line and restarting Glassfish, the same command worked
flawlessly:

C:\glassfish3\bin>asadmin add-resources
D:\git-repos\arquillian-container-glassfish\glassfish-embedded-3.1\src\test\resources\sun-resources.xml
Command : JDBC connection pool ArquillianEmbeddedDerbyPool created
successfully. Command : JDBC resource jdbc/arquillian created successfully.
Command add-resources executed successfully.
After debugging this issue, I could deduce that the underlying problem lies
with the *org.jvnet.hk2.config.WriteableView* class that implements the
invoke method of the *InvocationHandler* interface. When Hibernate Validator
attempts to log a message (at the TRACE level of SLF4J, or the FINEST level
in JDK Logger) with the proxy object of *WriteableView*, the toString()
method is invoked on the proxy, which is delegated to the invoke method of
*WriteableView*. Since WriteableView.invoke only handles equals, hashCode and
property model accessor invocations, the toString() invocation is eventually
treated as a property accessor invocation, which eventually fails resulting
in the observed message "No corresponding property found for method: public
java.lang.String java.lang.Object.toString()", as no corresponding property
for the method name "toString()" was found.

I believe this is a bug, although its occurence would be rare, but the
unexplainable behavior observed from the logs warrants some fix (ideally by
fixing *WriteableView.invoke*). Several other places might also exist where a
similar bug might be found, as deployments were found to fail, with the
following messages in server.log. As before, the deployments succeeded on
removing the Hibernate root logger.

[#|2011-09-28T11:33:06.082+0530|INFO|glassfish3.1.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=26;_ThreadName=Thread-4;|WEB0671:
Loading application [WebEJBExample] at [/WebEJBExample]|#]
[#|2011-09-28T11:33:06.160+0530|SEVERE|glassfish3.1.1|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=26;_ThreadName=Thread-4;|The
log message is null.|#]
[#|2011-09-28T11:33:06.253+0530|INFO|glassfish3.1.1|org.glassfish.admingui|_ThreadID=25;_ThreadName=Thread-4;|Exception
Occurred :Error occurred during deployment: null. Please see server.log for
more details. |#]
 


--
[Message sent by forum member 'Vineet.Reynolds']
View Post: http://forums.java.net/node/847805