Foren

Can't create a FreeMarker portlet module

Peter Helgren, geändert vor 6 Jahren.

Can't create a FreeMarker portlet module

Regular Member Beiträge: 124 Beitrittsdatum: 14.11.13 Neueste Beiträge
I recently moved from a Windows 7 environment to Windows 10 and moved my development environment from one PC to the other matching file drives and paths exactly to minimize possible problems. I HAVE had issues and I think I am pretty much through them all. I mention the "move" because it could be at the bottom of THIS issue...not sure. I have been able to create FreeMarker portlets before...I just can't remember if I have done it since I changed PC's.

When I take the option to create a "New Liferay Module" project and choose the build type of gradle-module and the project template name of "freemarker-portlet" and click "Next" or "Finish" I get a popup error windows that simply says: "can't create module project". No stack trace, no log entries that I can find. Nothing...no project either. My workaround is to create an mvc-portlet and then change it but I don't know what artifacts the builder creates when a project is built so I am a little nervous about proceeding until this is fixed.

Any suggestion for fixing this? I have tried:
1) Starting eclipse with the -clean flag
2) removed all entries from the osgi/state, work and the tomcat work folders
3) Restarted the IDE multiple times....

At startup there are a few errors which may, or may not point to where the issue(s) is (are):


!SESSION 2017-07-17 09:01:09.296 -----------------------------------------------
eclipse.buildId=4.6.2.M20161124-1400
java.version=1.8.0_131
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

!ENTRY org.eclipse.epp.logging.aeri.core 4 0 2017-07-17 09:01:09.884
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.epp.logging.aeri.core [381]
  Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="2.0.4.v20170307-1435"; osgi.identity="org.eclipse.epp.logging.aeri.core"; singleton:="true"

	at org.eclipse.osgi.container.Module.start(Module.java:444)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1620)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1599)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1571)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1514)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY com.liferay.ide.core 2 0 2017-07-17 09:02:41.179
!MESSAGE BSFCentral-core does not exist
!STACK 1
Java Model Exception: Java Model Status [BSFCentral-core does not exist]
	at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:566)
	at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:247)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:579)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:316)
	at org.eclipse.jdt.internal.core.Openable.open(Openable.java:433)
	at com.liferay.ide.core.BaseLiferayProject.getSourceFolders(BaseLiferayProject.java:115)
	at com.liferay.ide.server.core.portal.PortalSourcePathComputerDelegate.collectPortalContainers(PortalSourcePathComputerDelegate.java:121)
	at com.liferay.ide.server.core.portal.PortalSourcePathComputerDelegate.computeSourceContainers(PortalSourcePathComputerDelegate.java:86)
	at org.eclipse.debug.internal.core.sourcelookup.SourcePathComputer.computeSourceContainers(SourcePathComputer.java:71)
	at org.eclipse.debug.core.sourcelookup.containers.DefaultSourceContainer.createSourceContainers(DefaultSourceContainer.java:117)
	at org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer.getSourceContainers(CompositeSourceContainer.java:133)
	at org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer.findSourceElements(CompositeSourceContainer.java:48)
	at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupParticipant.findSourceElements(AbstractSourceLookupParticipant.java:70)
	at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector$SourceLookupQuery.run(AbstractSourceLookupDirector.java:142)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector.doSourceLookup(AbstractSourceLookupDirector.java:505)
	at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector.getSourceElement(AbstractSourceLookupDirector.java:785)
	at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupFacility.lookup(SourceLookupFacility.java:344)
	at org.eclipse.debug.ui.DebugUITools.lookupSource(DebugUITools.java:1224)
	at org.eclipse.jdt.internal.debug.ui.JavaDebugOptionsManager.getProblem(JavaDebugOptionsManager.java:590)
	at org.eclipse.jdt.internal.debug.ui.breakpoints.SuspendOnCompilationErrorListener.breakpointHit(SuspendOnCompilationErrorListener.java:71)
	at org.eclipse.jdt.internal.debug.core.breakpoints.BreakpointListenerManager$JavaBreakpointListenerProxy.breakpointHit(BreakpointListenerManager.java:164)
	at org.eclipse.jdt.internal.debug.core.JDIDebugPlugin$HitNotifier.run(JDIDebugPlugin.java:746)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.jdt.internal.debug.core.JDIDebugPlugin$AbstractNotifier.notifyListeners(JDIDebugPlugin.java:546)
	at org.eclipse.jdt.internal.debug.core.JDIDebugPlugin$HitNotifier.notifyHit(JDIDebugPlugin.java:762)
	at org.eclipse.jdt.internal.debug.core.JDIDebugPlugin.fireBreakpointHit(JDIDebugPlugin.java:498)
	at org.eclipse.jdt.internal.debug.core.model.JDIThread.handleSuspendForBreakpoint(JDIThread.java:1415)
	at org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint.suspend(JavaBreakpoint.java:407)
	at org.eclipse.jdt.internal.debug.core.breakpoints.JavaExceptionBreakpoint.handleBreakpointEvent(JavaExceptionBreakpoint.java:393)
	at org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint.handleEvent(JavaBreakpoint.java:313)
	at org.eclipse.jdt.internal.debug.core.EventDispatcher.dispatch(EventDispatcher.java:152)
	at org.eclipse.jdt.internal.debug.core.EventDispatcher.access$0(EventDispatcher.java:100)
	at org.eclipse.jdt.internal.debug.core.EventDispatcher$1.run(EventDispatcher.java:250)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!SUBENTRY 1 org.eclipse.jdt.core 4 969 2017-07-17 09:02:41.179
