Seeing the article written by others about EJB, learn to write its own design environment.
That article is here: using Eclipse3.0 Lomboz3.0 JBoss3.2.3 development EJB by ginger into Cheng
Because I don't need EJB, my environment is not so advanced, using simple Tomcat 5 things.
What is said here is after the Eclipse that is just installed?
Required software: Here you have to remind, open source things are very strict on the requirements of the version, if the version does not have some unexpected situation
JDK 1.4 I is 1.4.1_0.2, recommend 1.4.2 http://java.sun.com Eclipse 3 I am 3.0.0 http://www.eclipse.org Lomboz 3 I am 3.0.1 http : //www.objectlearn.com Tomcat 5 I am 5.0.25 (recommended), 5.0.27 will have problems, such as startup issues, http://archive.apache.org/dist/ EMF 2.0.0 http: //www.eclipse.org/emf
Preparation
1. Set automatic update for Eclipse
Eclipse3.0.0 does not automatically update the plugin
Modify the config.ini adding under Eclipse / Configuration: osgi.checkconfiguration = true
Delete the org.eclipse.Update directory under Eclipse / Configuration
2. Install Lomboz
Unzip Lomboz to the Eclipse / PLUGIN directory
Emf is extracted under Eclipse, and if the EMF is not installed, Lomboz cannot be used.
3. Set Perspective
You can see the Lomboz item in Window-> Preference after you will rest up.
Set up Window-> Customize Perspective will be related to Lomboz
4. Set Lomboz
1) Set JDK Tools.jar to remember to press the Apply button after preferences-> lomboz.
2) Set the Tomcat server (the server configuration in the drop-down box corresponds to the server file under the plugins / com.objectlearn.jdt.j2ee_3.01 / servers / Lomboz-> Server Definition
Both Application Server Directory and ClassPath Variable are all set to Tomcat installation directory, remember to press the Apply button.
In Preferences-> Lomboz-> Server Definitions-> Tomcat5.0.x-> Project ClassPath, add library, add Tomcat / Common / lib / jasper-runtime.jar, or the servlet generated in J2SRC will compile errors, cannot be performed JSP single-step debugging
5. Compile Directory Settings Preferences-> Java-> Build Path -> Source and output path change to Folders, this is not available, but it is related to the settings of the project of Project
Two: Web Project Settings
1. New Construction
New -> Lomboz J2ee Project
Step 1: Project Directory: Such as C: / Project / Debugjsp
Step 2: According to the default value, then modify it after success
Step 3: Web Modules: Add one, the name will correspond to a directory, this directory is the context directory: such as Demotargeted Servers: Choose the Tomcat5 that is just configured
2. Set up the project directory (now Engineen DEBUGJSP CONTEXT Name Demo)
Project-> Properties-> Java Build Path
1) Do not add the debugjsp / demo directory in Source Folder and Build Path, because Default Output Path is set to debugjsp / demo / web-inf / classes, otherwise will report to nested errors, this is why 1.5 steps The reason, this will not appear under the Source Folder in this way, so that debugjsp / demo will not appear
2) Add a debugjsp / j2src directory in Source Folder and Build Path, which is usually automatically added, select the following Allow Output Folders for Source Folders and select DebugJSP / J2SRC-> Output Folder as J2SRC Directory
3) Modify default output folders as debugjsp / demo / web-inf / class
3. Add Tomcat's context configuration
Create a new XML file in Tomcat / Conf / Catalina / LocalHost, the file name is casual, and the XML file in this directory will be automatically configured and deployed by Tomcat as a configuration file, an XML file corresponds to a context, if Delete this XML file, Tomcat will automatically correspond to Context, without restarting
The content in the XML file: pay attention to the case to be consistent (Project's directory is c: / project / debugjsp, context directory C: / project / debugjsp / demo)
DOCBASE = "c / project / debugjsp / demo" path = "/ debugjsp" />
Of course, you can also add to Server.xml
Three: Debug JSP
1. Start Tomcat-Debug Tomcat Server
Open Lomboz J2EE View, select the corresponding context, then press Lauched SELECTED Server, this time will start Tomcat at this time
2. Generate corresponding servlet
Enter the JSP page you want to debug (such as: http:// localhost: 8080 / debugjsp / index.jsp, this time, if everything is normal, this time Refresh the project in Eclipse, this time there is a corresponding servlet file in the J2SRC directory, such as index_jsp.java (in the org.apache.jsp directory)
3. Set breakpoints, set breakpoints in index_jsp.java (we debug actually servlet), then return to the browser to refresh the page http: // localhost: 8080 / debugjsp / index.jsp, this time eclipse will Go to Debug Perspective, stopped at the breakpoint, next. . . .
The general process is this, if there is a problem, please pay attention to these steps:
1. The Lomboz server is configured correctly 2. Compile directory settings, especially J2SRC directory
Four: Class Loader Exception of Tomcat5.0.27 or later Class Loader Exception
The following error occurs when using this version
Bootstrap: Class Loader Creation Threw Exception Java.lang.ExceptioninInitializerRROR at Org.Apache.catalina.Loader.standardClassLoader.
(StandardClassLoader.java:207)
At Org.Apache.catalina.startup.classloaderFactory.createClassLoader (ClassLoaderFactory.java: 189)
At Org.Apache.catalina.Startup.bootstrap.createClassLoader (Bootstrap.java: 160)
At Org.Apache.catalina.Startup.bootstrap.initclassLoaders (Bootstrap.java: 104)
At Org.apache.catalina.Startup.bootstrap.init (bootstrap.java:193)
At Org.Apache.catalina.startup.bootstrap.main (bootstrap.java: 399)
Caused by: org.apache.commons.logging.logconfigurationException:
Solution: 1. Replace with 5.0.25
2. The tomcat5x.server the startVmParameters and stopVmParameter in -Djava.endorsed.dirs = "$ {serverRootDirectory} / bin; $ {serverRootDirectory} / common / endorsed" changed -Djava.endorsed.dirs = "$ {serverRootDirectory} / Common / endorsed
Original http://forge.objectweb.org/forum/forum.php?thread_id=1028&sterum_id=360
Reference http://blog.9cbs.net/dawave/archive/2004/07/25/51879.aspx
http://www.objectlearn.com/support/docs/debuggingjsp.jsp.jsp.jsp