- This topic has 7 replies, 3 voices, and was last updated 10 years, 12 months ago by support-tony.
-
AuthorPosts
-
minhurMemberThis has been a blocker for us in our development, so please help us address the issue.
So far it’s been happening only on MACs, so I think it might be an issue in MyEclipse 2014
To replicate, first create a java project and add some classes to it.
Then create a web project, change it’s build-path to add the previous created java project.
create a servlet in the web project that uses one of the class from the imported project by build path.
deploy the web app and hit the servlet, it throws a classnotfound error even though open declaration from source does point to the correct class that’s in the separate project.
This used to work fine in 10.7 and 2013, but it’s not working for us in 2014.
Odd thing is, the same code under windows works fine.
minhurMemberBetter Replication steps:
– Create a new Java Project called hello
– Create a new Class in project foo called Test with a method foo– Create a new Web Project called web
– Add project hello to the build path of of project web
– Create a new Servlet called web.HelloWorld
– In HelloWorld servelet, call Test.foo that is imported from project hello– Deploy the project ‘web’ to Tomcat
– Right click on deployed app, browse deployment location
– WEB-INF/classes does not have folder “hello”
– On start of server you get ClassNotFound errorI tried doing the exact same thing on 10.7 and 2013, and they both work fine.
Attachments:
You must be logged in to view attached files.
minhurMemberI’ve been uninstalling and reinstalling each versions of my eclipse with default settings between 10.7, 2013, 2014
10.7 doesn’t seem to have this issue but 2013/2014 does.
On 10.7 I see in settings, a Deployment tab that shows settings related to this, but I can’t find similar settings on 2013/2014
2013/2014 has the same issue when creating a fresh web project + java project.
also, This seems to be happening on MACs so it might be OS specific.
I haven’t tested throughly but my colleague using 2014 under windows doesn’t seem to have the issue.
Attachments:
You must be logged in to view attached files.
support-pradeepMemberminhur,
In MyEclipse 2013 and 2014 versions, deployment of applications is transparently handled through the Deployment Assembly mechanism. Use the project’s deployment assembly property page to precisely control the deployment of your project’s resources if you need more control. Right click on your project and navigate to Properties > MyEclipse > Deployment Assembly page.
In your case, right click on the web project and navigate to Properties > MyEclipse > Deployment Assembly > Click on Add > Select Project and click Next > Select the java project and click Finish > Click Apply and Ok. After adding the project to the deployment assembly, redeploy the project and you will find the ‘Hello’ folder under <Deploy location>/WEB-INF/classes folder.
Let us know how it works for you.
minhurMemberthanks, that does solve the issue on all OS.
I’m curious as to why not just add the required project to the deployment assembly automatically?
I mean if i’m going to defined a project that requires other projects, I’m pretty sure it’s safe to assume I want the required projects deployed as well.
support-tonyKeymasterminhur,
The change to using deployment assembly exclusively perhaps wasn’t documented that well but you will find the change in the “MyEclipse: Changes Starting in 2013” section of the help. There is also a section on how the Deployment Assembly works (linked from the changes section), though the description of how it works in web projects is a bit difficult to see. A better explanation is probably given in the Web Project tutorial.
Basically, to add a project dependency to a (non-maven) web project, add it using the Deployment Assembly page previously mentioned. This will also add it to the build path, via the Web App Libraries container in the build path (that is, you won’t see it in the Projects tab, of the build path configuration, but on the Libraries tab, under the Web App Libraries entry).
We will be investigating whether it’s possible to have project dependencies that are added to the build path explicitly also added to the deployment assembly but this may not be possible.
I hope this helps explain the situation a little better.
minhurMemberI would like to add to the issue here.
Whenever the a required project gets an update by SVN update, it ends up getting removed from Deployment Assembly of the project that needs it.So let’s say I have project Web that requires project Core
I set the build path and deployment assembly and all works fine.
Once I do an svn up on Core and Web, and if Core project has changes, it seems to remove the Deployment Assembly setting from project Web.
I have to go back to properties and add project Core again from project Web
In general this still feels like a bug to me, and what I’m doing feels more like a workaround to a bug rather than a feature.
Previously I didn’t have to do anything except require another project in build path, but now I have to check deployment assembly everytime I do an svn update (which I do daily)
support-tonyKeymasterminhur,
I’m afraid I couldn’t replicate your issue as you described it. However, if another Java project, that isn’t yet defined as a utility project, is added to the deployment assembly, then changes will be made to some settings of the utility project. If the utility project is reverted, thus removing the settings changes, then the deployment assembly can’t identify the project properly and it will have to be removed and re-added to the deployment assembly.
So the settings changes made, when the utility project is added to a deployment assembly for the first time, need to be committed to SVN.
The only time I could get the utility project to completely disappear from the deployment assembly is if I delete the utility project (provided it is defined as a utility project at the time).
If these are not the symptoms you’re seeing, could you detail the type of project being added to the deployment assembly and how you are updating it from SVN? That might help us replicate your situation.
Sorry for the inconvenience.
-
AuthorPosts