-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to modify java:comp/BeanManager to java:comp/env/BeanManager? #74
Comments
Good catch! This would affect tomcat too as its jndi is read only as well. So bean manager is going to be in the location you noted above. I'd say drop back to 1.0.0 release for time being. |
I copied CDIUtils.java and modified it as follows:
It works fine! |
@iwangxiaodong Can you kindly send a PR for this. Thanks. I've used this exact same thing for JNDI many times in the past. While not the most efficient, given it hits multiple container types it's probably the easiest. |
@iwangxiaodong @hazendaz It would be nice if we can cache at least the jndi name. but maybe it requires some synchronization. I think throwing exceptions and catching them every time this method is called is a lot of overhead. We have to decide what is less bad: synchronization vs try/catch. Or maybe we can statically do a lookup when the class is loaded and save the correct jndi name, so we will not require sync or try/catch inside the method. |
@iwangxiaodong @hazendaz What do you think about something like this:
|
@iwangxiaodong @hazendaz Or even better:
|
@iwangxiaodong Thanks for the catch. I will submit the patch just now. |
@mnesarco Yeah! Nice! |
Great! I can push a release tonight.
Get Outlook for Android<https://aka.ms/ghei36>
…________________________________
From: iwangxiaodong <notifications@github.com>
Sent: Thursday, October 12, 2017 11:47:52 AM
To: mybatis/cdi
Cc: Jeremy Landis; Mention
Subject: Re: [mybatis/cdi] How to modify java:comp/BeanManager to java:comp/env/BeanManager? (#74)
@mnesarco<https://github.com/mnesarco> Yeah! Nice!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#74 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AA7ho0AJM0duhw-TaK8kIsmi7xo1lFnaks5srjSmgaJpZM4P2WYM>.
|
@iwangxiaodong @mnesarco I have released version 1.0.2 with this change. It should show in central in about 2 hours but is otherwise available for download now. |
Thank you very much Jeremy! Nice work!
El 13/10/2017 9:15 PM, "Jeremy Landis" <notifications@github.com> escribió:
@iwangxiaodong <https://github.com/iwangxiaodong> @mnesarco
<https://github.com/mnesarco> I have released version 1.0.2 with this
change. It should show in central in about 2 hours but is otherwise
available for download now.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#74 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABCXVfoKO5PTZYYImWOv6GnimUS0nVyiks5ssBk9gaJpZM4P2WYM>
.
|
compile 'org.mybatis:mybatis-cdi:1.0.2' I tested OK! |
InitialContext.doLookup("java:comp/BeanManager") in org.mybatis.cdi.CDIUtils.getBeanManager()
Jetty only allows you to bind entries to java:comp/env, so the BeanManager will be available at java:comp/env/BeanManager
How to modify java:comp/BeanManager to java:comp/env/BeanManager?
Thanks!
The text was updated successfully, but these errors were encountered: