First, open file-> New-> lomboz J2EE project and create a J2EE project named testj2ee.
Click Next. The default settings are displayed. Click Next to enter the next dialog box. Add the configured server to the targeted server, for example:
Create a web module and an EJB module in web modules and EJB modules respectively. In this example, we name them myweb and myejb respectively, and then click Finish. In this way, the framework of a J2EE project is automatically generated.
Under the myweb module, two JSP files are automatically generated: index. jsp and error. jsp, And the configuration file under the WEB-INF file. We can add our own JSP file and servlet on this basis, and then build the project.
On the eclipse toolbar, click the lomboz J2EE project outliner button:
In this way, the lomboz J2EE view appears in eclipse, as shown in:
Because I have already deployed another Web server: tomcat, the two servers bound to the module "myweb" appear, the red icon next to JBoss 3.0 all indicates that it is the default server. You can right-click the web module and choose to change the default server, for example:
After selecting the server, right-click the server in the lomboz J2EE view and select the running server. After the server is started, right-click the web module and choose deploy module, this completes the deployment of the web module on the server. Open the IE browser and type http: // 127.0.0.1: 8080/myweb to view your web application.
It should be noted that if Tomcat is used as the Web server, if the web module needs to be re-deployed, the Tomcat server must be restarted, and JBoss does not need.
Note:
If you encounter this problem when starting the JBoss server from Eclipse:
Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object |
This problem occurs generally Because JRE is not properly configured. In the preference dialog box of Eclipse, expand Java-> installed jres to check whether JRE has been set; open the Project Properties dialog box and check whether JRE system library exists in the library of Java build path. If not, click Add library to add JRE system library.