Skip to content
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

Jakarta support #447

Closed
amoscatelli opened this issue Nov 16, 2022 · 10 comments
Closed

Jakarta support #447

amoscatelli opened this issue Nov 16, 2022 · 10 comments

Comments

@amoscatelli
Copy link

amoscatelli commented Nov 16, 2022

Is support for jakarta packages planned ?

After migrating it keeps complaining like this :

11:22:46,238 INFO [stdout] (MSC service thread 1-6) Caused by: compile error: no such class: javax.enterprise.context.spi.Contextual
11:23:52,099 INFO [stdout] (ServerService Thread Pool -- 7) Caused by: compile error: no such class: javax.persistence.spi.PersistenceUnitInfo

Thank you in advance

@skybber
Copy link
Contributor

skybber commented Nov 16, 2022

It is on TODO list, but I have no time for it now. I'm still using java EE 8.

@jezovuk
Copy link

jezovuk commented Aug 30, 2023

Hi @skybber, can you please tell me what is the status of Jakarta support? Pull request #449 is closed (by @amoscatelli) but not merged, AFAICT.

@skybber
Copy link
Contributor

skybber commented Aug 30, 2023

There are many new *_jakarta plugins:

https://github.com/HotswapProjects/HotswapAgent/tree/master/plugin

it should work except weld_jakarta, that is not tested at all. owb_jakarta should work.

@jezovuk
Copy link

jezovuk commented Sep 4, 2023

I've just tried the version 1.4.2-SNAPSHOT (2023-07-14) with project using Jakarta versions of Hibernate (6.2.7), Weld (5.0.SP3) and Jakarta Faces / Mojarra (4.0.3) on JDK17 (JetBrains Runtime JDK jbr_jcef-17.0.8-windows-x64-b1000.8) and Tomcat 10.1.13 (configured according to JDK17 quick start guide).

Mojarra plugin fails with following:

HOTSWAP AGENT: 10:32:57.053 ERROR (org.hotswap.agent.annotation.handler.PluginClassFileTransformer) - InvocationTargetException in transform method on plugin 'class org.hotswap.agent.plugin.mojarra.MojarraPlugin' class 'com/sun/faces/lifecycle/LifecycleImpl'.
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.hotswap.agent.annotation.handler.PluginClassFileTransformer.transform(PluginClassFileTransformer.java:220)
	at org.hotswap.agent.annotation.handler.PluginClassFileTransformer.transform(PluginClassFileTransformer.java:112)
	at org.hotswap.agent.util.HotswapTransformer.transform(HotswapTransformer.java:250)
	at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:244)
	at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
	at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:541)
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
	at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2484)
	at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:865)
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1401)
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1245)
	at com.sun.faces.lifecycle.LifecycleFactoryImpl.<init>(LifecycleFactoryImpl.java:57)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
	at jakarta.faces.FactoryFinderInstance.getImplGivenPreviousImpl(FactoryFinderInstance.java:432)
	at jakarta.faces.FactoryFinderInstance.getImplementationInstance(FactoryFinderInstance.java:323)
	at jakarta.faces.FactoryFinderInstance.getFactory(FactoryFinderInstance.java:183)
	at jakarta.faces.FactoryFinder.getFactory(FactoryFinder.java:263)
	at com.sun.faces.config.processor.FactoryConfigProcessor.lambda$verifyFactoriesExist$0(FactoryConfigProcessor.java:286)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
	at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:280)
	at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:195)
	at com.sun.faces.config.ConfigManager.lambda$initialize$0(ConfigManager.java:265)
	at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720)
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
	at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:263)
	at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:179)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4420)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4860)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:866)
	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:846)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:866)
	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:241)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:433)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:918)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:795)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:347)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:478)
Caused by: org.hotswap.agent.javassist.NotFoundException: com.sun.faces.mgbean.BeanManager
	at org.hotswap.agent.javassist.ClassPool.get(ClassPool.java:422)
	at org.hotswap.agent.plugin.mojarra.transformer.BeanManagerTransformer.getModifiedCtClass(BeanManagerTransformer.java:160)
	at org.hotswap.agent.plugin.mojarra.transformer.LifecycleImplTransformer.initClassPool(LifecycleImplTransformer.java:43)
	at org.hotswap.agent.plugin.mojarra.transformer.LifecycleImplTransformer.init(LifecycleImplTransformer.java:34)
	... 67 more

It seems that there is no "jakarta" version of mojarra plugin?

@nemanjajovanovicgit
Copy link

Problem here is not that plugin is not "jakartified" but that Mojara plugin in version 1.4.2-SNAPSHOT does not work with Jakarta Faces / Mojarra (4.0.3). In new 1.4.2-SNAPSHOT Mojarra plugin support for reload of natively managed beans by JSF was added . However Jakarta faces 4.0 removed native managed bean support (jakartaee/faces#1547) . Solution is to practically revert to 1.4.1 version of Mojarra plugin, i did this by creating custom plugin in our project and disabled Mojarra plugin via properties file.

@lzzgabriel
Copy link

Any news on this?

@skybber
Copy link
Contributor

skybber commented Apr 3, 2024

No updates, any help with it would be greatly appreciated.

@skybber
Copy link
Contributor

skybber commented Apr 6, 2024

Should be fixed in 1.4.2-SNAPSHOT release now.

@skybber
Copy link
Contributor

skybber commented Aug 3, 2024

Problem here is not that plugin is not "jakartified" but that Mojara plugin in version 1.4.2-SNAPSHOT does not work with Jakarta Faces / Mojarra (4.0.3). In new 1.4.2-SNAPSHOT Mojarra plugin support for reload of natively managed beans by JSF was added . However Jakarta faces 4.0 removed native managed bean support (jakartaee/faces#1547) . Solution is to practically revert to 1.4.1 version of Mojarra plugin, i did this by creating custom plugin in our project and disabled Mojarra plugin via properties file.

it is fixed in 1.4.1-SNAPSHOT

@skybber
Copy link
Contributor

skybber commented Aug 4, 2024

The WeldJakarta plugin has been fixed, and most JUnit tests are now functioning correctly.

@skybber skybber closed this as completed Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants