Error While Editing XHTML Files in Eclipse - eclipse

Whenever I try to edit an xhtml file in eclipse, it shows an internal error:
An internal error occured during "Processing variables for ...xhtml"
Could not initialize class org.apache.myfaces.shared.config.MyfacesConfig
Is there a way to fix this problem?
Stack trace:
java.lang.NoClassDefFoundError: Could not initialize class org.apache.myfaces.shared.config.MyfacesConfig
at oracle.eclipse.tools.webtier.jsf.facelet.DTFacesConfigurator.configureApplication(DTFacesConfigurator.java:683)
at oracle.eclipse.tools.webtier.jsf.facelet.DTFacesConfigurator.configure(DTFacesConfigurator.java:414)
at oracle.eclipse.tools.webtier.jsf.facelet.FaceletCompilerConfigurator.configure(FaceletCompilerConfigurator.java:118)
at oracle.eclipse.tools.webtier.jsf.facelet.FaceletCompilerConfigurator.configure(FaceletCompilerConfigurator.java:97)
at oracle.eclipse.tools.webtier.jsf.facelets.OepeFaceletCompiler.createConfig(OepeFaceletCompiler.java:113)
at oracle.eclipse.tools.webtier.jsf.facelets.OepeFaceletCompiler.compile(OepeFaceletCompiler.java:78)
at oracle.eclipse.tools.webtier.jsf.facelets.FaceletCompileUtil.ensureContext(FaceletCompileUtil.java:35)
at oracle.eclipse.tools.webtier.jsf.dependency.discovery.FaceletDiscoveryParticipant.discover(FaceletDiscoveryParticipant.java:267)
at oracle.eclipse.tools.webtier.jsf.dependency.discovery.FaceletDiscoveryParticipant.discoverFromExistingModel(FaceletDiscoveryParticipant.java:361)
at oracle.eclipse.tools.application.common.services.variables.VariablesController$DocumentRediscoveryJob.runAfterCommands(VariablesController.java:746)
at oracle.eclipse.tools.common.services.concurrency.AbstractJob.run(AbstractJob.java:73)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

All x-friends directives in the manifest file referenced to a wrong bundle.
Fix for the most recent version of OEPE (12.1.3.3.1):
Replace META-INF\MANIFEST.MF in plugins\oracle.eclipse.tools.webtier.jsf.facelet_7.3.3.201412231459.jar with this.
Restart eclipse

Related

AEM6.2: com.day.cq.wcm.tags.IncludeTag Error

We have AEM6.2 node environment and we are trying to access login.html but getting error as below.
After searching I came to know that java version could be one of the possible reason but I am already using Java 8 for this application. I am out of ideas. Any suggestions greatly appreciated.
14.09.2018 14:08:40.299 *ERROR* [192.156.110.11 [1536948520114] GET /content/en/account/login.html HTTP/1.1] com.day.cq.wcm.tags.IncludeTag Error while executing script defaulttopnav
org.apache.sling.api.scripting.ScriptEvaluationException:
at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:416)
at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184)
at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491)
at com.day.cq.wcm.tags.IncludeTag.includeScript(IncludeTag.java:178)
at com.day.cq.wcm.tags.IncludeTag.doEndTag(IncludeTag.java:95)
at org.apache.jsp.apps.components.navigation.topnavigation_jsp._jspService(navigation_jsp.java:329)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.sling.api.SlingException:
at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspExceptionInternal(JspServletWrapper.java:691)
at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:608)
at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:533)
at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:449)
at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java:284)
at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.java:102)
at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:536)
at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:388)
... 201 common frames omitted
Caused by: java.lang.NullPointerException: null
at org.apache.jsp.apps.components.topnavigation.defaulttopnav_jsp._jspService(defaulttopnav_jsp.java:347)
at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502)
... 206 common frames omitted
Thank you.
General solution for errors are thrown by servlets compiled from jsp files, is to recompile the jsp again.
Goto system/console and verify if all bundles are in active state
Goto sling --> jsp and recompile all jsps.
This works if errors are thrown from otb jsp. However when custom application jsps throw error, you ll need to fix the custom jsp code by handling the error.
Another foolproof way to clear cached jsp class files is to delete /var/classes
The stacktrace indicates the NPE is stemming from defaulttopnav_jsp.java, line 347. Analysing the generated java file is the way to go.
Since AEM 6.1, the default ClassLoader was replaced by FSClassLoader and the generated .java files are no longer stored under /var/classes.
To locate the .java file you will need to locate the bundle ID for the FSClassLoader bundle, then the java files will be located at:
[AEM_INSTALL_DIR]/crx-quickstart/launchpad/felix/bundle[BUNDLE_ID]/data/classes
There is also a sling plugin which will help you view the generated java file from OSGi console. Check out these posts for that.

Debugging OfBiz in Eclipse gives MissingResourceException

