Why I am having this problem. It was working properly yesterday?

Jamie Sammons, modified 2 Years ago. New Member Posts: 5 Join Date: 3/6/23 Recent Posts

The problem: 2023-03-14 04:51:55.824 ERROR [fileinstall-directory-watcher][DirectoryWatcher:1173] Unable to start bundle: file:/D:/Liferay/Liferay/gradebook-workspace/bundles/osgi/modules/com.liferay.training.gradebook.web-1.0.0.jar
com.liferay.portal.kernel.log.LogSanitizerException: org.osgi.framework.BundleException: Could not resolve module: com.liferay.training.gradebook.web [1718]_  Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=11))"_ [Sanitized]
at org.eclipse.osgi.container.Module.start(Module.java:444) ~[org.eclipse.osgi.jar:?]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:428) ~[org.eclipse.osgi.jar:?]
at com.liferay.portal.file.install.internal.DirectoryWatcher._startBundle(DirectoryWatcher.java:1156) [bundleFile:?]
at com.liferay.portal.file.install.internal.DirectoryWatcher._startBundles(DirectoryWatcher.java:1189) [bundleFile:?]
at com.liferay.portal.file.install.internal.DirectoryWatcher._startAllBundles(DirectoryWatcher.java:1130) [bundleFile:?]
at com.liferay.portal.file.install.internal.DirectoryWatcher._process(DirectoryWatcher.java:1041) [bundleFile:?]
at com.liferay.portal.file.install.internal.DirectoryWatcher.run(DirectoryWatcher.java:247) [bundleFile:?]

thumbnail
Jamie Sammons, modified 2 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts

You also asked this on the community slack, dude...

Somebody compiled the gradebook-web module using JDK-11, but it looks like your bundle is probably running under JDK-8.

The Unresolved Requirement message is telling you that it is looking for Java SE version 11, but that is not available, which is why I think your bundle is running under JDK-8.

If you are going to run your bundle under JDK-8, you must compile under JDK-8.

If you are going to run your bundle under JDK-11, then you can compile either using JDK-8 or JDK-11.

The safest option is to always compile under JDK-8, that way your modules work regardless of what version your bundle is running under, but then you can't take advantage of Java 11 syntax.