Forums

angle-left Back

Portal project has errors in Eclipse [resolved]

DW
Dave Willis, modified 9 Years ago.

Portal project has errors in Eclipse [resolved]

Expert Posts: 301 Join Date: 7/13/09 Recent Posts
Eclipse is giving me a bunch of errors in the portal project and I feel like if I can figure out what's going on there then the other problems I'm having might all fall in line. Problem is, I don't know where to start with it. I'm going to post all the errors here. It's a bit hard to read but hopefully it will give you guys an idea about what's going on. I'll be happy to provide any further information that anyone thinks might be useful for resolving this. Thanks!
-Dave
Description    Resource    Path    Location    Type
XMLConstants.NULL_NS_URI cannot be resolved    StateAwareResponseImpl.java    portal/portal-impl/src/com/liferay/portlet    line 62    Java Problem
XMLConstants.NULL_NS_URI cannot be resolved    PortletAppImpl.java    portal/portal-impl/src/com/liferay/portal/model/impl    line 179    Java Problem
Name clash: The method initialize(Subject, CallbackHandler, Map<String,?>, Map<String,?>) of type PortalLoginModule has the same erasure as initialize(Subject, CallbackHandler, Map, Map) of type LoginModule but does not override it    PortalLoginModule.java    portal/portal-impl/src/com/liferay/portal/security/jaas    line 100    Java Problem
Name clash: The method initialize(Subject, CallbackHandler, Map<String,?>, Map<String,?>) of type PortalLoginModule has the same erasure as initialize(Subject, CallbackHandler, Map, Map) of type LoginModule but does not override it    PortalLoginModule.java    portal/portal-kernel/src/com/liferay/portal/kernel/security/jaas    line 61    Java Problem
The type PortalLoginModule must implement the inherited abstract method LoginModule.initialize(Subject, CallbackHandler, Map, Map)    PortalLoginModule.java    portal/portal-impl/src/com/liferay/portal/security/jaas    line 41    Java Problem
The type PortalLoginModule must implement the inherited abstract method LoginModule.initialize(Subject, CallbackHandler, Map, Map)    PortalLoginModule.java    portal/portal-kernel/src/com/liferay/portal/kernel/security/jaas    line 39    Java Problem
The method getGroups(long, LdapContext, int, String, String) is undefined for the type PortalLDAPUtil    PortalLDAPUtil.java    portal/portal-impl/src/com/liferay/portal/security/ldap    line 380    Java Problem
The method getGroups(long, LdapContext, int) is undefined for the type PortalLDAPUtil    PortalLDAPUtil.java    portal/portal-impl/src/com/liferay/portal/security/ldap    line 576    Java Problem
The method getUsers(long, LdapContext, int, String, String) is undefined for the type PortalLDAPUtil    PortalLDAPUtil.java    portal/portal-impl/src/com/liferay/portal/security/ldap    line 505    Java Problem
The method getUsers(long, LdapContext, int) is undefined for the type PortalLDAPUtil    PortalLDAPUtil.java    portal/portal-impl/src/com/liferay/portal/security/ldap    line 558    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <? extends Attribute>    PortalLDAPUtil.java    portal/portal-impl/src/com/liferay/portal/security/ldap    line 1055    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <SearchResult>    PortalLDAPUtil.java    portal/portal-impl/src/com/liferay/portal/security/ldap    line 371    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <SearchResult>    PortalLDAPUtil.java    portal/portal-impl/src/com/liferay/portal/security/ldap    line 383    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <SearchResult>    PortalLDAPUtil.java    portal/portal-impl/src/com/liferay/portal/security/ldap    line 419    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <SearchResult>    PortalLDAPUtil.java    portal/portal-impl/src/com/liferay/portal/security/ldap    line 496    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <SearchResult>    PortalLDAPUtil.java    portal/portal-impl/src/com/liferay/portal/security/ldap    line 508    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <SearchResult>    PortalLDAPUtil.java    portal/portal-impl/src/com/liferay/portal/security/ldap    line 558    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <SearchResult>    PortalLDAPUtil.java    portal/portal-impl/src/com/liferay/portal/security/ldap    line 576    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <SearchResult>    LDAPAuth.java    portal/portal-impl/src/com/liferay/portal/security/auth    line 165    Java Problem
The type DummyDirContext must implement the inherited abstract method DirContext.search(Name, Attributes, String[])    DummyDirContext.java    portal/util-java/src/com/liferay/util/ldap    line 38    Java Problem
The type DummyDirContext must implement the inherited abstract method DirContext.search(Name, Attributes)    DummyDirContext.java    portal/util-java/src/com/liferay/util/ldap    line 38    Java Problem
The type DummyDirContext must implement the inherited abstract method DirContext.search(Name, String, Object[], SearchControls)    DummyDirContext.java    portal/util-java/src/com/liferay/util/ldap    line 38    Java Problem
The type DummyDirContext must implement the inherited abstract method DirContext.search(Name, String, SearchControls)    DummyDirContext.java    portal/util-java/src/com/liferay/util/ldap    line 38    Java Problem
The type DummyDirContext must implement the inherited abstract method DirContext.search(String, Attributes, String[])    DummyDirContext.java    portal/util-java/src/com/liferay/util/ldap    line 38    Java Problem
The type DummyDirContext must implement the inherited abstract method DirContext.search(String, Attributes)    DummyDirContext.java    portal/util-java/src/com/liferay/util/ldap    line 38    Java Problem
The type DummyDirContext must implement the inherited abstract method DirContext.search(String, String, Object[], SearchControls)    DummyDirContext.java    portal/util-java/src/com/liferay/util/ldap    line 38    Java Problem
The type DummyDirContext must implement the inherited abstract method DirContext.search(String, String, SearchControls)    DummyDirContext.java    portal/util-java/src/com/liferay/util/ldap    line 38    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <SearchResult>    DummyDirContext.java    portal/util-java/src/com/liferay/util/ldap    line 142    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <SearchResult>    DummyDirContext.java    portal/util-java/src/com/liferay/util/ldap    line 150    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <SearchResult>    DummyDirContext.java    portal/util-java/src/com/liferay/util/ldap    line 158    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <SearchResult>    DummyDirContext.java    portal/util-java/src/com/liferay/util/ldap    line 165    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <SearchResult>    DummyDirContext.java    portal/util-java/src/com/liferay/util/ldap    line 172    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <SearchResult>    DummyDirContext.java    portal/util-java/src/com/liferay/util/ldap    line 179    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <SearchResult>    DummyDirContext.java    portal/util-java/src/com/liferay/util/ldap    line 186    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <SearchResult>    DummyDirContext.java    portal/util-java/src/com/liferay/util/ldap    line 194    Java Problem
The type DummyContext must implement the inherited abstract method Context.list(Name)    DummyContext.java    portal/util-java/src/com/liferay/util/ldap    line 39    Java Problem
The type DummyContext must implement the inherited abstract method Context.list(String)    DummyContext.java    portal/util-java/src/com/liferay/util/ldap    line 39    Java Problem
The type DummyContext must implement the inherited abstract method Context.listBindings(Name)    DummyContext.java    portal/util-java/src/com/liferay/util/ldap    line 39    Java Problem
The type DummyContext must implement the inherited abstract method Context.listBindings(String)    DummyContext.java    portal/util-java/src/com/liferay/util/ldap    line 39    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <Binding>    DummyContext.java    portal/util-java/src/com/liferay/util/ldap    line 113    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <Binding>    DummyContext.java    portal/util-java/src/com/liferay/util/ldap    line 119    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <NameClassPair>    DummyContext.java    portal/util-java/src/com/liferay/util/ldap    line 101    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <NameClassPair>    DummyContext.java    portal/util-java/src/com/liferay/util/ldap    line 107    Java Problem
The type NamingEnumeration is not generic; it cannot be parameterized with arguments <SearchResult>    CASAutoLogin.java    portal/portal-impl/src/com/liferay/portal/security/auth    line 152    Java Problem
Name clash: The method initialize(Subject, CallbackHandler, Map<String,?>, Map<String,?>) of type BasicLoginModule has the same erasure as initialize(Subject, CallbackHandler, Map, Map) of type LoginModule but does not override it    BasicLoginModule.java    portal/portal-impl/src/com/liferay/portal/security/jaas/ext    line 67    Java Problem
The type BasicLoginModule must implement the inherited abstract method LoginModule.initialize(Subject, CallbackHandler, Map, Map)    BasicLoginModule.java    portal/portal-impl/src/com/liferay/portal/security/jaas/ext    line 50    Java Problem
DW
Dave Willis, modified 9 Years ago.

