import of component classes fails

Post Reply
Nutrideath
Posts: 11
Joined: 11 Jul 2018, 15:58

29 Aug 2018, 18:06

I installed the Serenity theme, and everything worked just fine. This was in Eclipse v. 4.7 (Oxygen).

Hard drive crashed. Had 'eclipse-workspace' folder backed up, but had to reinstall Eclipse on new HD. Found newer version of Eclipse, so installed it, which is v. 4.8 (Photon).

Copied backed up version of eclipse-workspace to new installation. Now, the project seems to be unable to locate specific primefaces classes. Specific error messages, found in the SerenityMenuRenderer.java, are:

The import org.primefaces.component.menu.AbstractMenu cannot be resolved
and
The import org.primefaces.component.api.Widget cannot be resolved

I've tried everything I can think of:

I have the primefaces-6.2.jar in the classpath (as a Maven dependency).

In faces-config.xml I have the component as follows:
<component>
<component-type>org.primefaces.component.SerenityMenu</component-type>
<component-class>org.primefaces.serenity.component.SerenityMenu</component-class>
</component>

What happened between Eclipse 4.7 and 4.8 to break this? What am I doing wrong? (Thanks in advance.)

huseyinT
Posts: 123
Joined: 27 Mar 2016, 13:05

03 Sep 2018, 08:04

Hi,

Have you created and added a new jar file?

And,

Could you try the original Serenity project? If it will work, you could add this jar file in your project.

Could you give the feedback?

PS:
Maybe, Those links can help you for integrate the theme and layout into your project :

https://www.dropbox.com/s/gat9a4ym373mi ... t.mp4?dl=0
https://www.dropbox.com/s/2p74g63wldbov ... t.mp4?dl=0
https://www.dropbox.com/s/s9cle2xqbwbu8 ... t.mp4?dl=0
https://www.dropbox.com/s/11hn3e1e24bg0 ... t.mp4?dl=0

Greetings,

Nutrideath
Posts: 11
Joined: 11 Jul 2018, 15:58

06 Sep 2018, 21:27

Thanks for your reply. However, I do not understand what you mean by "Have you created and added a new jar file?" Do I need to recreate a jar file somehow?

Just to refresh your memory of my situation: my HD crashed. I had a backup copy of my 'eclipse-workspace' folder, where Eclipse stores its projects. I got a new HD, installed a newer version of Eclipse (previously was 4.7 Oxygen, now on new HD is 4.8 Photon).

Then I copied my backup 'eclipse-workspace' folder into the Eclipse installation and started Eclipse. It gave a message about updating the 'eclipse-workspace' folder, I told it to go ahead and it did.

So in my project, it contains the primefaces-6.2.jar (in Maven dependencies), and the serenity-theme-1.0.4.jar in the Referenced Libraries. Should the 'serenity-theme-1.0.4.jar' be in Maven? (Does that matter?) If so, how do I add it?

There is a single .java file that has problems importing primefaces classes. It is the SerenityMenuRenderer.java and it has problems with the following imports - marked with an '|X|' (note no problem with Separator or Submenu... ??!!?):

|X| import org.primefaces.component.api.AjaxSource;
|X| import org.primefaces.component.api.UIOutcomeTarget;
|X| import org.primefaces.component.menu.AbstractMenu;
|X| import org.primefaces.component.menu.BaseMenuRenderer;
|X| import org.primefaces.component.menuitem.UIMenuItem;
|X| import org.primefaces.component.submenu.UISubmenu;
|X| import org.primefaces.model.menu.MenuElement;
|X| import org.primefaces.model.menu.MenuItem;
import org.primefaces.model.menu.Separator;
import org.primefaces.model.menu.Submenu;
|X| import org.primefaces.util.ComponentUtils;
|X| import org.primefaces.util.WidgetBuilder;

Why problems with some and not all?

Could the problem be with the faces-config.xml file? Currently it reads as follows:

<?xml version="1.0" encoding="utf-8"?>
<faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-f ... ig_2_0.xsd">

<name>primefaces_serenity</name>

<component>
<component-type>org.primefaces.component.SerenityMenu</component-type>
<component-class>org.primefaces.serenity.component.SerenityMenu</component-class>
</component>

<render-kit>
<renderer>
<component-family>org.primefaces.component</component-family>
<renderer-type>org.primefaces.component.SerenityMenuRenderer</renderer-type>
<renderer-class>org.primefaces.serenity.component.SerenityMenuRenderer</renderer-class>
</renderer>
</render-kit>

</faces-config>

Any ideas?

Nutrideath
Posts: 11
Joined: 11 Jul 2018, 15:58

06 Sep 2018, 21:30

Oh, also meant to answer your questions:

The original Serenity project has the same problem with the same SerenityMenuRenderer.java file.

Also, the links you sent don't work... ?

Nutrideath
Posts: 11
Joined: 11 Jul 2018, 15:58

07 Sep 2018, 01:20

Could the version of JRE make any difference? Or the version of target Tomcat server?

Using: jre1.8.0_181 (but JRE System Library is specified as JavaSE-1.6), apache-tomcat-8.5.33

huseyinT
Posts: 123
Joined: 27 Mar 2016, 13:05

07 Sep 2018, 06:51

Nutrideath wrote:
06 Sep 2018, 21:30
Also, the links you sent don't work... ?
New Links :

https://www.dropbox.com/s/gat9a4ym373mi ... t.mp4?dl=0
https://www.dropbox.com/s/2p74g63wldbov ... t.mp4?dl=0
https://www.dropbox.com/s/s9cle2xqbwbu8 ... t.mp4?dl=0
https://www.dropbox.com/s/11hn3e1e24bg0 ... t.mp4?dl=0
Nutrideath wrote:
07 Sep 2018, 01:20
Could the version of JRE make any difference? Or the version of target Tomcat server?
I think that this isn't about versions. We are using Maven in our projects. Server choosing is not important that.

Nutrideath
Posts: 11
Joined: 11 Jul 2018, 15:58

07 Sep 2018, 11:33

Thanks again, and thanks for the updated links.

I was wrong before - the SerenityMenuRenderer.java is not the only java file that cannot resolve imports. I tried removing it completely, and the compiler found the same type of errors in another java file.

Also, I reinstalled serenity according to the videos you sent into a new project, with the same results.

How does it find some classes for import and not others? Could it be that I have an incorrect version of the jar file?

I have not done the instructions for using sass, but didn't think that would make a difference for this particular problem. Would it?

Nutrideath
Posts: 11
Joined: 11 Jul 2018, 15:58

07 Sep 2018, 23:11

Problem solved.

Somehow, the primefaces-6.2.jar file in the Maven repository was corrupt. Had to delete it and have Maven pull it down again, now everything is compiling just fine.

User avatar
aragorn
Posts: 3641
Joined: 29 Jun 2013, 12:38

10 Sep 2018, 09:03

Glad to hear, thanks a lot for the update!

Best Regards,

Post Reply

Return to “Serenity - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest