Re: Is tapestry plastic incompatible with JEE specs?

2015-12-12 Thread Luca Arzeni
Hi Dimitris,

NO WAY: I've checked with tapestry 5.3.8 and also with 5.4-rc1 but found no 
difference, the issue is always there.

By the way, kudos to the development team for the error page of t5.4, it's 
fairly well structured.

Still looking for a solution.

See you!


> Sent: Saturday, December 12, 2015 at 7:14 PM
> From: "Dimitris Zenios" 
> To: "Tapestry users" 
> Subject: Re: Is tapestry plastic incompatible with JEE specs?
>
> HI Luca Arzeni
> 
> Just for testing could you try with Tapestry 5.4-rc-1?
> 
> Tapestry 5.4 bundles a newer asm version. Don't forget that tapestry
> plastic is a wrapper around asm
> 
> Dimitris Zenios
> 
> 
> 
> On Sat, Dec 12, 2015 at 7:06 PM, Luca Arzeni  wrote:
> 
> > Here you are: this is a test case that shows the issue.
> >
> > In the linked file, you'll find a simple working/crashing example, with a
> > gradle script to build it (in ts really simple, but just to play it safe).
> > You can download it at:
> >
> > https://app.box.com/s/eoie31up2z8djdwja77136649c8vogv0
> >
> > There is also a readme.txt that explains the issue and the test that I've
> > done.
> >
> > After the deployment, you can reach the app at the URL:
> >
> > http://localhost:8080/webclient/
> >
> > I packed into the tar.gz also the application exception page, from which
> > you can read the full stack trace.
> >
> > Anyway, if you prefer, here is the full stack trace.
> >
> > Thanks for your help,
> > larzeni
> >
> >
> > 18:02:53,903 ERROR [Registry] java.lang.ClassNotFoundException:
> > com.amadego.cast.webclient.data.LocalitaData from [Module
> > "deployment.Troubleshooting-1.0.ear:main" from Service Module Loader]
> > 18:02:53,903 ERROR [Registry] Operations trace:
> > 18:02:53,903 ERROR [Registry] [ 1] Constructing instance of page class
> > com.amadego.cast.webclient.pages.Start
> > 18:02:53,904 ERROR [Registry] [ 2] Creating ComponentAssembler for
> > com.amadego.cast.webclient.pages.Start
> > 18:02:53,904 ERROR [Registry] [ 3] Creating instantiator for component
> > class com.amadego.cast.webclient.pages.Start
> > 18:02:53,904 ERROR [RequestExceptionHandler] Processing of request failed
> > with uncaught exception: java.lang.ClassNotFoundException:
> > com.amadego.cast.webclient.data.LocalitaData from [Module
> > "deployment.Troubleshooting-1.0.ear:main" from Service Module Loader]:
> > org.apache.tapestry5.ioc.internal.OperationException:
> > java.lang.ClassNotFoundException:
> > com.amadego.cast.webclient.data.LocalitaData from [Module
> > "deployment.Troubleshooting-1.0.ear:main" from Service Module Loader]
> > at
> > org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:121)
> > [tapestry-ioc-5.3.7.jar:]
> > at
> > org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:88)
> > [tapestry-ioc-5.3.7.jar:]
> > at
> > org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
> > [tapestry-ioc-5.3.7.jar:]
> > at
> > org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124)
> > [tapestry-ioc-5.3.7.jar:]
> > at
> > org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.createInstantiatorForClass(ComponentInstantiatorSourceImpl.java:227)
> > [tapestry-core-5.3.7.jar:]
> > at
> > org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.getInstantiator(ComponentInstantiatorSourceImpl.java:217)
> > [tapestry-core-5.3.7.jar:]
> > at
> > $ComponentInstantiatorSource_5ee3f5f438c.getInstantiator(Unknown Source)
> >  at
> > org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:225)
> > [tapestry-core-5.3.7.jar:]
> > at
> > org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:222)
> > [tapestry-core-5.3.7.jar:]
> > at
> > org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
> > [tapestry-ioc-5.3.7.jar:]
> > at
> > org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
> > [tapestry-ioc-5.3.7.jar:]
> > at
> > org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124)
> > [tapestry-ioc-5.3.7.jar:]
> > at
> > org.apache.tapestry5.internal.pageload.PageLoaderImpl.createAssembler(PageLoaderImpl.java:221)
> > [tapestry-core-5.3.7.jar:]
> > at
> > org.apache.tapestry5.internal.pageload.PageLoaderImpl.getAssembler(PageLoaderImpl.java:211)
> > [tapestry-core-5.3.7.jar:]
> > at
> > org.apache.tapestry5.internal.pageload.PageLoaderImpl$3.invoke(PageLoaderImpl.java:183)
> > [tapestry-core-5.3.7.jar:]
> > at
> > org.apache.tapestry5.internal.pageload.PageLoaderImpl$3.invoke(PageLoaderImpl.java:178)
> > [tapestry-core-5.3.7.jar:]
> > at
> > org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
> > [tapestry-ioc-5.3.7.jar:]
> >  