RE: Portal project has errors in Eclipse

Expert Posts: 301 Join Date: 7/13/09 Recent Posts
I think there must be some kind of pathing issue or something going on. I've got portal, ext and plugins in a folder called Sites that is not under eclipse's workspace folder. I know when you use the workspace folder you have to take plugins out of it because Eclipse doesn't like it when you use a sub folder as a project but I don't think that should be a problem here. Not positive though.
Wilson Man, modified 9 Years ago.

RE: Portal project has errors in Eclipse

LIFERAY STAFF Liferay Master Posts: 581 Join Date: 6/21/06 Recent Posts
hey Dave,

the way i set it up is to add each plugin project by itself ... and not the entire plugins folder as one project. For example, if i create a portlet plugin and called it my-first-portlet, i add that directly as a project ... along with EXT and portal and have my-first-portlet's build path reference ext and portal.
DW
Dave Willis, modified 9 Years ago.

RE: Portal project has errors in Eclipse

Expert Posts: 301 Join Date: 7/13/09 Recent Posts
Yeah, that's the way I have mine set up as well. There's something not right about the way I've got portal set up though. I just have no idea what it might be.
-Dave
Wilson Man, modified 9 Years ago.

RE: Portal project has errors in Eclipse

LIFERAY STAFF Liferay Master Posts: 581 Join Date: 6/21/06 Recent Posts
yeah, I'm using OS X and have everything setup pretty smoothly. I'll try to add some of this info on wiki when i get a chance, though i'm currently quite loaded with work ...
DW
Dave Willis, modified 9 Years ago.

