You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by tonywestonuk <to...@totspics.com> on 2016/10/17 14:05:54 UTC

JSP named bean bug

Hi.

I think i've fallen fowl of a bug.... Let me outline the steps to reproduce.

1) Create an application scoped bean

@ApplicationScoped
@Named("bugbean")
public class BugBean {
	public String getBugVal(){
		return "bugval";
	}
}

2) Create a JSP to show it.
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<html>
	${bugbean.bugVal}
</html>


3) Start Tomee.....Load the page.  It doesn't work, bugbean is not resolved.


however. If you hot deploy a new version, (or make a code change within
Eclipse and allow TomEE to restart),  then it works!

 
The same problem regardless if you use @Singleton or @ApplicationScoped


.... OR, am I doing something wrong?


Thanks.




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JSP-named-bean-bug-tp4680338.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: JSP named bean bug

Posted by tonywestonuk <to...@totspics.com>.
Hi Romain,

Yay! All working in 7.0.2-snapshot.

Thank you for such a fast response, and your ongoing support.

Tony.



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JSP-named-bean-bug-tp4680338p4680350.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: JSP named bean bug

Posted by Romain Manni-Bucau <rm...@gmail.com>.
snapshot is there
https://repository.apache.org/content/repositories/snapshots/org/apache/tomee/apache-tomee/7.0.2-SNAPSHOT/

a dirty but which should work workaround is to add a class in your app
which does in a static block a Class.forName() of JasperInitializer: Class.
forName("org.apache.jasper.servlet.JasperInitializer");


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-10-17 17:09 GMT+02:00 tonywestonuk <to...@totspics.com>:

> Great! Thanks....
>
> Is there a workaround I can use for 7.0.1, or should I wait until you
> release 7.0.2
>
> I don't fancy building 7.0.2 myself :-/
>
> Thanks.
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/JSP-named-bean-bug-tp4680338p4680346.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: JSP named bean bug

Posted by tonywestonuk <to...@totspics.com>.
Great! Thanks....

Is there a workaround I can use for 7.0.1, or should I wait until you
release 7.0.2

I don't fancy building 7.0.2 myself :-/

Thanks.



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JSP-named-bean-bug-tp4680338p4680346.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: JSP named bean bug

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

Ok got it now,

comes from a change in tomcat backbone, I fixed it on 7.0.2 snapshot

the trick is to preload JasperInitializer before any deployment of that
kind. That is why it works from the second deployment, cause this
initializer was executed.



Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-10-17 16:47 GMT+02:00 tonywestonuk <to...@totspics.com>:

> There... pretty straight forward.
>
> https://github.com/tonywestonuk/tomeebug
>
>
> It affects 7.0.1
>
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/JSP-named-bean-bug-tp4680338p4680342.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: JSP named bean bug

Posted by tonywestonuk <to...@totspics.com>.
Do you have a link to 7.0.2-snapshot, or do I have to build it myself?



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JSP-named-bean-bug-tp4680338p4680344.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: JSP named bean bug

Posted by Gurkan Erdogdu <ge...@managecat.com>.
Hi 

Just I tried with 7.0.2-SNAPHOT and it works perfectly :)

Best

Gurkan Erdogdu
http://twitter.com/gerdogdu <http://twitter.com/gerdogdu>
http://managecat.com <http://managecat.com/>

> On 17 Oct 2016, at 17:47, tonywestonuk <to...@totspics.com> wrote:
> 
> There... pretty straight forward.
> 
> https://github.com/tonywestonuk/tomeebug
> 
> 
> It affects 7.0.1
> 
> 
> 
> 
> 
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/JSP-named-bean-bug-tp4680338p4680342.html
> Sent from the TomEE Users mailing list archive at Nabble.com.



Re: JSP named bean bug

Posted by tonywestonuk <to...@totspics.com>.
There... pretty straight forward.

https://github.com/tonywestonuk/tomeebug


It affects 7.0.1





--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JSP-named-bean-bug-tp4680338p4680342.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: JSP named bean bug

Posted by Romain Manni-Bucau <rm...@gmail.com>.
which version does it affect?
can you build a project on github ready to run showing that (an arquillian
test or tomee-maven-plugin setup are good way to share it)?


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-10-17 16:15 GMT+02:00 tonywestonuk <to...@totspics.com>:

>
> It happens on stand alone.....
>
> Indeed I found this bug when my application doesn't work if you restart the
> live server, only if you restart it, and then deploy a new version of the
> app.....which confused the hell out of me to begin with!
>
>
> Thanks.
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/JSP-named-bean-bug-tp4680338p4680340.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: JSP named bean bug

Posted by tonywestonuk <to...@totspics.com>.
It happens on stand alone..... 

Indeed I found this bug when my application doesn't work if you restart the
live server, only if you restart it, and then deploy a new version of the
app.....which confused the hell out of me to begin with!


Thanks.



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JSP-named-bean-bug-tp4680338p4680340.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: JSP named bean bug

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

does it work in a standalone tomee (= not using WTP or eclipse at all)?


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-10-17 16:05 GMT+02:00 tonywestonuk <to...@totspics.com>:

> Hi.
>
> I think i've fallen fowl of a bug.... Let me outline the steps to
> reproduce.
>
> 1) Create an application scoped bean
>
> @ApplicationScoped
> @Named("bugbean")
> public class BugBean {
>         public String getBugVal(){
>                 return "bugval";
>         }
> }
>
> 2) Create a JSP to show it.
> <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
> pageEncoding="ISO-8859-1"%>
> <html>
>         ${bugbean.bugVal}
> </html>
>
>
> 3) Start Tomee.....Load the page.  It doesn't work, bugbean is not
> resolved.
>
>
> however. If you hot deploy a new version, (or make a code change within
> Eclipse and allow TomEE to restart),  then it works!
>
>
> The same problem regardless if you use @Singleton or @ApplicationScoped
>
>
> .... OR, am I doing something wrong?
>
>
> Thanks.
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/JSP-named-bean-bug-tp4680338.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>