Re: Is tapestry plastic incompatible with JEE specs?

2015-12-12 Thread Dimitris Zenios
HI Luca Arzeni

Just for testing could you try with Tapestry 5.4-rc-1?

Tapestry 5.4 bundles a newer asm version. Don't forget that tapestry
plastic is a wrapper around asm

Dimitris Zenios



On Sat, Dec 12, 2015 at 7:06 PM, Luca Arzeni  wrote:

> Here you are: this is a test case that shows the issue.
>
> In the linked file, you'll find a simple working/crashing example, with a
> gradle script to build it (in ts really simple, but just to play it safe).
> You can download it at:
>
> https://app.box.com/s/eoie31up2z8djdwja77136649c8vogv0
>
> There is also a readme.txt that explains the issue and the test that I've
> done.
>
> After the deployment, you can reach the app at the URL:
>
> http://localhost:8080/webclient/
>
> I packed into the tar.gz also the application exception page, from which
> you can read the full stack trace.
>
> Anyway, if you prefer, here is the full stack trace.
>
> Thanks for your help,
> larzeni
>
>
> 18:02:53,903 ERROR [Registry] java.lang.ClassNotFoundException:
> com.amadego.cast.webclient.data.LocalitaData from [Module
> "deployment.Troubleshooting-1.0.ear:main" from Service Module Loader]
> 18:02:53,903 ERROR [Registry] Operations trace:
> 18:02:53,903 ERROR [Registry] [ 1] Constructing instance of page class
> com.amadego.cast.webclient.pages.Start
> 18:02:53,904 ERROR [Registry] [ 2] Creating ComponentAssembler for
> com.amadego.cast.webclient.pages.Start
> 18:02:53,904 ERROR [Registry] [ 3] Creating instantiator for component
> class com.amadego.cast.webclient.pages.Start
> 18:02:53,904 ERROR [RequestExceptionHandler] Processing of request failed
> with uncaught exception: java.lang.ClassNotFoundException:
> com.amadego.cast.webclient.data.LocalitaData from [Module
> "deployment.Troubleshooting-1.0.ear:main" from Service Module Loader]:
> org.apache.tapestry5.ioc.internal.OperationException:
> java.lang.ClassNotFoundException:
> com.amadego.cast.webclient.data.LocalitaData from [Module
> "deployment.Troubleshooting-1.0.ear:main" from Service Module Loader]
> at
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:121)
> [tapestry-ioc-5.3.7.jar:]
> at
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:88)
> [tapestry-ioc-5.3.7.jar:]
> at
> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
> [tapestry-ioc-5.3.7.jar:]
> at
> org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124)
> [tapestry-ioc-5.3.7.jar:]
> at
> org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.createInstantiatorForClass(ComponentInstantiatorSourceImpl.java:227)
> [tapestry-core-5.3.7.jar:]
> at
> org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.getInstantiator(ComponentInstantiatorSourceImpl.java:217)
> [tapestry-core-5.3.7.jar:]
> at
> $ComponentInstantiatorSource_5ee3f5f438c.getInstantiator(Unknown Source)
>  at
> org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:225)
> [tapestry-core-5.3.7.jar:]
> at
> org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:222)
> [tapestry-core-5.3.7.jar:]
> at
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
> [tapestry-ioc-5.3.7.jar:]
> at
> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
> [tapestry-ioc-5.3.7.jar:]
> at
> org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124)
> [tapestry-ioc-5.3.7.jar:]
> at
> org.apache.tapestry5.internal.pageload.PageLoaderImpl.createAssembler(PageLoaderImpl.java:221)
> [tapestry-core-5.3.7.jar:]
> at
> org.apache.tapestry5.internal.pageload.PageLoaderImpl.getAssembler(PageLoaderImpl.java:211)
> [tapestry-core-5.3.7.jar:]
> at
> org.apache.tapestry5.internal.pageload.PageLoaderImpl$3.invoke(PageLoaderImpl.java:183)
> [tapestry-core-5.3.7.jar:]
> at
> org.apache.tapestry5.internal.pageload.PageLoaderImpl$3.invoke(PageLoaderImpl.java:178)
> [tapestry-core-5.3.7.jar:]
> at
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
> [tapestry-ioc-5.3.7.jar:]
> at
> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
> [tapestry-ioc-5.3.7.jar:]
> at
> org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124)
> [tapestry-ioc-5.3.7.jar:]
> at
> org.apache.tapestry5.internal.pageload.PageLoaderImpl.loadPage(PageLoaderImpl.java:177)
> [tapestry-core-5.3.7.jar:]
> at $PageLoader_5ee3f5f4373.loadPage(Unknown Source) at
> org.apache.tapestry5.internal.services.PageSourceImpl.getPage(PageSourceImpl.java:104)
> [tapestry-core-5.3.7.jar:]
> at $PageSource_5ee3f5f4370.getPage(Unknown Source)  at

Re: Is tapestry plastic incompatible with JEE specs?

2015-12-12 Thread Luca Arzeni
Here you are: this is a test case that shows the issue.

In the linked file, you'll find a simple working/crashing example, with a 
gradle script to build it (in ts really simple, but just to play it safe). You 
can download it at:

https://app.box.com/s/eoie31up2z8djdwja77136649c8vogv0

There is also a readme.txt that explains the issue and the test that I've done.

After the deployment, you can reach the app at the URL:

http://localhost:8080/webclient/

I packed into the tar.gz also the application exception page, from which you 
can read the full stack trace.

Anyway, if you prefer, here is the full stack trace.

Thanks for your help,
larzeni


18:02:53,903 ERROR [Registry] java.lang.ClassNotFoundException: 
com.amadego.cast.webclient.data.LocalitaData from [Module 
"deployment.Troubleshooting-1.0.ear:main" from Service Module Loader]
18:02:53,903 ERROR [Registry] Operations trace:
18:02:53,903 ERROR [Registry] [ 1] Constructing instance of page class 
com.amadego.cast.webclient.pages.Start
18:02:53,904 ERROR [Registry] [ 2] Creating ComponentAssembler for 
com.amadego.cast.webclient.pages.Start
18:02:53,904 ERROR [Registry] [ 3] Creating instantiator for component class 
com.amadego.cast.webclient.pages.Start
18:02:53,904 ERROR [RequestExceptionHandler] Processing of request failed with 
uncaught exception: java.lang.ClassNotFoundException: 
com.amadego.cast.webclient.data.LocalitaData from [Module 
"deployment.Troubleshooting-1.0.ear:main" from Service Module Loader]: 
org.apache.tapestry5.ioc.internal.OperationException: 
java.lang.ClassNotFoundException: com.amadego.cast.webclient.data.LocalitaData 
from [Module "deployment.Troubleshooting-1.0.ear:main" from Service Module 
Loader]
at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:121)
 [tapestry-ioc-5.3.7.jar:]
at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:88)
 [tapestry-ioc-5.3.7.jar:]
at 
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
 [tapestry-ioc-5.3.7.jar:]
at 
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124) 
[tapestry-ioc-5.3.7.jar:]
at 
org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.createInstantiatorForClass(ComponentInstantiatorSourceImpl.java:227)
 [tapestry-core-5.3.7.jar:]
at 
org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.getInstantiator(ComponentInstantiatorSourceImpl.java:217)
 [tapestry-core-5.3.7.jar:]
at $ComponentInstantiatorSource_5ee3f5f438c.getInstantiator(Unknown 
Source) at 
org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:225)
 [tapestry-core-5.3.7.jar:]
at 
org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:222)
 [tapestry-core-5.3.7.jar:]
at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
 [tapestry-ioc-5.3.7.jar:]
at 
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
 [tapestry-ioc-5.3.7.jar:]
at 
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124) 
[tapestry-ioc-5.3.7.jar:]
at 
org.apache.tapestry5.internal.pageload.PageLoaderImpl.createAssembler(PageLoaderImpl.java:221)
 [tapestry-core-5.3.7.jar:]
at 
org.apache.tapestry5.internal.pageload.PageLoaderImpl.getAssembler(PageLoaderImpl.java:211)
 [tapestry-core-5.3.7.jar:]
at 
org.apache.tapestry5.internal.pageload.PageLoaderImpl$3.invoke(PageLoaderImpl.java:183)
 [tapestry-core-5.3.7.jar:]
at 
org.apache.tapestry5.internal.pageload.PageLoaderImpl$3.invoke(PageLoaderImpl.java:178)
 [tapestry-core-5.3.7.jar:]
at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
 [tapestry-ioc-5.3.7.jar:]
at 
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
 [tapestry-ioc-5.3.7.jar:]
at 
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124) 
[tapestry-ioc-5.3.7.jar:]
at 
org.apache.tapestry5.internal.pageload.PageLoaderImpl.loadPage(PageLoaderImpl.java:177)
 [tapestry-core-5.3.7.jar:]
at $PageLoader_5ee3f5f4373.loadPage(Unknown Source) at 
org.apache.tapestry5.internal.services.PageSourceImpl.getPage(PageSourceImpl.java:104)
 [tapestry-core-5.3.7.jar:]
at $PageSource_5ee3f5f4370.getPage(Unknown Source)  at 
org.apache.tapestry5.internal.services.NonPoolingRequestPageCacheImpl.get(NonPoolingRequestPageCacheImpl.java:82)
 [tapestry-core-5.3.7.jar:]
