facebook

JSP Code Assist Not Working

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 15 posts - 1 through 15 (of 29 total)
  • Author
    Posts
  • #256461 Reply

    ethomp01
    Member

    I just downloaded and installed Eclipse 3.2 and MyEclipse 5.0 GA, and I now have problems with the JSP Content Assist with an existing code base. Whenever I try to use the content assist in the JSP, I receive the following message in red in the status bar, “Content Assist not available at the current location.”

    This used to work under the old versions I was using (Eclipse 3.1 and MyEclipse 4.0.3 GA), although the JSP Editor had other issues which were apparently fixed in the newer version (this is what prompted the upgrade).

    I believe that I have traced the issue to some <%@ include file…%> tags; there are some included pages which do not compile (for example, they rely on variables being set outside of their scope, but it all compiles fine when the code is inserted into the final page, or they are missing import statements which are present in the “parent” page). It seems that whenever I remove the <%@ include…%> tags, the code assist functionality starts working.

    As I mentioned above, this occurs in an existing code base, so I don’t really have the option of modifying the code to get around this.

    Is there any way I can force the MyEclipse validator to ignore these compile errors and still allow the code assist to work in the “parent” pages?

    Thanks,

    Rob

    #256578 Reply

    ethomp01
    Member

    I saw a post which suggested that I can rename the included files to a different name, such as .jspf in order to prevent them from being validated (http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-10594-highlight-path+include+project+resource+name.html). Rather than change a code, is there any way to tell the validator to ignore a certain set of files or folders?

    Thanks,

    Rob

    #256626 Reply

    ethomp01
    Member

    This appears to happen each time, no matter if the included file compiles or not.

    #256743 Reply

    ethomp01
    Member

    Content Assist was working in a new JSP for me, until I ran into a case where the delete key caused the editor to do some funky things. I restarted Eclipse, and now receive the “Content Assist not available” for this file.

    My error log now shows numerous errors as follows:
    eclipse.buildId=M20060629-1905
    java.version=1.5.0_05
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
    Framework arguments: -product com.genuitec.myeclipse.product.ide
    Command-line arguments: -data E:\eclipse_3_2\workspaces\Project -os win32 -ws win32 -arch x86 -product com.genuitec.myeclipse.product.ide
    This is a continuation of log file E:\eclipse_3_2\workspaces\Project\.metadata\.bak_0.log
    Created Time: 2006-08-14 13:15:50.810

    Error
    Mon Aug 14 13:17:39 CDT 2006
    Unhandled event loop exception

    eclipse.buildId=M20060629-1905
    java.version=1.5.0_05
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
    Framework arguments: -product com.genuitec.myeclipse.product.ide
    Command-line arguments: -data E:\eclipse_3_2\workspaces\Project -os win32 -ws win32 -arch x86 -product com.genuitec.myeclipse.product.ide
    This is a continuation of log file E:\eclipse_3_2\workspaces\Project\.metadata\.bak_0.log
    Created Time: 2006-08-14 13:15:50.810

    Error
    Mon Aug 14 13:17:39 CDT 2006
    Path must include project and resource name: /Project

    java.lang.IllegalArgumentException: Path must include project and resource name: /Project
    at org.eclipse.core.runtime.Assert.isLegal(Assert.java:62)
    at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:1565)
    at org.eclipse.core.internal.resources.Container.getFolder(Container.java:137)
    at com.genuitec.eclipse.core.util.Util.getFolder(Util.java:128)
    at com.genuitec.eclipse.j2eedt.core.WebProject.getWebRootFolder(Unknown Source)
    at com.genuitec.eclipse.j2eedt.core.MyEclipseWebProjectURIResolver.getLocationByURI(Unknown Source)
    at com.genuitec.eclipse.j2eedt.core.MyEclipseWebProjectURIResolver.getLocationByURI(Unknown Source)
    at org.eclipse.jst.jsp.core.internal.java.JSPTranslator.handleIncludeFile(JSPTranslator.java:1641)
    at org.eclipse.jst.jsp.core.internal.java.JSPTranslator.translateDirective(JSPTranslator.java:1494)
    at org.eclipse.jst.jsp.core.internal.java.JSPTranslator.translateJSPNode(JSPTranslator.java:1244)
    at org.eclipse.jst.jsp.core.internal.java.JSPTranslator.translateRegionContainer(JSPTranslator.java:847)
    at org.eclipse.jst.jsp.core.internal.java.JSPTranslator.translate(JSPTranslator.java:741)
    at org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter.getJSPTranslation(JSPTranslationAdapter.java:131)
    at org.eclipse.jst.jsp.ui.internal.hyperlink.JSPJavaHyperlinkDetector.getJSPTranslation(JSPJavaHyperlinkDetector.java:182)
    at org.eclipse.jst.jsp.ui.internal.hyperlink.JSPJavaHyperlinkDetector.detectHyperlinks(JSPJavaHyperlinkDetector.java:114)
    at org.eclipse.jface.text.hyperlink.HyperlinkManager.findHyperlinks(HyperlinkManager.java:238)
    at org.eclipse.jface.text.hyperlink.HyperlinkManager.mouseMove(HyperlinkManager.java:421)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:145)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
    at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
    at org.eclipse.core.launcher.Main.run(Main.java:977)
    at org.eclipse.core.launcher.Main.main(Main.java:952)

    eclipse.buildId=M20060629-1905
    java.version=1.5.0_05
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
    Framework arguments: -product com.genuitec.myeclipse.product.ide
    Command-line arguments: -data E:\eclipse_3_2\workspaces\Project -os win32 -ws win32 -arch x86 -product com.genuitec.myeclipse.product.ide
    This is a continuation of log file E:\eclipse_3_2\workspaces\Project\.metadata\.bak_0.log
    Created Time: 2006-08-14 13:15:50.810

    Error
    Mon Aug 14 13:31:37 CDT 2006
    JSPIndexer problem indexing:/Project/manager/orderDetail.jsp

    java.lang.IllegalArgumentException: Path must include project and resource name: /Project
    at org.eclipse.core.runtime.Assert.isLegal(Assert.java:62)
    at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:1565)
    at org.eclipse.core.internal.resources.Container.getFolder(Container.java:137)
    at com.genuitec.eclipse.core.util.Util.getFolder(Util.java:128)
    at com.genuitec.eclipse.j2eedt.core.WebProject.getWebRootFolder(Unknown Source)
    at com.genuitec.eclipse.j2eedt.core.MyEclipseWebProjectURIResolver.getLocationByURI(Unknown Source)
    at com.genuitec.eclipse.j2eedt.core.MyEclipseWebProjectURIResolver.getLocationByURI(Unknown Source)
    at org.eclipse.jst.jsp.core.internal.java.JSPTranslator.handleIncludeFile(JSPTranslator.java:1641)
    at org.eclipse.jst.jsp.core.internal.java.JSPTranslator.translateDirective(JSPTranslator.java:1494)
    at org.eclipse.jst.jsp.core.internal.java.JSPTranslator.translateJSPNode(JSPTranslator.java:1244)
    at org.eclipse.jst.jsp.core.internal.java.JSPTranslator.translateRegionContainer(JSPTranslator.java:847)
    at org.eclipse.jst.jsp.core.internal.java.JSPTranslator.translate(JSPTranslator.java:741)
    at org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter.getJSPTranslation(JSPTranslationAdapter.java:131)
    at org.eclipse.jst.jsp.core.internal.java.search.JSPSearchDocument.getJSPTranslation(JSPSearchDocument.java:120)
    at org.eclipse.jst.jsp.core.internal.java.search.JSPSearchDocument.getPath(JSPSearchDocument.java:160)
    at org.eclipse.jst.jsp.core.internal.java.search.JavaSearchDocumentDelegate.<init>(JavaSearchDocumentDelegate.java:30)
    at org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport.createSearchDocument(JSPSearchSupport.java:401)
    at org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport.addJspFile(JSPSearchSupport.java:295)
    at org.eclipse.jst.jsp.core.internal.java.search.JSPIndexManager$ProcessFilesJob.run(JSPIndexManager.java:262)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

    #256901 Reply

    Riyad Kalla
    Member

    I just downloaded and installed Eclipse 3.2 and MyEclipse 5.0 GA, and I now have problems with the JSP Content Assist with an existing code base. Whenever I try to use the content assist in the JSP, I receive the following message in red in the status bar, “Content Assist not available at the current location.”

    Can you give me a code-snppet example of where you are trying to execute code completion and not getting it?

    Is there any way I can force the MyEclipse validator to ignore these compile errors and still allow the code assist to work in the “parent” pages?

    You can turn off the validators under the project properties, then MyEclipse > Validation. This shouldn’t be effecting code completion though.

    I saw a post which suggested that I can rename the included files to a different name, such as .jspf in order to prevent them from being validated (http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-10594-highlight-path+include+project+resource+name.html). Rather than change a code, is there any way to tell the validator to ignore a certain set of files or folders?

    You can right click on the files or folders and mark them are derived, but this interferes with Team operations (e.g. CVS) unfortunately, we have an enhancement in to fix this. Also, if your pages are infact not stand-alone pages, per the JSP specification they should be named with a “jspf” extension as you found out. I believe MyEclipse’s JSP parser may be sticking to this strategy very closely. You could try checking out a local copy of your project and naming the files .jspf then cleaning and rebuiling the project and seeing if infact it does correct the issue.

    Error
    Mon Aug 14 13:31:37 CDT 2006
    JSPIndexer problem indexing:/Project/manager/orderDetail.jsp

    java.lang.IllegalArgumentException: Path must include project and resource name: /Project

    What is going on here? Is this project not a normal MyEclipse Web project or is it not laid out in the typical fashion? Maybe ti was checked out from a windows machine onto a Linux machine and the paths weren’t updated?

    Can you try and adjust your startup arguments to look like the following:
    http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-10087.html

    ** I’ve included a lot of questions above, after maknig the changes to your startup arguments, please try refactoring all the names as I requested ni a local copy of the project and see if autocomplete behaves itself.

    #256931 Reply

    valkeus
    Member

    I just downloaded and installed Eclipse 3.2 and MyEclipse 5.0 GA, and I now have problems with the JSP Content Assist with an existing code base. Whenever I try to use the content assist in the JSP, I receive the following message in red in the status bar, “Content Assist not available at the current location.”

    We have the same situation with JSP pages in our project. Only that for us it doesn’t seem to make difference whether there are the jsp:include-tags or not. Code assist works on some pages, but on which ones is rather random, so that at least we haven’t been able to track down the reason in these few days using new versions.

    Maybe needless to say, but code assist used to work on all of the pages 🙂

    //S of Valkeus

    #256933 Reply

    Riyad Kalla
    Member

    We really need example code to work with that I can file against the JSP editor as a bug with an example snippet for the developers to analyze… if I file “Code completion is broken” it’s too general.

    #256948 Reply

    ethomp01
    Member

    This message has not been recovered.

    #256952 Reply

    valkeus
    Member

    This message has not been recovered.

    #256962 Reply

    Riyad Kalla
    Member

    valkeus,
    The parser doesn’t parse jsp:include directives yet, just <%@include%> directives, maybe that could be the problem?

    Autocomplete in scriplets should certainly work… can either of you create a small test project, maybe with 1 or 2 JSPs and all the supporting classes that cause autocomplete not to work and then export it to an archive and send it to support@genuitec.com ATTN Riyad so I can try it out? Please niclude a link to this thread and tell me how to see the problem (where to try autocomplete).

    #256976 Reply

    valkeus
    Member

    Haven’t had problems with jsp:include so far 🙂 And no, there is no pattern with code assist, it is popping up or saying that red message regardless of jsp:include’s existence.

    I tried to create a new project (which I had to do also with our project few days ago ’cause my hardware toasted), I’ll mail it to you, but still, working of the code assist is pretty erratic. It did work, until I renamed the JSP, then it ceased to work. Closed and reopened the file. After some copypasting the code assist kicks in again, even in scriptlets.

    Now it’s working and it seems I can’t make it bug again, dammit :), but it still doesn’t play the tune with my real project files. I have opened and re-opened them and haven’t renamed them, and the problem stays, no code assist inside scriptlets.

    //S of Valkeus

    #256977 Reply

    ethomp01
    Member

    The behavior I have seen has been erratic as well, I can’t say that I have always found one consistent that that breaks/fixes to content assist issue.

    Also, when the content assist breaks, it breaks everywhere in the file.

    I sent you a test project.

    Thanks,

    Rob

    #256982 Reply

    Riyad Kalla
    Member

    Rob,
    I got your test project. I’m not sure what kind of autocomplete you were trying, but this isn’t a complete JSP page. There is now page declaration, there is no imports for the classes you use, there is no taglib references. Given that, autocomplete in any scriplet is not going to work since there are no imports for anything. Additionally no taglib autocomplete will be offered either, but it looks like the page uses scriplets, not taglibs.

    I think this is the problem, not the include… unless you trimmed this page back to remove the compilation errors?

    #256983 Reply

    Riyad Kalla
    Member

    Sara,
    I got your test project as well, and for the taglibs autocomplete is not going to work because your libraries are missing from the project. As for the scriplets, autocomplete works fine.

    The truck here guys is trying to find a reproducable test case… I’ll keep trying on this end to find one. If you guys have the time and could keep looking for a reproducable case that would be great..

    #256995 Reply

    ethomp01
    Member

    Yeah…I killed the header include. I understand that the code assist won’t work properly in this case, but this seems funny to me:

    If I remove the only include the file contains (confirmMsgBox), I (correctly) receive all kinds of compiler errors. and the code assist does have suggestions for me (although obviously nothing for the classes it can’t resolve). However, if I add the include back in, the compiler errors go away, almost like it is refusing to even try to validate the page.

    @support-rkalla wrote:

    Rob,
    I got your test project. I’m not sure what kind of autocomplete you were trying, but this isn’t a complete JSP page. There is now page declaration, there is no imports for the classes you use, there is no taglib references. Given that, autocomplete in any scriplet is not going to work since there are no imports for anything. Additionally no taglib autocomplete will be offered either, but it looks like the page uses scriplets, not taglibs.

    I think this is the problem, not the include… unless you trimmed this page back to remove the compilation errors?

Viewing 15 posts - 1 through 15 (of 29 total)
Reply To: JSP Code Assist Not Working

You must be logged in to post in the forum log in