facebook

Importing WSAD Web Project: JSP problems

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #208417 Reply

    Javier Ramos
    Participant

    Hallo,

    I am evaluating MyEclipseIDe as a replacement for WSAD 4. We have been working for one year with WSAD and we want to switch to a more lightweight develeopment environment, because we find that WSAD is heavy and makes us somehow unproductive.

    For the project that I am running I have 2 dependent jar projects, 1 EJB application client, 1 EJB project and 1 Web project.

    Dependent jar projects can be downloaded from CVS and they compile straight away with MyEclipseIDE. Next step is to compile the web project. Here is where I find difficulties.

    I managed to get the Web project files from CVS, with Check out as… -> New project configured using the New Porject Wizard.

    Then I select J2EE -> Web Module Project.

    In the next dialog I set:

    Source folder: source
    Web root folder: webApplication

    to match the folder structure taht WSAD creates for web projects.

    Then, all my java code compiles perfectly, BUT all the JSP’s have errors. I open any of them and in the first line there is an error saying:

    “The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files”

    I cannot find the cause and way around this problem. Can anyone provide some help? I am sure it is some silly detail I am missing, but I cannot find the solution.

    Any help will be very much appreciated. Thanks in advance,

    Javier Ramos

    #208450 Reply

    Riyad Kalla
    Member

    Javier,
    Are all of your JSP files under the webroot you set? (‘webApplication’), so if you navigate to your Project Build Path (right click on project root > Properties) and go to “Java Build Path” then go to the Libraries tab… do you have a “JRE System Library” listed in this list anywhere? If you do does if have any icon on it like an X or exclamation point?

    Also can you check your log file for any exceptions, its located at: <workspace dir>\.metadata\.log, look for exceptions near the end of the file (recent) and paste them in here for us to look at.

    #208477 Reply

    Javier Ramos
    Participant

    @support-rkalla wrote:

    Javier,
    Are all of your JSP files under the webroot you set? (‘webApplication’), so if you navigate to your Project Build Path (right click on project root > Properties) and go to “Java Build Path” then go to the Libraries tab… do you have a “JRE System Library” listed in this list anywhere? If you do does if have any icon on it like an X or exclamation point?

    If I go to project root > Properties > Java Build Path > Libraries, I can see that there are two jars missing. These correspond to my dependent jar projects, so there is the problem.

    Do you know how can I achieve that compilation of my dependent jar projects creates the corresponding jar files unde web root/WEB-INF/lib ?

    Thank you so much for your help…

    #208481 Reply

    Riyad Kalla
    Member

    Javier,
    The only way to have your dependent JAR projects be build and placed into the web module project’s WEB-INF/lib dir is via an Ant script. We do not currently support that build configuration, but I think we support the automation of it during deployment, I’m checking with another support person on this.

    #208482 Reply

    Scott Anderson
    Participant

    Javier,

    The easiest way to get what you want is to simply add the Java projects that contain the missing library classes to your web project’s build path. This should get rid of the compilation errors. Once that’s done, you need to enable dependent project deployment so that the projects will also be deployed as part of your web application. You can do this on the preference page at Window > Preferences > MyEclipse > J2EE > Web Project > “Web project build path deployment policy” > “Use smart deployment”.

    With these settings, your web project should both compile and deploy properly.

    #208485 Reply

    Javier Ramos
    Participant

    @support-scott wrote:

    Javier,

    The easiest way to get what you want is to simply add the Java projects that contain the missing library classes to your web project’s build path. This should get rid of the compilation errors. Once that’s done, you need to enable dependent project deployment so that the projects will also be deployed as part of your web application. You can do this on the preference page at Window > Preferences > MyEclipse > J2EE > Web Project > “Web project build path deployment policy” > “Use smart deployment”.

    With these settings, your web project should both compile and deploy properly.

    It still did not work for me… I also copied manually the jar files to web root/WEB_INF/lib, and still I get:

    “The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files”

    in every jsp. This happens whenerver I include another jsp by means of:

    <%@ include file=”global.jsp” %>

    Also in other files I do not get this error, because no other jsp is included, but then I have in these files custom tags that are not recognised, even if I have my tag library descriptor under WEB-INF.
    The error then is:

    “cannot load class: XXXTag”, where XXTag is my tag handler class, which is in the classpath.

    Any ideas? Thanks for your patience…

    #208490 Reply

    Riyad Kalla
    Member

    “The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files”

    Can you try rebuilding your project?

    I have in these files custom tags that are not recognised, even if I have my tag library descriptor under WEB-INF.

    Do you have proper entries in your web.xml file with correct URIs that are used in your JSP pages?

    #211353 Reply

    mpanoff
    Member

    was their any resolution to this?? I’m having the exact same problem with a project that came from WSAD. thanks!!

    mike

    #211361 Reply

    Riyad Kalla
    Member

    Mike did you follow the suggestions of:

    1) Clean your project, force a rebuild so all the errors are up to date
    2) Make sure your build path is sane and doesn’t have any “X” error markers in it
    3) Make sure your paths are OK, and your JSP pages are under your webroot and that any required libs are mounted.

    What errors are you getting? What is your system info?

    #211371 Reply

    mpanoff
    Member

    I fixed the problem. JRE System Library was missing from the CLASSPATH. Everything builds, no more red “X” errors.

    BUT now I have another issue. Your WAS deployment just doesn’t seem to be handling the WAS installedApps directory properly. First of all, WAS does not pick up “exploded” archives automatically.. but you can use it to fudge hot-deploy of an already deployed app.

    I built a war, test.war, then deployed it via the WAS console. WAS put the war in a test.ear directory, it generated the ear wrapper, so to speak. Now I wanted to use your “exploded” deployment functionality to overwrite the contents of the war, can’t do it. You can’t have two projects of the same name in eclipse, ie test, test.war and test.ear. Does this make sense?

    I guess the work around is not to initially deploy a war, but an ear.. then, if the project names correspond to the directory names, “exploded” deploy should work… will try this tomorrow at work, just occured to me.

    FYI, when you overwrite files in the installedApps war directory (in WAS), WAS picks up that things have changed.. which is somewhat like hot deploy. I used to do this with ant all the time, until I started using WAS Studio.

    ohh.. and I couldn’t start WAS from eclipse.. I probably wouldn’t use it anyway.

    What would be really badass is if I could easily access the deployed web-app with a click of a button!!

    mike

    #211372 Reply

    Riyad Kalla
    Member

    Mike,
    I’ll have someone more in the know about WAS reply to your comments above, but w.r.t. to the “easily access the deployed web-app”, if you mean the directory, just hit the Browse button on the deployment panel, if you mean via a browser, you can use the Web Browser view from the Window > Show Views > MyEclipse category. Although if you want a quick key, like F12 to popup a browser and view the page, then that’s not in just quite yet, but we’re working on it.

    #211384 Reply

    Scott Anderson
    Participant

    Mike,

    I guess the work around is not to initially deploy a war, but an ear.. then, if the project names correspond to the directory names, “exploded” deploy should work… will try this tomorrow at work, just occured to me.

    That’s exactly what will work. Actually, on WAS the general use is to deploy the EAR as an archive, then use the WAS console to deploy it once. Then, change your deployment type to exploded and deploy your app in order to overwrite the exploded version that WAS created, thus picking up the changes.

    ohh.. and I couldn’t start WAS from eclipse.. I probably wouldn’t use it anyway.

    The advantage of starting from Eclipse is that your Java breakpoints will work easily without having to deal with remote launch configurations, etc.

Viewing 12 posts - 1 through 12 (of 12 total)
Reply To: Importing WSAD Web Project: JSP problems

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