at $RequestPageCache_5ee3f5f436f.get(Unknown Source)at 
$RequestPageCache_5ee3f5f4369.get(Unknown Source)at 
org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:55)
 [tape

Re: Is tapestry plastic incompatible with JEE specs?

2015-12-12 Thread mailingl...@j-b-s.de
Understood. Than I would try to declare the scope of your core dependencies as 
"provided" in the war's pom.xml.  This is to me similar to a tomcat having 
shared jars in the lib folder like jdbc drivers but not including them into the 
war itself.

Jens



Von meinem iPhone gesendet

> Am 12.12.2015 um 15:08 schrieb Luca Arzeni :
> 
> Hi Jens,
> core module contains some EJBs: I'm using JPA for the persistence and SLSB as 
> facade to achieve a transactional demarcation strategy. So I could roughly 
> say that the core module contains the persistence layer and the business 
> logic, which is used by different client application, few of them are 
> webapps, while other are desktop apps.
> 
> I use this strategy in the web app and in a desktop GUI app:
> - the web apps use the SLSB approach, looking up the beans in the webapp 
> module, and allowing them to be injected  the pages ad T5 services;
> - the desktop and command line apps use directly the IOC of T5 to inject 
> services when I need them
> 
> So, an EAR usually contains three or more war module and a EJB module, while 
> desktop and command line apps are usually a GUI around some services.
> 
> As you can undestand, the real app is more complex than the simple project 
> that I used for test, and replicating EJB and T5 jars every where could make 
> my EAR to explode for size and complexity.
> 
> Anyway the testcase, that I used to pinpoint the problem, should be simple 
> enough to demonstrate the issue. 
> 
> I often see that people is deploy t5 as war inside tomcat or jetty. 
> 
> I'm wondering if there is someone around that is usually deploying EARs with 
> jboss and glassfish that has found similar issues...
> 
> Thanks,
> Luca
> 
> 
> 
>> Sent: Saturday, December 12, 2015 at 2:02 PM
>> From: "mailingl...@j-b-s.de" 
>> To: "Tapestry users" 
>> Subject: Re: Is tapestry plastic incompatible with JEE specs?
>> 
>> What is in your core Module? Services using T5 IOC? Why is the core Module 
>> not part of the war?
>> To me it looks more like a structural / serup problem than a real Tapestry 
>> issue, to be honest. But I can be entirely wrong because I do not know the 
>> requirements of your project and why it is structured this way.
>> 
>> If you need these libs in different classloaders not belonging to same 
>> hiererchy, you can't share them. The same class loaded from different 
>> classloaders will cause trouble anyway, too. Maybe you only need it on 
>> compile time and "maven provided" on your war pom.xml is the solution?
>> 
>> Jens
>> 
>> Von meinem iPhone gesendet
>> 
>>> Am 11.12.2015 um 22:20 schrieb Luca Arzeni :
>>> 
>>> Hi Jens,
>>> the point is that I need them in the lib since I use them also in the core 
>>> module.
>>> 
>>> I can place them in the lib AND in the war, but I cannot place them ONLY in 
>>> the war.
>>> 
>>> Also, I ask about compatibility because if I have properly spotted the 
>>> issue, some kind of problem could arise also in the core (read: ejb.jar) 
>>> module.
>>> 
>>> The real showstopper is the pervasive usage that I'm doing of tapestry IOC.
>>> 
>>> I like it, but if these problems cannot be solved, it may be better for me 
>>> to migrate to Guice or Spring.
>>> 
>>> Thanks,
>>> larzeni
>>> 
>>> 
 Sent: Friday, December 11, 2015 at 8:00 PM
 From: "mailingl...@j-b-s.de" 
 To: "Tapestry users" 
 Subject: Re: Is tapestry plastic incompatible with JEE specs?
 
 Hi!
 
 IWhy not having all T5 related jars in your war? Any particular reason why 
 they are located in your ear?
 
 Jens
 
 
 
 Von meinem iPhone gesendet
 
> Am 11.12.2015 um 19:05 schrieb Luca Arzeni :
> 
> Hi there, 
> my environment is:
> JBoss 7.2+  (actually 6.1.1.GA) or Wildfly 8.0 Final
> Tapestry5 5.3.7
> 
> I'm developing a little ear, which has the following structure
> 
> myear.ear
> |  core-1.1.jar
> |  webclient-1.1.war
> |  lib/
> |  plastic-5.3.7.jar
> |  tapestry5-annotations-5.3.7.jar
> |  tapestry-core-5.3.7.jar
> |  tapestry-func-5.3.7.jar
> |  tapestry-ioc-5.3.7.jar
> |  tapestry-json-5.3.7.jar
> |  tapestry-upload-5.3.7.jar
> |  ... omissis ...
> 
> the core-1.1.jar module contains few EJBs,
> the webclient-1.1.war module contains my t5 app (pages, components and so 
> on)
> 
> I routinely use and appreciate t5 IOC, so I used it also in the core 
> module; at this point I need to have the t5 jars available to the core 
> AND to the webclient, so I put them in the shared "lib" folder of the EAR.
> 
> So far, so good: the app worked and I had no problem.
> 
> Today I was needing to place an object (a simple bean with 3 strings 
> attributes and their getters and setters) and serialize/deserialize it 
> into a file.
> 
> The bean is needed only in the webclient (I need to place it in session), 
> so I placed it in the 

Re: HTTPS + tapestry-security

2015-12-12 Thread Dimitris Zenios
Hi

Sorry for the late reply

When Ii am using apache/nginx in front of tapestry I disable secure
handling of tapestry
through configuration.add(SymbolConstants.SECURE_ENABLED,false).

I think the reason why development mode works OK for you is that in
development mode secure_enabled is false

Dimitris Zenios

On Sun, Dec 6, 2015 at 9:32 PM, Andreas Ernst  wrote:

> Hi,
>
> i got an Apache in Front how redirects http to https pages.
>
> This works fine if i use
>
> configuration.add(SymbolConstants.PRODUCTION_MODE, false);
>
> If i change this to true, URI does not add the '/' at the end of the host,
> i.e. domain.tldlogin/unauthenticated. And the login form does not use
> action="/login.login", it uses http:/...
>
> tapestry 5.4-rc-1
> tapestry-security 0.6.2
>
> Bug?
>
> Andy
> --
> ae | Andreas Ernst | IT Spektrum
> Postfach 5, 65612 Beselich
> Schupbacher Str. 32, 65614 Beselich, Germany
> Tel: +49-6484-91002 Fax: +49-6484-91003
> a...@ae-online.de | www.ae-online.de
> www.tachyon-online.de
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Is tapestry plastic incompatible with JEE specs?

2015-12-12 Thread Luca Arzeni
Hi Jens,
core module contains some EJBs: I'm using JPA for the persistence and SLSB as 
facade to achieve a transactional demarcation strategy. So I could roughly say 
that the core module contains the persistence layer and the business logic, 
which is used by different client application, few of them are webapps, while 
other are desktop apps.

I use this strategy in the web app and in a desktop GUI app:
- the web apps use the SLSB approach, looking up the beans in the webapp 
module, and allowing them to be injected  the pages ad T5 services;
- the desktop and command line apps use directly the IOC of T5 to inject 
services when I need them

So, an EAR usually contains three or more war module and a EJB module, while 
desktop and command line apps are usually a GUI around some services.

As you can undestand, the real app is more complex than the simple project that 
I used for test, and replicating EJB and T5 jars every where could make my EAR 
to explode for size and complexity.

Anyway the testcase, that I used to pinpoint the problem, should be simple 
enough to demonstrate the issue. 

I often see that people is deploy t5 as war inside tomcat or jetty. 

I'm wondering if there is someone around that is usually deploying EARs with 
jboss and glassfish that has found similar issues...

Thanks,
Luca



> Sent: Saturday, December 12, 2015 at 2:02 PM
> From: "mailingl...@j-b-s.de" 
> To: "Tapestry users" 
> Subject: Re: Is tapestry plastic incompatible with JEE specs?
>
> What is in your core Module? Services using T5 IOC? Why is the core Module 
> not part of the war?
> To me it looks more like a structural / serup problem than a real Tapestry 
> issue, to be honest. But I can be entirely wrong because I do not know the 
> requirements of your project and why it is structured this way.
> 
> If you need these libs in different classloaders not belonging to same 
> hiererchy, you can't share them. The same class loaded from different 
> classloaders will cause trouble anyway, too. Maybe you only need it on 
> compile time and "maven provided" on your war pom.xml is the solution?
> 
> Jens
> 
> Von meinem iPhone gesendet
> 
> > Am 11.12.2015 um 22:20 schrieb Luca Arzeni :
> > 
> > Hi Jens,
> > the point is that I need them in the lib since I use them also in the core 
> > module.
> > 
> > I can place them in the lib AND in the war, but I cannot place them ONLY in 
> > the war.
> > 
> > Also, I ask about compatibility because if I have properly spotted the 
> > issue, some kind of problem could arise also in the core (read: ejb.jar) 
> > module.
> > 
> > The real showstopper is the pervasive usage that I'm doing of tapestry IOC.
> > 
> > I like it, but if these problems cannot be solved, it may be better for me 
> > to migrate to Guice or Spring.
> > 
> > Thanks,
> > larzeni
> > 
> > 
> >> Sent: Friday, December 11, 2015 at 8:00 PM
> >> From: "mailingl...@j-b-s.de" 
> >> To: "Tapestry users" 
> >> Subject: Re: Is tapestry plastic incompatible with JEE specs?
> >> 
> >> Hi!
> >> 
> >> IWhy not having all T5 related jars in your war? Any particular reason why 
> >> they are located in your ear?
> >> 
> >> Jens
> >> 
> >> 
> >> 
> >> Von meinem iPhone gesendet
> >> 
> >>> Am 11.12.2015 um 19:05 schrieb Luca Arzeni :
> >>> 
> >>> Hi there, 
> >>> my environment is:
> >>> JBoss 7.2+  (actually 6.1.1.GA) or Wildfly 8.0 Final
> >>> Tapestry5 5.3.7
> >>> 
> >>> I'm developing a little ear, which has the following structure
> >>> 
> >>> myear.ear
> >>> |  core-1.1.jar
> >>> |  webclient-1.1.war
> >>> |  lib/
> >>>  |  plastic-5.3.7.jar
> >>>  |  tapestry5-annotations-5.3.7.jar
> >>>  |  tapestry-core-5.3.7.jar
> >>>  |  tapestry-func-5.3.7.jar
> >>>  |  tapestry-ioc-5.3.7.jar
> >>>  |  tapestry-json-5.3.7.jar
> >>>  |  tapestry-upload-5.3.7.jar
> >>>  |  ... omissis ...
> >>> 
> >>> the core-1.1.jar module contains few EJBs,
> >>> the webclient-1.1.war module contains my t5 app (pages, components and so 
> >>> on)
> >>> 
> >>> I routinely use and appreciate t5 IOC, so I used it also in the core 
> >>> module; at this point I need to have the t5 jars available to the core 
> >>> AND to the webclient, so I put them in the shared "lib" folder of the EAR.
> >>> 
> >>> So far, so good: the app worked and I had no problem.
> >>> 
> >>> Today I was needing to place an object (a simple bean with 3 strings 
> >>> attributes and their getters and setters) and serialize/deserialize it 
> >>> into a file.
> >>> 
> >>> The bean is needed only in the webclient (I need to place it in session), 
> >>> so I placed it in the webclient.war.
> >>> 
> >>> Now my webapp crashed when I try to instantiate a page that refers to the 
> >>> bean.
> >>> 
> >>> Looking at the problem, it seems to be caused by plastic that tries to 
> >>> reach the class by using the jboss classloader.
> >>> 
> >>> This is the relevant part of the stack:
> >>> 
> >>> ---
> >>> org.apache.tapestry5.internal.plastic.asm.ClassWriter.getCommonSuperClass(ClassWriter

Re: Is tapestry plastic incompatible with JEE specs?

2015-12-12 Thread mailingl...@j-b-s.de
What is in your core Module? Services using T5 IOC? Why is the core Module not 
part of the war?
To me it looks more like a structural / serup problem than a real Tapestry 
issue, to be honest. But I can be entirely wrong because I do not know the 
requirements of your project and why it is structured this way.

If you need these libs in different classloaders not belonging to same 
hiererchy, you can't share them. The same class loaded from different 
classloaders will cause trouble anyway, too. Maybe you only need it on compile 
time and "maven provided" on your war pom.xml is the solution?

Jens

Von meinem iPhone gesendet

> Am 11.12.2015 um 22:20 schrieb Luca Arzeni :
> 
> Hi Jens,
> the point is that I need them in the lib since I use them also in the core 
> module.
> 
> I can place them in the lib AND in the war, but I cannot place them ONLY in 
> the war.
> 
> Also, I ask about compatibility because if I have properly spotted the issue, 
> some kind of problem could arise also in the core (read: ejb.jar) module.
> 
> The real showstopper is the pervasive usage that I'm doing of tapestry IOC.
> 
> I like it, but if these problems cannot be solved, it may be better for me to 
> migrate to Guice or Spring.
> 
> Thanks,
> larzeni
> 
> 
>> Sent: Friday, December 11, 2015 at 8:00 PM
>> From: "mailingl...@j-b-s.de" 
>> To: "Tapestry users" 
>> Subject: Re: Is tapestry plastic incompatible with JEE specs?
>> 
>> Hi!
>> 
>> IWhy not having all T5 related jars in your war? Any particular reason why 
>> they are located in your ear?
>> 
>> Jens
>> 
>> 
>> 
>> Von meinem iPhone gesendet
>> 
>>> Am 11.12.2015 um 19:05 schrieb Luca Arzeni :
>>> 
>>> Hi there, 
>>> my environment is:
>>> JBoss 7.2+  (actually 6.1.1.GA) or Wildfly 8.0 Final
>>> Tapestry5 5.3.7
>>> 
>>> I'm developing a little ear, which has the following structure
>>> 
>>> myear.ear
>>> |  core-1.1.jar
>>> |  webclient-1.1.war
>>> |  lib/
>>>  |  plastic-5.3.7.jar
>>>  |  tapestry5-annotations-5.3.7.jar
>>>  |  tapestry-core-5.3.7.jar
>>>  |  tapestry-func-5.3.7.jar
>>>  |  tapestry-ioc-5.3.7.jar
>>>  |  tapestry-json-5.3.7.jar
>>>  |  tapestry-upload-5.3.7.jar
>>>  |  ... omissis ...
>>> 
>>> the core-1.1.jar module contains few EJBs,
>>> the webclient-1.1.war module contains my t5 app (pages, components and so 
>>> on)
>>> 
>>> I routinely use and appreciate t5 IOC, so I used it also in the core 
>>> module; at this point I need to have the t5 jars available to the core AND 
>>> to the webclient, so I put them in the shared "lib" folder of the EAR.
>>> 
>>> So far, so good: the app worked and I had no problem.
>>> 
>>> Today I was needing to place an object (a simple bean with 3 strings 
>>> attributes and their getters and setters) and serialize/deserialize it into 
>>> a file.
>>> 
>>> The bean is needed only in the webclient (I need to place it in session), 
>>> so I placed it in the webclient.war.
>>> 
>>> Now my webapp crashed when I try to instantiate a page that refers to the 
>>> bean.
>>> 
>>> Looking at the problem, it seems to be caused by plastic that tries to 
>>> reach the class by using the jboss classloader.
>>> 
>>> This is the relevant part of the stack:
>>> 
>>> ---
>>> org.apache.tapestry5.internal.plastic.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1588)
>>> org.apache.tapestry5.internal.plastic.asm.ClassWriter.getMergedType(ClassWriter.java:1559)
>>> org.apache.tapestry5.internal.plastic.asm.Frame.merge(Frame.java:1406)
>>> org.apache.tapestry5.internal.plastic.asm.Frame.merge(Frame.java:1308)
>>> org.apache.tapestry5.internal.plastic.asm.MethodWriter.visitMaxs(MethodWriter.java:1353)
>>> org.apache.tapestry5.internal.plastic.asm.tree.MethodNode.accept(MethodNode.java:635)
>>> org.apache.tapestry5.internal.plastic.asm.tree.MethodNode.accept(MethodNode.java:557)
>>> org.apache.tapestry5.internal.plastic.asm.tree.ClassNode.accept(ClassNode.java:361)
>>> org.apache.tapestry5.internal.plastic.PlasticClassPool.toBytecode(PlasticClassPool.java:187)
>>> org.apache.tapestry5.internal.plastic.PlasticClassPool.realize(PlasticClassPool.java:140)
>>> org.apache.tapestry5.internal.plastic.PlasticClassPool.realizeTransformedClass(PlasticClassPool.java:122)
>>> org.apache.tapestry5.internal.plastic.PlasticClassImpl.createInstantiator(PlasticClassImpl.java:358)
>>> org.apache.tapestry5.internal.plastic.PlasticClassPool.loadAndTransformClass(PlasticClassPool.java:350)
>>> org.apache.tapestry5.internal.plastic.PlasticClassLoader.loadClass(PlasticClassLoader.java:38)
>>> java.lang.ClassLoader.loadClass(ClassLoader.java:358)
>>> java.lang.Class.getDeclaredFields0(Native Method)
>>> java.lang.Class.privateGetDeclaredFields(Class.java:2509)
>>> java.lang.Class.getDeclaredField(Class.java:1959)
>>> ---
>>> 
>>> In the JEE spec it is written that the war classloader must be isolated 
>>> from the EAR classloader.
>>> 
>>> In my understanding this means that t5 plastic (which lives in the EAR 
>>> classloader) cannot reach the classes tha