- This topic has 7 replies, 3 voices, and was last updated 15 years, 10 months ago by Loyal Water.
-
AuthorPosts
-
fworsleyMemberI just upgraded to MyEclipse 7.0 and am setting up a new web project from scratch. It is a Maven WAR project using Seam, Icefaces and Hibernate. I created the project as a Web project in MyEclipse, then I created the POM file by hand and enabled the Maven functionality inside of MyEclipse.
The problem is that when I deploy the project to Tomcat 6, only one class file is copied to the Tomcat WEB-INF/classes folder. The other class files are not being copied. I checked the target/classes folder and all files are in there. They are just not being copied to Tomcat for some reason.
I have tried everything I can think of: refreshing, cleaning, close/reopen, remove/redeploy and cannot get this to work. Has anyone else had this problem? Nothing shows up in the MyEclipse error log.
Another project that was already in my workspace (previously created in MyEclipse 6.0.1) is deploying without problems. It does not make use of the Maven functionality.
Loyal WaterMemberCan you switch to a new workspace, create a new webproject and test if the problem can be re-created.
Can you go to MyEclipse > Installation Summary > Installation Details and paste the information here for me.
fworsleyMemberI created a new workspace folder and copied my project to it. Then I deleted all Eclipse settings files from my project, started MyEclipse and switched to the workspace.
I re-created the project in the workspace, right-clicked on the existing pom.xml and enabled the Maven functionality. Maven dependencies were added and all build errors disappeared from the problem view. Then I deployed the app. This time MyEclipse correctly deployed the app to Tomcat.
However during startup the following JSF exception is thrown:
SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED!
Source Document: jndi:/localhost/assets/WEB-INF/faces-config.xml
Cause: Class ‘com.assets.view.AssetsViewHandler’ is missing a runtime dependency: java.lang.NoClassDefFoundError: D2DSeamFaceletViewHandlerOk, so I did a “mvn clean install” from the command line and deployed the resulting WAR. No problem.
I then compared the MyEclipse deployed files with the files inside the Maven produced WAR file.
The difference was in file size for the actual compiled class files. Looking at the contents of the MyEclipse deployed AssetsViewHandler.class file with a text editor I see this:
[grabage] com/assets/view/AssetsViewHandler [garbage] Unresolved compilation problems:
The import org.jboss cannot be resolved
The import org.jboss cannot be resolved
The import com.icesoft cannot be resolved
D2DSeamFaceletViewHandler cannot be resolved to a type
The method calculateLocale(FacesContext) of type AssetsViewHandler must override a superclass method
LocaleSelector cannot be resolved to a type
LocaleSelector cannot be resolved to a type
Contexts cannot be resolvedTurns out it is an old class file that was deployed from the “src/main/webapp/WEB-INF/classes” folder. I had previously set “src/main/webapp” as the web root for the project and that is from where MyEclipse copies deployed files.
In the end I had to modify the project build path to specify the default output folder of “src/main/webapp/WEB-INF/classes” and now it works correctly. The Maven integration messes up the build path entries so that it no longer works for web project deployment. Very annoying that the Maven integration modifies the build path entries in such a way that they no longer work for web projects.
On another note, it would be really helpful if MyEclipse didn’t overwrite my existing web.xml and index.jsp files with default files whenever I create a new web project that already has these files on disk.
Loyal WaterMemberOn another note, it would be really helpful if MyEclipse didn’t overwrite my existing web.xml and index.jsp files with default files whenever I create a new web project that already has these files on disk.
I’ll make a note of this request. Thank you for your feedback.
rcoe67MemberI have a related problem but not specifically with Maven. I have a web project that exports it’s libraries and dependent projects but the class files from those exported, dependent projects are not deployed. They used to be but no longer. Redeploying the app doesn’t work, nor does cleaning the project. I override the workspace settings so that my jars are not deployed but my user libraries and dependent projects are. Nothing has changed in my environment. I discovered this problem after I changed code in one of the dependent projects and that code never got deployed.
I am currently evaluating myEclipse for my company and have less than 2 weeks to decide whether we should get subscriptions for all the members of my team. We work from a single, shared installation of eclipse running on Linux but keep our own workspaces. Because of this setup, I need to carefully evaluate whether the product is stable enough that I don’t need to perform updates to eclipse or in any way add to developer-grief by installing a plug-in that isn’t rock-solid.
I am using eclipse 3.3.2 and myEclipse 6.6 on CentOS 5 with Java 6 and an external installation of Tomcat, also running from a single shared installation but using a Catalina_base relative to my home directory.
Thanks.
Loyal WaterMemberHave you tried using the -clean command to try and fix this issue. Does that help?
https://www.genuitec.com/forums/topic/troubleshoot-using-the-clean-command-line-argument/
rcoe67MemberYes and it doesn’t seem to work. Also, Thanks for the quick response.
I did take a closer look at all the deployed class folders and it seems the first dependent project has its class files deployed but the class files for its dependent projects aren’t deployed. To be more clear, I have a single webapp that has a dependent java project and that project has two dependent projects that each have at least one other project marked as dependent. All projects are set to export their dependent projects and user libraries, so my webapp project has only a single user library but uses the exported libraries from all the dependent projects. All those jars are correctly deployed to WEB-INF/lib, it’s just the class files that are not deployed to WEB-INF/classes.
Thanks.
Loyal WaterMemberrcoe67,
MyEclipse supports the deployment of the class files of only the dependent projects. You cannot have dependent projects for the dependent projects. The 2 level of dependency is not allowed. -
AuthorPosts