Tuesday Jun 09, 2015

Your Spring application takes longer to deploy? Think again!

Uday Joshi of the WebLogic Team was recently asked to understand why a large Spring based application took longer to deploy on WebLogic than on Tomcat. And to do that, Uday only had one constraint, i.e. he was not given access to that Spring application! The only thing Uday had at his disposal was the deployment-time thread dumps of that application, nothing else.

In this detailed article, Uday describes how he mimicked the 'suspicious' application to understand what was going on. He also shares some of his findings and some recommendations like using filtering classloader. This article is based on a large Spring application but those recommendations also apply to any large application. 

Friday Feb 15, 2013

Resolving conflicts with Classloaders - Example with Hibernate/Antlr

After migrating Hibernate applications to a more recent version of WebLogic Server from WLS 9.2.x, you might encounter query exceptions such as:

EXCEPTION STACK TRACE: org.hibernate.QueryException: aggregate function expected before ( in SELECT [select distinct c, (select count(*) from ...

The same query working properly under the old environment.  At first it might look like an invalid syntax in the query but the issue is really coming from a conflict between parsers clients.  The solution is to use prefer-application-packages in weblogic-application.xml (WebLogic Server-specific deployment descriptor extension for the application.xml) to define which package(s) should be loaded from the application and not from the system classloader, example:

<prefer-application-packages>

  <package-name>antlr.*</package-name>

</prefer-application-packages>

The suitable Antlr (Java-based compiler generator client) version should be made available in the application itself, inside WEB-INF/lib - this parser being used by Hibernate.  prefer-web-inf-classes must be set to true in weblogic.xml, the default value being false, for classes located in WEB-INF to be loaded in preference to the system classloader.  

WLS 10.3.x is shipped with antlr version 2.7.7 (built on Mon Jun 11 12:19:48 EDT 2007  ImplVersion: 2.7.7)

WLS 12c is shipped with antlr version 2.7.7.0 (built on Fri Nov 4 19:42:39 EDT 2011  ImplVersion: 2.7.7.0)

You can find all packages versions in %Home%/modules or simply by running java weblogic.utils.Versions

For aid in configuring filtering classloaders, see Using the Classloader Analysis Tool (CAT).

About

The official blog for Oracle WebLogic Server fans and followers!

Stay Connected

Search

Archives
« August 2015
SunMonTueWedThuFriSat
      
1
2
3
4
5
6
7
8
9
10
11
12
14
15
16
17
18
19
20
21
22
23
24
25
26
28
29
30
31
     
Today