- This topic has 15 replies, 4 voices, and was last updated 18 years, 11 months ago by Aidan Hughes.
-
AuthorPosts
-
Aidan HughesMemberHi,
I’ve been using eclipse for some time and have just started with My Eclipse.
I have Eclipse v 3.1.1, My Eclipse 4.0.1.First, it takes ages to start MyEclipse – up to 2 minutes on a 2.8 GHz Dell.
Is this normal?Secondly, when opening an XML file (960 lines) with the My Eclipse editor, everything hangs and I eventually have to close eclipse through task manager.
Thirdly, if I make any change to a JSP, when I save it, the application tries to build the workspace and only ever gets to 66% – it never finishes and thus never saves the file.
I’ve reinsalled both eclipse and My Eclipse now several times, and also used different workspaces etc.
What am I doing wrong?
Thanks,
Aidan.
Scott AndersonParticipantAidan,
To me it sounds like the issue might be either the JDK you’re using to launch Eclipse or the memory arguments you’re giving or not giving it. Please try launching with the following arguments:
eclipse.exe -vmargs -Duser.language=en -Xms128M -Xmx512M -XX:PermSize=64M -XX:MaxPermSize=128M
Riyad KallaMemberAidan,
In addition to what Scott mentioned, what you are experiencing is definately not the correct behavior, this certainly sounds like an installation problem. If trying the new arguments doesn’t help try the following “sanity check” (and please follow these steps to a T, even though you may be tempted to short cut out of frustration, it will help us figure out why this is acting to strangely)1) Redownload Eclipse 3.1.1 SDK from eclipse.org, unzip it to a new location e.g.: C:\Java\eclipse-3.1
2) Redownload MyEclipse 4.0.3 from our site, install it to a new location and point it at your new install in C:\Java\eclipse-3.1
3) Start up the new install of MyEclipse (C:\Java\eclipse-3.1\eclipse.exe) and create a new workspace, don’t use an existing one
4) Now create a new Web Project, and a new JSP file in the WebRoot dir, and open it and try editing it/saving it/etc… is it working? Try doing the same with the web.xml file. Working?If so, try and import your project from your old workspace that was acting weird using File > Import
Aidan HughesMemberHi again.
I’ve had some sucess. Scott – the arguments helped – it is now starting much quicker and is generally more responsive, but the problems with the XML and jsp files still occur.
rkalla,
I’ve followed your instructions to a T.
Yes I can create a JSP and edit it and it will save.
Similarly, the XML file is OK.When I import my existing project (either copying into the workspace or referencing it to it’s existing location) I still have the same problems.
The main problem seems to be rebuilding the workspace – the progress bar never gets beyond 66% (and I have waited up to 30 minutes with no further progress). This blocks all other actions including saving, deleting, etc, and effects JSPs, servlets, etc.
I can use the XML editor to edit various other XML files in my project, but my web.xml file is much larger than the others (960 lines) and eclipse hangs when I try to edit it. It will open in the text editor.
I should add that this is a live project and I have a version in production.
The XML file does not fully validate – all elements in it are OK – I have one error ref the web-app element – there are a number of elements missing. However, I would not expect this to prevent editing?
Also, the project is v2.3, not 2.4 so the XML file is based on Sun’s web-app_2_3 DTD.
Again I would not have expected this to cause these problems.When I uninstall My Eclipse and go back to plain eclipse with a couple of open-source editor plugins there are no problems with the project. I therefore suspect that there is no major corruption in the project files.
I’m at a loss – do you have any suggestions.
Aidan.
Riyad KallaMemberThe XML file does not fully validate – all elements in it are OK – I have one error ref the web-app element – there are a number of elements missing. However, I would not expect this to prevent editing?
You are correct, it shouldn’t. It should be acting exactly as the Java editor does, marks errors, helps you edit, etc.
Also, the project is v2.3, not 2.4 so the XML file is based on Sun’s web-app_2_3 DTD.
If you go to your Navigator view and open your .mymetadata file, what J2EE spec version is set, it should be 1.3, is it 1.4 by chance? Our default Web Capabilities wizard adds 1.4 unless you specify 1.3, so I wonder if this is part of the problem…
When I uninstall My Eclipse and go back to plain eclipse with a couple of open-source editor plugins there are no problems with the project. I therefore suspect that there is no major corruption in the project files.
No worries this just sounds like some MyEclipse settings getting confused. Is this infact a web project, or is this a normal java project that you are editing with MyEclipse installed? Have you tried adding Web Capabilities to it if it is a Java project? (this is how MyEclipse resolves resources)
Aidan HughesMemberrkalla,
I don’t seem to have a .mymetadata file. There is a .metadata folder with a plugins folder, a .lock file and a version.ini file. There are also .classpath and .project files in the root directory. I can’t find any reference to the J2EE version in any of these.
The versions 2.3 and 2.4 I quote above I believe are the Servlet specification versions – I’m not sure how these relate to the J2EE spec version. My Java version is j2sdk1.4.2_05. I had been using eclipse 3.0, but upgraded to eclipse 3.1 recently. I’m not having problems with the project in either basic eclipse version.
It is a web project, although the layout is not exactly as a new MyEclipse web project. I have a WEB-INF folder with classes, src lib and tld folders and also the web.xml file. My jsps are in a JSP folder in the root, my servlets are in the src sub-folder. I have no EJBs etc – and I’m using Tomcat 5 as my web container. The Add Web Capabilities command is greyed out, so I assume MyEclipse is aready recognising it as a web project.
Still stuck ! !
Thanks,
Aidan
Riyad KallaMemberI don’t seem to have a .mymetadata file. There is a .metadata folder with a plugins folder, a .lock file and a version.ini file. There are also .classpath and .project files in the root directory. I can’t find any reference to the J2EE version in any of these.
You will only have that file if this is a web project or you have added Web Capabilities to an existing Java project. It seems this is still a plain Java Project.
The versions 2.3 and 2.4 I quote above I believe are the Servlet specification versions – I’m not sure how these relate to the J2EE spec version. My Java version is j2sdk1.4.2_05. I had been using eclipse 3.0, but upgraded to eclipse 3.1 recently. I’m not having problems with the project in either basic eclipse version.
J2EE specs are blanket specs, they include sub-specs. The Servlet 2.3 spec was part of the J2EE 1.3 spec, and 2.4 for 1.4, etc. That is how the versions tie together.
It is a web project, although the layout is not exactly as a new MyEclipse web project. I have a WEB-INF folder with classes, src lib and tld folders and also the web.xml file. My jsps are in a JSP folder in the root, my servlets are in the src sub-folder. I have no EJBs etc – and I’m using Tomcat 5 as my web container. The Add Web Capabilities command is greyed out, so I assume MyEclipse is aready recognising it as a web project.
Actually, if it recognized it as a web project already the Add web caps should be gone, not grayed out. Try and open the project properties, do you see preferences for “MyEclipse-Web”, if not, then it’s a Java project.
Can you type out your project layout showing proper nesting and indentation of folders? I can walk you through adding web caps then.
Also be sure to wrap your layout in code tags (use code button below) so the formatting is preserved.
Aidan HughesMemberHi again.
I’ve looked at the project properties – you’re right, there are no MyEclipse-Web preferences.
Also, today the Add WebProject Capabilities is available – I must have been looking at it with the wrong object highlighted.My folders etc. are shown below:
OpCAB |--WEB-INF/src | |--Various packages (servlets and other Java code) | |--JRE System Library [j2sdk1.4.2_05] |--jsp-api.jar - c:\tomcat50\common\lib |--servlet-api.jar - |--mail.jar |--activation.jar |--mssqlserver.jar (SQL Server JDBC driver) |--msbase.jar |--msutil.jar | |--css | |--casc style sheet.css | |--images | |--various images etc | |--js | |--various javascript files | |--jsp | |--various JSP files in various folders | |--META-INF | |--context.xml (for Tomcat5) | |--WEB-INF |--lib | |--jstl.jar | |--standard.jar | |--tlds | |--c.tld | |--fmt.tld | |--sql.tld | |--xml.tld | |--build.xml (ANT build file) |--web.xml
Thanks for sticking with me on this one!
Aidan.
GregMemberResponse from Riyad:
@support-rkalla wrote:The absolute easiest way to get this project into a Web Project would
be to create a new Web Project, and drag and drop all the files from
your project into the WebRoot dir of the web project. Right now your
project is organized exactly like a Web Project except you have the
root of the project as the WebRoot folder.Here is an example of an easy to work with layout:
http://www.myeclipseide.com/FAQ+index-myfaq-yes-id_cat-30.html#111notice how you have this almost exactly already? You just need to put
everything into a WebRoot folder and then move your WEB-INF/src dir
out into the top level Project folder.Now, in case you can’t do all that, try and add web caps and use the
following settings:
Web Root Directory: /
Web Context Root: /<whatever you want>
Create web.xml: <UNCHECK THIS>J2EE Spec Level: <CHOOSE ONE THAT APPLIES>
Add J2EE Libs to Buildpath: <LEAVE THIS CHECKED>now Hit Finish. Your output dir will be created: /WEB-INF/classes and
your WEB-INF/src dir should be compiled into it.Did this work?
Aidan HughesMemberHi again.
Sorry for the delay – I’ve been on leave since my last post.
First, I installed ME on my home PC to try it out – everything worked fine, even without conversion to a web project.
However, my home PC is better than my work PC (it has to be for games!)
I uninstalled and forgot about it until I started back to work again this morning (well – I was on vacation!)Anyway, back to work and my problems.
I converted to a web project and this helped.
The workspace now builds correctly.
I can now save all my JSPs etc with no problems.
This did not, however, fix the problem with the web.XML file.I have managed to figure out what was going wrong.
My web.XML file was like this:<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> Rest of File ...... </web-app>
Opening this with the text editor worked, but the ME XML editor crashed ME.
I was suspicious of the DOCTYPE element being slit on two lines.
I changed it to the following with no line breaks on the DOCTYPE line element.<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> Rest of File ...... </web-app>
The ME XML editor now works with no problems!
I’m now happy that I’m up and running and can start to explore My Eclipse properly.
My only question now is – why did it work on my home PC without this change?Thanks all for all your help on this.
Aidan.
Riyad KallaMemberAidan,
Did you try comparing the Build IDs between Eclipse/MyEclipse between home and work? Maybe there is a plugin conflict somewhere?
Aidan HughesMemberrkalla,
Both were clean installs of eclipse and my-eclipse from the same install files on my USB key.
Aidan.
Riyad KallaMemberWhat about JDK versions?
java -version
Aidan HughesMemberBoth the same again – j2sdk1.4.2_05 – I have my J2EE standard build software packs and documentation burnt on one CD so I know I’ve always the same standard between the different PCs I end up using. The latest version of Eclipse and My Eclipse arn’t on there yet as I’m still deciding about them.
Aidan.
Riyad KallaMemberAidan,
I’m sorry without sitting down at the work machine and trying things like a new project, new workspace and then eventually a fresh install it is impossible for me to say why one worked right out of the gates and another didn’t. The variables involved here are big enough that it’s not impossible to think of a situation where a piece of software as complex as these may behave slightly differently in one case an not the other.I am atleast glad it is working now. If you really wanted to dig down and figure out what was going on, you could try what I suggested about a new project, and lastly a new workspace (File> Switch Workspace) to see if the behavior then worked right away on your work machine. My money would be on the workspace, and if not that, a clean install; but that is only for testing, as you mentioned things are working now.
-
AuthorPosts