You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by Andy Baulch <An...@aquilaheywood.co.uk> on 2015/01/06 12:52:06 UTC

NoClassDefFoundError using non-Woodstox StAX implementation with OpenCMIS 0.12.0 on WebSphere 8.5

Hi,

We have an application which uses OpenCMIS and was developed for WebLogic application servers, but can also run on WebSphere application servers.

The simplest way to get it to run on WebSphere included the removal of the stax2-api.jar file, and the configuration of the application server to use IBM's StAX implementation instead of Woodstox.

This worked OK using OpenCMIS 0.10.0, but with 0.12.0 we get NoClassDefFoundError trying to load the Woodstox class, which is not in the classpath as we want to use a different StAX implementation.

The problem arises in org.apache.chemistry.opencmis.commons.impl.XMLUtils:

        try {
            // Woodstox is the only supported and tested StAX implementation
            factory = new WstxInputFactory();
        } catch (Exception e) {
            // other StAX implementations may work, too
            factory = XMLInputFactory.newInstance();

which would probably work OK if we got an Exception from the class loader, but we get a java.lang.NoClassDefFoundError, which is a Throwable, not an Exception, so it isn't handled correctly.


We do not have any urgent need to upgrade to version 0.12.0, so we can continue to use version 0.10.0 or 0.11.0 for the next release of our application, but it would be helpful if the code could be changed in a future release of OpenCMIS to handle Throwable errors in the same way as Exceptions.

Many thanks,
Andy
<p>Best Pensions Administration Software - FT Pension and Investment Provider Awards 2013

Technology Provider of the Year - European Pensions Awards 2013



This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this communication in error, please inform the sender by email immediately then delete the original e-mail and any attachments from your system.

Aquila Group Holdings Limited. Registered in England No. 3613039.
Registered Office: Aquila House 35 London Road Redhill Surrey RH1 1NJ

Please think about your environment before printing
</p>

Re: NoClassDefFoundError using non-Woodstox StAX implementation with OpenCMIS 0.12.0 on WebSphere 8.5

Posted by Florian Müller <fm...@apache.org>.
Hi Andy,

I've changed the code a bit to handle that case (without catching an 
Error!).
But you really should consider using Woodstox. We have seen bugs, 
security and performance issues with other StAX implementations.


- Florian


> Hi,
> 
> We have an application which uses OpenCMIS and was developed for
> WebLogic application servers, but can also run on WebSphere
> application servers.
> 
> The simplest way to get it to run on WebSphere included the removal of
> the stax2-api.jar file, and the configuration of the application
> server to use IBM's StAX implementation instead of Woodstox.
> 
> This worked OK using OpenCMIS 0.10.0, but with 0.12.0 we get
> NoClassDefFoundError trying to load the Woodstox class, which is not
> in the classpath as we want to use a different StAX implementation.
> 
> The problem arises in
> org.apache.chemistry.opencmis.commons.impl.XMLUtils:
> 
>  TRY {
> 
>  // Woodstox is the only supported and tested StAX implementation
> 
>  factory = NEW WstxInputFactory();
> 
>  } CATCH (Exception e) {
> 
>  // other StAX implementations may work, too
> 
>  factory = XMLInputFactory._newInstance_();
> 
> which would probably work OK if we got an Exception from the class
> loader, but we get a java.lang.NoClassDefFoundError, which is a
> Throwable, not an Exception, so it isn't handled correctly.
> 
> We do not have any urgent need to upgrade to version 0.12.0, so we can
> continue to use version 0.10.0 or 0.11.0 for the next release of our
> application, but it would be helpful if the code could be changed in a
> future release of OpenCMIS to handle Throwable errors in the same way
> as Exceptions.
> 
> Many thanks,
> 
> Andy
> 
> BEST PENSIONS ADMINISTRATION SOFTWARE - FT PENSION AND INVESTMENT
> PROVIDER AWARDS 2013
> 
> TECHNOLOGY PROVIDER OF THE YEAR - EUROPEAN PENSIONS AWARDS 2013
> 
>  		_AQUILAHEYWOOD_ SUPPORTING
> 
> 		 [1]
> 
> 		 [2]
> 
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to which they
> are addressed. If you have received this communication in error,
> please inform the sender by email immediately then delete the original
> e-mail and any attachments from your system.
> 
> Aquila Group Holdings Limited. Registered in England No. 3613039.
>  Registered Office: Aquila House 35 London Road Redhill Surrey RH1 1NJ
> 
> 
> PLEASE THINK ABOUT YOUR ENVIRONMENT BEFORE PRINTING
> 
> Links:
> ------
> [1] http://www.thechildrenstrust.org.uk
> [2] http://www.francishouse.org.uk