I downloaded the OfBiz Java application and the following line throws an MissingResourceException:
ResourceBundle res = ResourceBundle.getBundle(settingsResourceName);
The value of settingsResourceName is "cache", but I cannot find any file called cache.properties or cache_en.properties.
Where should I be looking? I'm new to Java. All my research on SO says there should be such a file.
I imported OfBiz in Eclipse using the Import menu option and selecting Existing Project from File System (I'm not in front of my dev machine so I don't remember the exact wording). But I chose the root folder of the downloaded OfBiz.
I then added the appropriate VM Arguments in the Run Configuration to get it to run properly at least. And that's it, on the first Run I got the above error. I think it has to do with a missing class path but I don't know what to add to class path.
Here is the stack trace:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.apache.ofbiz.base.util.Debug.<clinit>(Debug.java:68)
at org.apache.ofbiz.base.container.ContainerLoader.load(ContainerLoader.java:61)
at org.apache.ofbiz.base.start.StartupControlPanel.loadStartupLoaders(StartupControlPanel.java:202)
at org.apache.ofbiz.base.start.StartupControlPanel.start(StartupControlPanel.java:69)
at org.apache.ofbiz.base.start.Start.main(Start.java:84)
Caused by: java.util.MissingResourceException: Can't find bundle for base name cache, locale en
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1564)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1387)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:773)
at org.apache.ofbiz.base.util.cache.UtilCache.setPropertiesParams(UtilCache.java:174)
at org.apache.ofbiz.base.util.cache.UtilCache.setPropertiesParams(UtilCache.java:170)
at org.apache.ofbiz.base.util.cache.UtilCache.setPropertiesParams(UtilCache.java:166)
at org.apache.ofbiz.base.util.cache.UtilCache.<init>(UtilCache.java:124)
at org.apache.ofbiz.base.util.cache.UtilCache.createUtilCache(UtilCache.java:769)
at org.apache.ofbiz.base.util.UtilProperties.<clinit>(UtilProperties.java:75)
... 5 more
UPDATE:
My mistake, I found two files both called cache.properties in the following folders:
ofbiz-trunk/build/resources/main
ofbiz-trunk/framework/base/config
But these are folders, not packages. I tried putting them in the .classpath but that did not work, I still kept getting the same error.
As suspected, I knew it was because of a missing reference to a class path. After looking at a section on this page: http://www.opensourcestrategies.com/ofbiz/ofbiz_eclipse.php, I learned that I was supposed to go to the Java Build Path and in the Libraries tab, click on Add Class Folder, then point that to ofbiz-trunk/framework/base/config. Which is where I have one of the cache.properties files.

NetBeans and JBoss

I am reading this tutorial http://www.tutorialspoint.com/ejb/index.htm. I have installed NetBeans IDE 8.0.2 and JBoss 5 server. And I have a problem with this part of the tutorial http://www.tutorialspoint.com/ejb/ejb_create_application.htm with jndi.properties file. I don't understand where should i put it? I have put it here C:\Users\Mimo\Documents\NetBeansProjects\EjbTester\jndi.properties in my EjbTester project and I get the following exceptions.
run:
java.io.FileNotFoundException: C:\Users\Mimo\Documents\NetBeansProjects\EjbTester\jndi.properties (The system cannot find the file specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.(FileInputStream.java:138)
at java.io.FileInputStream.(FileInputStream.java:93)
at com.tutorialspoint.test.EJBTester.(EJBTester.java:25)
at com.tutorialspoint.test.EJBTester.main(EJBTester.java:39)
Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:350)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at com.tutorialspoint.test.EJBTester.testStatelessEjb(EJBTester.java:53)
at com.tutorialspoint.test.EJBTester.main(EJBTester.java:41)
Thanks for all your help!
Right click on project name in Project explorer window and select empty file name is jndi.properties and add info it... its work

Uninstalling eclipse plugin error

When I try to uninstall my eclipse plugin the following error occurs:
An error occurred while uninstalling
enter code heresession context was:(profile=profile, phase=org.eclipse.equinox.internal.provisional.p2.engine.phases.Uninstall, operand=[R]de.test.package.one 0.1.0.201008170949 --> null, action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.UninstallBundleAction).
Error while loading manipulator.
Caused by: Application failed,
Most topics refer to the eclipse.ini file, which I modified but that didn't solve the problem. The eclipse.ini looks like this:
-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.200.v20090520
Any ideas how I can solve this problem?
I would like you to know that I solved the: "An error occurred while uninstalling" problem. by:
1.) rename the eclipse.ini file to a non ini name (eclipse.xxx)
2.) start eclipse
3.) Install the software/plugin
4.) restore the ini file.
I wonder why Eclipse can start in the first place but it works.
The renaming of the executable did NOT work for me.

"Error while loading manipulator"

I'm continually getting the following error under Eclipse Galileo while trying to install the WTP Web Page Editor plugin:
java.lang.IllegalStateException: Error while loading manipulator.
at org.eclipse.equinox.internal.p2.touchpoint.eclipse.LazyManipulator.loadDelegate(LazyManipulator.java:54)
at org.eclipse.equinox.internal.p2.touchpoint.eclipse.LazyManipulator.getConfigData(LazyManipulator.java:108)
at org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction.installBundle(InstallBundleAction.java:76)
at org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction.execute(InstallBundleAction.java:29)
at org.eclipse.equinox.internal.p2.engine.ParameterizedProvisioningAction.execute(ParameterizedProvisioningAction.java:35)
at org.eclipse.equinox.internal.provisional.p2.engine.Phase.mainPerform(Phase.java:129)
at org.eclipse.equinox.internal.provisional.p2.engine.Phase.perform(Phase.java:72)
at org.eclipse.equinox.internal.provisional.p2.engine.PhaseSet.perform(PhaseSet.java:44)
at org.eclipse.equinox.internal.provisional.p2.engine.Engine.perform(Engine.java:54)
at org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil.performProvisioningPlan(ProvisioningUtil.java:389)
at org.eclipse.equinox.internal.provisional.p2.ui.operations.ProfileModificationOperation.doExecute(ProfileModificationOperation.java:61)
at org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningOperation.execute(ProvisioningOperation.java:37)
at org.eclipse.equinox.internal.provisional.p2.ui.ProvisioningOperationRunner$1.run(ProvisioningOperationRunner.java:94)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
One blog said Eclipse Galileo doesn't play well with Java 1.6 (what??), so I've tried running Eclipse with Java 1.5 but that hasn't helped. Has anyone else had this problem and been able to get around it?
Edit BTW, below the error in the error log it also says
session context was:(profile=epp.package.java, phase=org.eclipse.equinox.internal.provisional.p2.engine.phases.Install, operand=null --> [R]javax.mail 1.4.0.v200905040518, action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction).
You can try to follow the various suggestions mentioned in the bug 277242
Also check your eclipse.ini:
More generally, the error you're seeing can happen when we cannot read "-startup" since we use this to position the install.area.
As suggested by Jelle van Geuns in the comments (and confirmed by Halfstop):
I found that one MacOS there are two folders (MacOS and Eclipse) with two separate sets of configuration files.
Each had an 'org.eclipse.equinox.launcher' startup jar in the plugins sub-folder, but with slightly different versions.
The Eclipse executable resides in the MacOS folder.
But the eclipse.ini there was set up to look for the startup jar under Eclipse/plugins, but with the wrong version.
Solution that worked for me was to copy both versions of the startup.jar to both the plugins sub-folders.
Halfstop confirms:
I copied all of the what was in Eclipse to the MacOS directory and this solved it.
I just ran into this problem today. The answer provided by VonC et al helped to locate the problem but didn't quite fix it.
In my case, the location specified in -startup within the MacOS/eclipse.ini was incorrectly looking in the ../Eclipse/plugins folder rather than the ../MacOS/plugins folder.
I corrected the path and the error went away.
try to chown -R your_user_name:your_user_name /path/to/eclipe
Try edit
Eclipse/configuration/config.ini.
Make sure osgi.instance.area.default= value is right workspace. This works for me.
I'm not sure if the above answers adequately resolve this issue. I've found that, with a number of our eclipse derivative RCP products, that on some linux machines plugins will fail with log entries like this one:
!ENTRY org.eclipse.equinox.p2.engine 4 4 2017-02-23 12:00:49.492
!MESSAGE An error occurred while installing the items
!SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2017-02-23 12:00:49.492
!MESSAGE session context was:(profile=TIBCOBusinessStudio-4.0, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null --> [R]com.tibco.eclipse.p2.installer 1.1.3.20161130, action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction).
!SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2017-02-23 12:00:49.492
!MESSAGE Error while loading manipulator.
!STACK 0
java.lang.IllegalStateException: Error while loading manipulator.
at org.eclipse.equinox.internal.p2.touchpoint.eclipse.LazyManipulator.loadDelegate(LazyManipulator.java:59)
at org.eclipse.equinox.internal.p2.touchpoint.eclipse.LazyManipulator.getConfigData(LazyManipulator.java:108)
at org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction.installBundle(InstallBundleAction.java:75)
at org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction.execute(InstallBundleAction.java:32)
at org.eclipse.equinox.internal.p2.engine.ParameterizedProvisioningAction.execute(ParameterizedProvisioningAction.java:38)
at org.eclipse.equinox.internal.p2.engine.Phase.mainPerform(Phase.java:183)
at org.eclipse.equinox.internal.p2.engine.Phase.perform(Phase.java:95)
at org.eclipse.equinox.internal.p2.engine.PhaseSet.perform(PhaseSet.java:47)
at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:75)
at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:44)
at org.eclipse.equinox.p2.operations.ProvisioningSession.performProvisioningPlan(ProvisioningSession.java:159)
at org.eclipse.equinox.p2.operations.ProfileModificationJob.runModal(ProfileModificationJob.java:79)
at org.eclipse.equinox.p2.operations.ProvisioningJob.run(ProvisioningJob.java:177)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
The reason this happens (I suspect) is that the actual file name of the config file is compared with the absolute name by the lazyloader. In my case the home dir is a symlink, so the two names don't match. The resolution was to edit the eclipse.ini (or whatever yours is called) and ensure that all the paths referencing the eclipse home dir are fully qualified and do not rely on symlinks.