RE: Portal project has errors in Eclipse

Expert Posts: 301 Join Date: 7/13/09 Recent Posts
Anybody perchance know what might be causing portal to return all these errors?
Wilson Man, modified 9 Years ago.

RE: Portal project has errors in Eclipse

LIFERAY STAFF Liferay Master Posts: 581 Join Date: 6/21/06 Recent Posts
hey Dave, sorry, doesn't look i have time to wiki what you need in the near future. But if no one else is replying to your thread, maybe you can do a brief/high level outline to how you've setup your env and i can do a sanity check for you here ...
DW
Dave Willis, modified 9 Years ago.

RE: Portal project has errors in Eclipse

Expert Posts: 301 Join Date: 7/13/09 Recent Posts
Here's how my environment is set up:
I have ext, plugins and portal all under User/Sites/project_name instead of in the Eclipse workspace because of the way Eclipse won't let you create a project from a folder that isn't in the workspace root, i.e. portlets/portlet_name. Tomcat is also located in User/Sites. I have created new projects for portal, ext and my portlet. My portlet references ext and portal on the Projects tab under Java Build Path.
Zsolt Balogh, modified 9 Years ago.

RE: Portal project has errors in Eclipse

LIFERAY STAFF Expert Posts: 463 Join Date: 3/23/09 Recent Posts
It looks like, that your Eclipse is using the classes from the portal/development/lib/jndi.jar not from the jdk. The jdni.jar is old.

I think, that this resource is before the JDK libs in your classpath, I think you can just remove it from the library list.

Why does Liferay have the jndi.jar in the sources? I think it should be removed...
DW
Dave Willis, modified 9 Years ago.

RE: Portal project has errors in Eclipse

Expert Posts: 301 Join Date: 7/13/09 Recent Posts
You were right. It was using jndi.jar. I removed it and that took care of the majority of the errors. There's still a few left though:


