apex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ananth Gundabattula <agundabatt...@gmail.com>
Subject Re: Specify class loader policy
Date Wed, 04 May 2016 19:17:22 GMT
Hello Pramod,

Thanks for the reply. Apologies that I could not reply immediately.

Here is our problem:

We have an app that includes Spring + Hibernate + JPA along with other
libraries that are part of the lib/ folder inside the "apa" package. The
application runs perfectly fine in the "LocalMode" of a unit test. However
when trying to deploy the app into the Apex server ( either using the
command line dtcli or web ui) , there is an exception stating that the
class javax.persistence.Persistence is not found.

We did try including the javaee-api-7.0 jar in the maven dependencies of
the app but to no avail. The only ugly hack was to copy this jar into the
Apex engines lib folder. The apps start working functionally after this but
we lost all capacity to view the "monitoring" of the app in the UI.

This copying of the jar also resulted in the Apex engine not being able to
restart if we want to restart it. We needed to move the jar out of the way
, restart it , put this jar back in and then reinstall and rerun the apps.
Of course this is all because of the ugly hack and we need to solve this

I believe the core issue is arising because the validation framework is
pulling bval ( Apache Bean Validation ) for the JPA components that are
present in the map. This is leading to the parent classloader somehow
trying to look for classes in the lib folder of the Apex engine and
ignoring the libs in the app lib folder. This is just a guess and am kind
of stumped how to figure it out correctly.

I did a dump of the class loaders and the jars they are loading at the
launch time of the app. Please find attached a copy of the two main class
loaders and their jars. I have also attached a copy of the stack trace of
the error I am getting when I launch the app in Apex.


On Wed, May 4, 2016 at 10:14 AM, Pramod Immaneni <pramod@datatorrent.com>

> Hi Ananth,
> Are you facing a specific problem? We include the application jars first
> in the classpath, followed by apex jars and then hadoop jars.
> Thanks
> On Tue, May 3, 2016 at 4:56 AM, Ananth Gundabattula <
> agundabattula@gmail.com> wrote:
>> Hello All,
>> Is there a way we can specify the class loader policy for an Apex app ?
>> Basically I am looking at something equivalent of the user first class
>> loader policy available in the traditional hadoop world. (
>> mapreduce.job.user.classpath.first)
>> Regards,
>> Ananth

View raw message