!MESSAGE BSFCentral-core does not exist


The interesting thing about the "BSFCentral-core" doesn't exist error is that it DOES exist and it loads into the workspace just fine. That would indicate that *something* is pointing to the wrong project or path but, like I said, when I moved from Windows 7 to 10 (new machine) I re-created the drives and paths so they would match.. I have searched my workspace and the $USER folders for any bogus references so I don't know why the IDE cannot find the projects at startup (it isn't just the one mentioned above, it's ALL projects generate the error above)

Any pointers? Perhaps where would I find a log that had more detail although it may not help. I'd hate to have to start a new workspace and then import all the projects into it...that is the common "fix" for Eclipse issues but it is such a hassle and no guarantee that bad artifacts might import again....
Peter Helgren, geändert vor 6 Jahren.

RE: Can't create a FreeMarker portlet module

Regular Member Beiträge: 124 Beitrittsdatum: 14.11.13 Neueste Beiträge
Installed the latest version of the IDE (with trepidation) and it resolved the FreeMarker portlet build issue. I can create a FreeMarker portlets again!

Still have the issue with the error on the OSGI bundles : "org.osgi.framework.BundleException: Could not resolve module:...... Another singleton bundle selected:....." EVERY bundle throws that error! So somewhere in the bowels of the IDE there is a bad reference being kept of bundles and versions.

Anybody know where the mismatches might be kept ? I could maybe clear a file, cache, etc...? I already cleared the likely folders (as indicated in my initial post)...I'd like to clear this up so that when weirdnesses occur I can rule out a config issue in the IDE...
thumbnail
Andy Wu, geändert vor 6 Jahren.

RE: Can't create a FreeMarker portlet module

Regular Member Beiträge: 195 Beitrittsdatum: 05.05.15 Neueste Beiträge
Hey Peter , can you give out clear simple steps to reprocude your problem ? and we will try to find out what happens.
Peter Helgren, geändert vor 6 Jahren.

RE: Can't create a FreeMarker portlet module

Regular Member Beiträge: 124 Beitrittsdatum: 14.11.13 Neueste Beiträge
I created a Test portlet this morning while I was trying to figure out what was wrong. I can either post the code, which is basically what I followed from the "Captcha" sample in the Blade Samples online, to my github account, or zip the project and post that. There is hardly any code involved here. I stripped it down to basics so I could try different approaches.

I have created another, more complex portlet as well as gone back and changed the non-functional portlets I have to use just the project name and they are now working.

I suspect that it isn't the code, it's my environment, but I'll post whatever you want....
Peter Helgren, geändert vor 6 Jahren.

RE: Can't create a FreeMarker portlet module

Regular Member Beiträge: 124 Beitrittsdatum: 14.11.13 Neueste Beiträge
Code is here in my Git repository: https://github.com/phelgren/Liferay-tweaks/tree/master/problems/projects

Might be OK if you recreate it from scratch...again, I think there might be some environment setting so if you need the entire project zipped and made available, I can do that.....
thumbnail
Andy Wu, geändert vor 6 Jahren.

RE: Can't create a FreeMarker portlet module

Regular Member Beiträge: 195 Beitrittsdatum: 05.05.15 Neueste Beiträge
Hey Peter , I didn't get your mean , what is this repo for ? Do you have some problem with this repo ?
Peter Helgren, geändert vor 6 Jahren.

RE: Can't create a FreeMarker portlet module (Antwort)

Regular Member Beiträge: 124 Beitrittsdatum: 14.11.13 Neueste Beiträge
DOH!!!! Sorry Andy...mistaken information....I was responding to the wrong post. The github stuff, etc was for a different issue.

The IDE refresh/update fixed the FreeMarker portlet creation issue....all is well here.

Still getting the OSGI bundle errors but I don't know how to recreate for you....I moved a data HDD that contained my LR 7.0 installation, IDE and eclipse workspaces from a Windows 7 PC to a Windows 10 PC. All the drive ID's, etc, remained the same but I now have these OSGI errors. They don't seem to have broken my modules or build processes so it is a nuisance more than a show stopper. Since I don't know how the osgi loader works, I don't know how to search for a possible solution of having these missing osgi bundles that aren't "really" missing....
thumbnail
Gregory Amerson, geändert vor 6 Jahren.

RE: Can't create a FreeMarker portlet module

Liferay Legend Beiträge: 1123 Beitrittsdatum: 16.02.10 Neueste Beiträge
Thanks for following up, let us know if we can help with anything else.
thumbnail
Andy Wu, geändert vor 6 Jahren.

RE: Can't create a FreeMarker portlet module

Regular Member Beiträge: 195 Beitrittsdatum: 05.05.15 Neueste Beiträge
Just take it easy , never mind about this, sometimes there will be mistake information , just let us know if you have any other issue.