Description    Resource    Path    Location    Type
XMLConstants.NULL_NS_URI cannot be resolved    PortletAppImpl.java    portal/portal-impl/src/com/liferay/portal/model/impl    line 179    Java Problem
Name clash: The method initialize(Subject, CallbackHandler, Map<String,?>, Map<String,?>) of type PortalLoginModule has the same erasure as initialize(Subject, CallbackHandler, Map, Map) of type LoginModule but does not override it    PortalLoginModule.java    portal/portal-impl/src/com/liferay/portal/security/jaas    line 100    Java Problem
The type PortalLoginModule must implement the inherited abstract method LoginModule.initialize(Subject, CallbackHandler, Map, Map)    PortalLoginModule.java    portal/portal-impl/src/com/liferay/portal/security/jaas    line 41    Java Problem
Name clash: The method initialize(Subject, CallbackHandler, Map<String,?>, Map<String,?>) of type BasicLoginModule has the same erasure as initialize(Subject, CallbackHandler, Map, Map) of type LoginModule but does not override it    BasicLoginModule.java    portal/portal-impl/src/com/liferay/portal/security/jaas/ext    line 67    Java Problem
The type BasicLoginModule must implement the inherited abstract method LoginModule.initialize(Subject, CallbackHandler, Map, Map)    BasicLoginModule.java    portal/portal-impl/src/com/liferay/portal/security/jaas/ext    line 50    Java Problem
XMLConstants.NULL_NS_URI cannot be resolved    StateAwareResponseImpl.java    portal/portal-impl/src/com/liferay/portlet    line 62    Java Problem
Name clash: The method initialize(Subject, CallbackHandler, Map<String,?>, Map<String,?>) of type PortalLoginModule has the same erasure as initialize(Subject, CallbackHandler, Map, Map) of type LoginModule but does not override it    PortalLoginModule.java    portal/portal-kernel/src/com/liferay/portal/kernel/security/jaas    line 61    Java Problem
The type PortalLoginModule must implement the inherited abstract method LoginModule.initialize(Subject, CallbackHandler, Map, Map)    PortalLoginModule.java    portal/portal-kernel/src/com/liferay/portal/kernel/security/jaas    line 39    Java Problem
DW
Dave Willis, modified 9 Years ago.

RE: Portal project has errors in Eclipse

Expert Posts: 301 Join Date: 7/13/09 Recent Posts
So, anyone have any idea what might be causing the remaining errors? As I mentioned, I know there's nothing wrong with portal because it's a stable version of Liferay that I downloaded the from repository so there has to be something wrong with my setup. I just don't know what.
Zsolt Balogh, modified 9 Years ago.

RE: Portal project has errors in Eclipse

LIFERAY STAFF Expert Posts: 463 Join Date: 3/23/09 Recent Posts
As I told before, you have wrong order of your libraries, so the libs in the jdk will load after the jars in the lib dirs. I could reproduce some of your errors.

Click on the projects build path, then choose Order and Export. Then put the SDK right after the folders.
DW
Dave Willis, modified 9 Years ago.

RE: Portal project has errors in Eclipse

Expert Posts: 301 Join Date: 7/13/09 Recent Posts
I must be misunderstanding you. I thought originally you said to remove jndi.jar entirely, so I did and that fixed all but six or so of the errors. I have now added it back and moved it to the top of the list right beneath the folders on the order and export tab but all the original errors are still there.
Zsolt Balogh, modified 9 Years ago.

RE: Portal project has errors in Eclipse

LIFERAY STAFF Expert Posts: 463 Join Date: 3/23/09 Recent Posts
I meant not the jdni.jar this time, just the Java JDK. Sorry, if I was ambiguous.

I've attached a screenshot which contains underlined what I think would fix your errors. (If I moved it down, I got your errors).

Another solution is that you remove the .classpath file from your project and update the whole project.
DW
Dave Willis, modified 9 Years ago.

RE: Portal project has errors in Eclipse

Expert Posts: 301 Join Date: 7/13/09 Recent Posts
Yes! Now I understand. I did what you suggested and that fixed all the errors. Thanks!
RS
Riccardo Sabatiello, modified 6 Years ago.

RE: Portal project has errors in Eclipse

New Member Posts: 3 Join Date: 12/13/11 Recent Posts
Zsolt Balogh:
I meant not the jdni.jar this time, just the Java JDK. Sorry, if I was ambiguous.

I've attached a screenshot which contains underlined what I think would fix your errors. (If I moved it down, I got your errors).

Another solution is that you remove the .classpath file from your project and update the whole project.


Ok, this work. Thanks