EJB not deploying on Payara

1,295 views
Skip to first unread message

xyz1

unread,
Apr 10, 2018, 12:16:53 PM4/10/18
to Payara Forum

On migration application from glassfish 3 to payara , I am getting following error on console. What could be the possible reasons for EJB not getting deployed on payara server?

 Exception while invoking class org.glassfish.ejb.startup.EjbDeployer
 load method java.lang.RuntimeException: EJB Container initialization
 error at
 org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:234)

 ...

 Caused by: java.lang.IllegalAccessException: Class
 com.sun.ejb.containers.BaseContainer can not access a member of class
 my.package.$Proxy280 with modifiers "public">       at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)

Mike Croft

unread,
Apr 11, 2018, 5:12:11 AM4/11/18
to Payara Forum
There's not a lot to go on here. What's the full stack trace?

xyz1

unread,
Apr 11, 2018, 11:59:12 AM4/11/18
to Payara Forum

Ondro Mihályi

unread,
Apr 11, 2018, 2:03:37 PM4/11/18
to xyz1, Payara Forum
What is your version of Java? 

Dňa st 11. 4. 2018, 17:59 xyz1 <sko...@gmail.com> napísal(a):
--
You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/f76148a3-e2c1-4fdc-829b-d720d1454bba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

xyz1

unread,
Apr 11, 2018, 5:12:15 PM4/11/18
to Payara Forum
Java version checked was 6 as well as 8.


On Tuesday, April 10, 2018 at 9:16:53 PM UTC+5, xyz1 wrote:

xyz1

unread,
Apr 11, 2018, 5:16:40 PM4/11/18
to Payara Forum



On Tuesday, April 10, 2018 at 9:16:53 PM UTC+5, xyz1 wrote:

Ondro Mihályi

unread,
Apr 11, 2018, 5:30:35 PM4/11/18
to xyz1, Payara Forum
Is the class from the error message public? I mean the class whose name ends with "ervices" and you blurred its name in the log output. If it's not public, make it public. It's very probably that Payara validates the code more strictly than GlassFish 3.

--
You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum+unsubscribe@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/7e7d6214-2cff-4eaf-8ed6-09eff6f19e8c%40googlegroups.com.

Sana Korejo

unread,
Apr 11, 2018, 6:34:41 PM4/11/18
to Payara Forum
Following are the files and highlighted lines which seems to get called. Line numbers in stack trace are different as the versions are different. I checked all classes in services package they are public and have public constructor, does this direct to check something else which I am missing?


basecontainer.JPG
constructor.JPG
Reflection.JPG

Ondro Mihályi

unread,
Apr 12, 2018, 1:29:24 AM4/12/18
to Sana Korejo, Payara Forum
This is Glassfish 3 code. I thought you don't get any exception on GF3 but only on Payara. 

The best would be if you could isolate the code in your application that causes the exception and create a simple reproducible example. Then raise an issue on github: github.com/payara/Payara/issues

This is the type of problem which is complex and requires to see the source code of the application. 

Ondro

Dňa št 12. 4. 2018, 0:34 Sana Korejo <sko...@gmail.com> napísal(a):
Following are the files and highlighted lines which seems to get called. Line numbers in stack trace are different as the versions are different. I checked all classes in services package they are public and have public constructor, does this direct to check something else which I am missing?


On Thu, Apr 12, 2018 at 2:30 AM, Ondro Mihályi <ondrej....@gmail.com> wrote:
Is the class from the error message public? I mean the class whose name ends with "ervices" and you blurred its name in the log output. If it's not public, make it public. It's very probably that Payara validates the code more strictly than GlassFish 3.
2018-04-11 23:16 GMT+02:00 xyz1 <sko...@gmail.com>:



On Tuesday, April 10, 2018 at 9:16:53 PM UTC+5, xyz1 wrote:

On migration application from glassfish 3 to payara , I am getting following error on console. What could be the possible reasons for EJB not getting deployed on payara server?

 Exception while invoking class org.glassfish.ejb.startup.EjbDeployer
 load method java.lang.RuntimeException: EJB Container initialization
 error at
 org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:234)

 ...

 Caused by: java.lang.IllegalAccessException: Class
 com.sun.ejb.containers.BaseContainer can not access a member of class
 my.package.$Proxy280 with modifiers "public">       at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)

--
You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/CANx__0sxJPcvF%3DkejqSUD1xpHUDOaQnEE4wFNMnS_0EyRUDg_g%40mail.gmail.com.

xyz1

unread,
Apr 12, 2018, 4:01:40 PM4/12/18
to Payara Forum
Is there any other way to understand this issue? Apparently it says it cannot access public method, I have checked class access levels of each class in services package and it is public also the constructor are public.

On Tuesday, April 10, 2018 at 9:16:53 PM UTC+5, xyz1 wrote:

Christoph John

unread,
Apr 13, 2018, 1:48:16 AM4/13/18
to Payara Forum
Are you simply deploying the same archive that you deployed to GF3 to Payara? Or did you recompile/repackage it with updated deployment descriptors?
My first suggestion would be to get rid of all old deployment descriptors (especially ones that start with sun-*), repackage the application and try to deploy again.
Also what Ondro said is required to help you any further with this. No one has the time to try to understand what you did without having any condensed example archive. Everything else is just guesswork.

Cheers,
Chris.

xyz1

unread,
Apr 17, 2018, 3:53:52 AM4/17/18
to Payara Forum
The server libraries of glassfish 4 / 5 or payara are not compatible to the code developed on glassfish 3, when i change the libraries in modules folder i get past this error, but is this the proper way to proceed? For upgrading from glassfish 3 to 4 do we need to use upgrade tool? I read somewhere it is not tested and is buggy therefore can anyone suggest what would be the best way to migrate?


On Tuesday, April 10, 2018 at 9:16:53 PM UTC+5, xyz1 wrote:

Ondro Mihályi

unread,
Apr 17, 2018, 4:18:29 AM4/17/18
to xyz1, Payara Forum
Which libraries did you change in the modules folder to fix it?

If you need to use an older or new version of a library that exists in Payara Server, I recommend adding the library to your application and disable classloading delegation: https://docs.payara.fish/documentation/payara-server/classloading.html

I definitely don't recommend the upgrade tool because it's not maintained and not tested at all.

Ondro

--
You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum+unsubscribe@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/c38a39b6-c6a5-487b-bc15-28852d83298b%40googlegroups.com.

xyz1

unread,
Apr 17, 2018, 10:37:16 AM4/17/18
to Payara Forum
I replaced the whole module folder , later on to find out the culprit jar I tried to add javax.ejb.jar, javax container and their dependencies, but still it did'nt do the trick. Seems like I will have to check all the libraries by replacing them with old one to see if it fix the issue?

Currently in my glassfish-web.xml class-loader delegate is already set to false. Do you think the above mentioned way is the best possible way I can test it or is there anything better I am missing?



On Tuesday, April 10, 2018 at 9:16:53 PM UTC+5, xyz1 wrote:

xyz1

unread,
Apr 20, 2018, 12:45:50 PM4/20/18
to Payara Forum
I have observed this same exception if I change the Java version of glassfish 3.1.2.2 to Java 8 from Java 6. As Payara have option for Java 8 only this is why this error generate there.

Any idea on this error ?

On Tuesday, April 10, 2018 at 9:16:53 PM UTC+5, xyz1 wrote:

xyz1

unread,
Apr 23, 2018, 12:45:03 PM4/23/18
to Payara Forum
There was an interface with default access level in services package, on adding public modifier this issue solved. 


On Tuesday, April 10, 2018 at 9:16:53 PM UTC+5, xyz1 wrote:
Reply all
Reply to author
Forward
0 new messages