Debugging Custom java WebApplication - java

I have IVR -Java application deployed on caucho Resin server
Web App is not in server but directory outside on same system. Also Jsp are getting compiled in external directory.
In eclipse I have source code when I launch debugger I am able to connect and I am able to debug through java classes but when control goes to jsp file it is not able to find source
Any idea how i can fix it.??

Maybe that's because eclipse can't find the source. Have you tried adding that to the build path? Project -> properties search for build path.
If the source requires a different language to run, Jsp (i've never dealt with that), then perhaps you can get a plugin for eclipse for that language (jsp) and then add the jsp source to a (eclipse) project that houses the jsp section of the whole project.
Edit: seems like since I haven't messed with JSP much, I gave the wrong advice. Follow the link in the comment below.

Related

Website directory structure different from eclipse

I am coding a website using java servlets and am using eclipse and tomcat. When I test it using localhost, it works fine. But when I am deploying it on my actual website, the directory structure is messed up and the files are not called properly.
My eclipse directory structure on localhost is
Project Name
.src/packageName/java files
.WebContent/HTML files.
When I make a call from the html files, I use the relative location and tomcat automatically knows to look in the src/packageName folder. For example, from the /WebContent/login.html page makes a onClick call as follows,
. This will automatically trigger the java file in /src/packageName/welcome
When I am deploying it in my actual website, the WebContent/login.html is throwing an error WebContent/welcome file is not found. How do I tell my website to search in /src/packageName folder?
Hmm...have you been sure to package the application as a war for deployment.

loading and running jsp file error

I am trying to create a new jsp-file in eclipse
I installed tomcat server and created new dynamic web content.
now i want to create a new jsp file, but each time i try to create the jsp file eclipse give me the warning message shown on the image posted below.
please let me know how to load and run the jsp files using eclipse correctly.
You seems to be creating JSPs in a non-Java eclipse project and hence this warning is coming.
To run a jsp file you need a container like Tomcat. You can configure Tomcat under Runtime in eclipse. Follow this link to learn more about configuring Tomcat with eclipse:
http://www.eclipse.org/webtools/jst/components/ws/M4/tutorials/InstallTomcat.html

NoClassDefFoundError on a class within a WAR on WebLogic server

I am trying to deploy a WAR file on weblogic server.
This is a simple java application.
I am new to this and experimenting.
JRE: 1.5.0_41, OS: redhat 5.8, Weblogic: WebLogic Server 10.0 MP2
The contents just include a jsp file and a java file (jsp inside jsp folder and java class inside WEB-INF\classes folder and correct package structure). I am using this java util file inside the jsp for some common utility methods.
However, when I deploy the WAR, it gives me NoClassDefinitionFoundError for this java utility class.
I have searched the threads and found that this exception points to some other inherent issue in the deployment. It also mentioned class path conflicts etc. I can understand this issue when it comes to using a class from an external JAR file, but could not understand how it fails to locate a file in the same context as that of the jsp.
How come the import statements in the jsp worked and the jsp got compiled and rendered and failed only when the part of accessing this object came into picture? (runtime problem maybe?)
Please educate me on this. My debugging efforts are still on. Thanks a lot, folks!!
[P.S.: Could it be because i compiled and built my source using eclipse setting 1.7 compliance and used it on a lesser JRE?]
For a war file classes is normally packaged inside WEB-INF/classes, not classes.

How to start development on existing java web application

I come from an Asp.Net development background and am very comfortable there. I was asked to support an existing Java Web Application w/ struts and am able to figure most of it out with my Asp.Net knowledge and my android development experience. However, I'm having a really simple but stupid problem.
All i have is the website as it exists on the server, no source project to work from. The folder on the server contains both .java and .class files, but the folder doesn't just import into netbeans as a recognized project.
What's the easiest way to get the site imported into some sort of IDE (I can work w/ eclipse too if netbeans isn't recommended), and get it to compile so I can deploy some updates.
It will not be easy to answer fully to your question here. But we should be able to achieve that by steps :)
Here i will speak for eclipse. But it is only because i'm not familiar with netbeans.
First of all create a clean "dynamic web project" under eclipse (using a J2EE enabled eclipse http://www.eclipse.org/downloads/).
Then :
copy your sources files in "Java Resources"
copy the rest of your application (without the class files) in WebContent
In order to test your application localy you will need a local server. Tomcat can be integrated easily in eclipse.
Usually you shouldn't have to (re)construct a project from a deployed web-app; the project should have been kept in version control. Source code isn't usually deployed to the server, either, but if it's been done in this case, you're in luck.
I would just make a new web project in NetBeans and manually move the .java files into it, along with the other resources (except for the .class files).
If you can use eclipse, and the source files are already in the war file as you say. You can import the war file directly into eclipse as project.
file -> import -> war file or existing project into workspce or filesystem (Several other options exists)

Compiling java code with non java extension file in eclipse

I am working on a project in which there are jsp files and some files with extension .jsps. And these files only include java snippets in form of <% %> and javascript code. And this .jsps file is included in jsp file. For compiling, eclipse is just ignoring .jsps files. And I want to compile all the files using eclipse version 3.4.1. Any idea will be appreciated. Thanks in advance...
Regards
What you should do is ask your app server to pre-compile all the JSPs. Each servlet/JSP engine will do it differently (e.g., WebLogic versus Tomcat), so you should be using the JSP compiler for the app server you're going to deploy to.
You can usually find Ant tasks to accomplish this. I don't think it's a job for Eclipse, unless you can find a plug-in for your app server.
Thanks for response. Actually, I solved the issue by using ANT through eclipse. And ANT file was already building the project, but outside of eclipse. Now, I used build.xml file in eclipse and it worked :)

Categories

Resources