0

I am building a web application with JSF 2.2, Hibernate, Primefaces and Tomcat. Since I'm having now two customers, who both want the same application but with some minor differences in UI and stuff, I decided to split the project into a core project, where all my Java Code lies in and two DynamicWebProjects, which depend on that core. What I did was the following:

*created a regular project in Eclipse and put all my Java classes including beans, filters, etc. there (Imported all necessary libraries such as primefaces, hibernate, jpa, etc. via buildpath)

*created two DynamicWebProjects and included the core project as described in Eclipse Web-App Deployment with Tomcat: Providing multiple projects' dependencies?

*copied the web.xml from the previous "complete" project and just changed the display-name tag

Now, when I run both applications, I get some weird behaviour:

*The starting page (login.xhtml) is shown but without any ressources being loaded. Neither css nor any image nor even primefaces components.

*When I try to login and call loginBean.login() I got the error: target unreachable, identifier 'loginbean' resolved to null. Note, that my beans are just declared as such by annotations. So I tried to declare them in the faces-config.xml in each web project and the error was gone. But unfortunately, this has led to other errors, for instance: Error while running query: No query defined for that name [User.findUserByEmail] which is also defined via annotation in a core class.

*Even navigation is not working anymore.

I assume, that somehow due to just importing the core project, annotations are being ignored. But I really don't want to define everything in an .xml-file.

Of course I read through different threads here on Stackoverflow, but none of them seem to fit my problem, since I haven't changed anything in the code and it was running perfectly fine, when I had everything just in one single project. Also the core project seems to be imported fine, since I can access core classes without troubles. Any clues on how to fix that? Maybe I should also state, that I am very new to the whole JEE thing, so let me know, if I am missing something essential.

Thanks in advance

Community
  • 1
  • 1
JohnPlata
  • 185
  • 2
  • 11
  • Thanks for providing the link for the possible duplicate. But my problem still exists and is slightly different, since I don't have shared ressources but shared Java code. In the core project I only have Java Code without any css, img, xhtml or anything else. I added the faces-config.xml to the core project, but still annotations are being ignored. – JohnPlata Feb 09 '16 at 14:27
  • Edit: I think I know the problem. When I add the core project to the deployment assembly, it does not appear in WEB-INF/lib folder, although it does appear in Libraries/Web App Libraries, but only as "a project" and not as a jar. – JohnPlata Feb 09 '16 at 14:35

0 Answers0