Eclipse + JBoss use small problem summary

xiaoxiao2021-03-06  75

Lomboz is an Open-Source Plug-in, which enables Java developers to better use Eclipse to create, debug, and deploy a 100% J2EE-based Java application server.

The use of the Lomboz plug-in makes Eclipse combines a variety of J2EE elements, the development of web applications, and the most popular application server cart.

The main features of Lomboz are:

1. Establish a web application using HTML Pages, Servlets, JavaServerTM Page (JSP) Files, etc.

2, JSP editing with highlighted display and encoding assistant

3, JSP syntax check

4, create web applications and EJB applications with Wizard

5. Create an EJB client test program using Wizard

6, support deployment J2EE web application file (EAR), web module file (WAR) and EJB file file (JAR)

7, using XDoclet development in accordance with EJB1.1 and 2.0 applications

8, able to implement the local and remote test application services for ports to ports

9, able to support all Java application services with extensible definitions

10, able to debug the running server-side code (JSP & EJB) with powerful Java debugger

11, improve development efficiency by using Wizard and Code Builder

12. Create a file in the WSDL form of the web service client

The server for Lomboz is:

Apache Tomcat, Jboss, Jonas, Resin, Orion, Jrun, Oracle IAS, BEA WebLogic Server Andibm WebSphere

Ready to work

Before installing Lomboz, you need to work, first, confirm that you are already using Lomboz's previous version, if you have you update your Lomboz to your new version or uninstall the outstanding version.

After installing Eclipse (before being decompressed by Lomboz plug-in), make sure your Eclipse is installed correctly and can run Eclipse.

Install JDK

A universal problem is to lack the installation of the appropriate Java Software Development Kit (which is JDK). In order to develop and compile the Java program, you need a JDK1.4 or higher version. Before installing JDK, you may have installed Java Runtime Environment (JRE) for Eclipse, in fact, this may be the cause of you, because JRE is not able to replace JDK. You can download the latest JDK from the official website of Java. After you have installed JSK, you can find that you can use it normally.

The author added:

Since using Eclipse then JDK should be installed.

Generally, it is directly extracted in the root directory of the C drive, such as: c: /j2sdk1.4.2

Set the contents of JDK

Java_Home = C: /J2SDK1.4.2

Classpath =.;% Java_home% / lib;% java_home% / lib / dt.jar;% java_home% / lib / Tools.jar

Path increases;% java_home% / bin;% PATH%

And changing the "Preferences" -> "Java" -> "Java" -> "C: /J2SDK1.4.2/JRE/" is installed in JRE (Installed JRES) ". Restart after saving.

In addition, it is best to use an eclipse3.0.1 that has never been activated, which can be completely cultured. If Eclipse has been used when installing the Chinese package, some content may not be used by Chinese, such as "Search", "Run" menu. If the Chinese is not complete, remove the Configuration directory under the Eclipse directory and restart. Lomboz software requirements

The software requirements for Lomboz are as follows:

Explain the last "Other Eclipse Projects EMF"

Models used by Lomboz3.0 is an Eclipse-based EMF project that requires EMF Runtime 2.0.0 or higher, and Lomboz3.0 can be used normally in Eclipse.

The author added:

Otherwise, the Runtime or All SDK of EMF2.0.0 or higher must be installed in Eclipse, otherwise there is no setting to Lomboz in the left tree of Eclipse "Preferencees" in Eclipse.

Install Lomboz

First you have to download the Lomboz software from www.objectlearn.com, make sure the downloaded version is adapted to your Eclipse.

After the LOMBOZ plug-in is downloaded, it is a zip's compressed package form, unzip the Lomboz.zip file to the installation directory of the Eclipse, will create a set of plugin folders as shown below:

Now you can start Eclipse and complete the Lomboz installation and configuration, you have to complete the Lomboz configuration.

The author added:

It is best to extract the Lomboz.zip file to a directory first, then copy all the Plugins folders and its contents in the decompressed directory to the Eclipse directory. In addition to the same name of the PLUGINS folder, others should have no identical content.

Plugin Activation

Once the Lomboz is installed, then Lomboz must be activated.

Select Menu "Window" -> "Custom Transmission Diagram", open the following window, select the submenu content as "New", then select Lomboz J2EE Wizards, and all the subtries in it are shown below:

Select Menu "Window" -> "Custom Transmission Diagram", change the submenu content as "display diagram", then check Lomboz J2EE and its content, as shown below:

Select Menu "Window" -> "Custom Transmission Diagram" to switch to the Command tab, select Lomboz Actions as shown below:

Select the menu "window" -> "preference", in the "Workbench" -> "Tag Modification" Select Lomboz J2EE Decorators as shown below:

If you complete the above settings, then add an icon as shown below in the toolbar:

Moreover, the related content will also be increased in operation using the wizard new project.

Configure JDT and Lomboz

Before you use Lomboz as your J2EE project development tool, you have to complete the following configuration work.

Step 1: Java

First of all, it must be clear, new Java project's output file and source of source code.

Open the Preferences dialog box from the menu "window" -> "Preference" and expand the "Java" entry in the left tree and select "Build Path". Change the contents of the Source and Output Folders Change to Folder, and the source folder name "SRC", the output folder name "bin". After the modification, select the "Apply" button to save the modification, as shown below:

Step 2: Lomboz settings

Most application servers compile JSP files using standard Java Compiler (Javac), and Javac is included in the standard JDK Tools.jar (instead of JRE Tools.jar). So you must select the JDK Tools.jar file correctly, which is usually located under the "lib" folder in the standard JDK installation directory.

Enable JSP Syntax Checking If you have a lot of JSP files, you don't want to check their grammar at each time you save, this feature will be very useful. By default, this function is selected. If you don't need this function, you can save this feature and "Apply" saved.

Server Restart If after you re-departing the project, your application server has not been able to reload your web container or EJB container, it will be useful. Select this feature, Lomboz will help you start your application server after reloading the container. This setting may be very useful for you to use Tomcat.

Update Server ClassPath and Deployment Parameters This feature This feature enables Lomboz to check and lock engineering ClassPath and selected engineering departments. If you change the definition of a server, this feature is very useful. By default, this function is selected. If you don't choose this, you have to check and lock your project's classpath every time you change the definition of the server.

Select Code Generation Plugin

Lomboz 3.0 supports the scalable code plugin. You can choose a plugin that supports generating EJB code and comments. The default plugin provided by Lomboz is "xdoclet".

important content:

Use Application Server ClassPath

This feature allows you to use the ClassPath in the next server definition when starting the application server. It will not use ClassPath in the Java project you build.

If you don't choose this, Lomboz will use ClassPath in your Java project to start the application server. Such a disadvantage is that the Web container or EJB container will appear twice. Once an Eclipse's Java project, the other is the WAR of EJB's JAR and Web. This will cause unexpected class equipment, if you have such experience, then you will make you sure to choose this feature.

Step 3: Server definition

Lomboz can adapt to almost all Java application servers. In order to create a script for the Lomboz to create a correct server address you need to set some parameters. These parameters you set are regarded as the default settings of the files that start the server and find the local deployment web app and the EJB app.

These server profiles are stored under a folder called "Servers" in the Lomboz plug-in directory, when the Lomboz will scan this folder when needed.

The next step is to check and set the definition of these servers.

Although some values ​​have been pre-defined in advance, these default values ​​do not meet the configuration you need.

It is important to remember the "Application" your changes after the change is made.

Properties Page

Open the Preferences dialog box, select Server Definition under Lomboz, follow the steps below:

Select the server you want to use in Servers Type, and then change the contents of the corresponding server where the ClassPath variable is changed:

Classpath Page

The next step is to view when the server is started, those libraries must be loaded. We have been applied here (author prompt: After the previous application, determine closing preferences, reopen the preference, ClassPath Variables is applied). You can add or delete in this list, you must load the library that must be loaded when the server starts, but you must "apply" after any modification. Step 4: Verify ClassPath Variables

Verify that these variables are set, the method is to open the "Preference" dialog, expand the Java entry, select the "Build Path" -> "Class Path Settings" entry, you should see that the variable you set has been added to the list. , As shown:

Step 5: XDoclet configuration developed for EJB

XDoclet only supports Java2 JDK, does not support 1.1 old versions

Make sure that the Tools.jar file in the JDK's lib directory is in the classpath variable.

Make sure the JDK's bin directory is in the second chapter in the PATH variable. It took a week, and it was too efficient to intermittently.

Lomboz concept indicates that J2EE application development is a complete development process. Therefore, it must include all phases of the application development process, such as: encoding, compiling, deployment, testing, commissioning, etc.

A program that complies with the J2EE specification relative to a normal Java program is that the application is deployed in package mode based on the standard component organized by the WEB application and the EJB application, which constitutes an enterprise application.

According to J2EE specifications, these Web and EJB applications have a good definition and standard structure that forms the contents of "Modules" in J2EE applications. For these "Modules", an application server provides and manages the operating environment. An application server can manage many modules at the same time.

"Development Must Be a Reflection of The End Goal, The Production Environment".

An enterprise-class application is made up of many modules, so a work that meets J2EE specifications must be able to operate multiple modules at the same time. These modules will not have different copies they produce.

"Developers Must Not Be Limited With Our Restricted Views of How Things Should Happen".

We often tend to think that our experiences can solve most of the problems encountered by developers. But this is thinking that there is a vulnerability. Because developers should pay attention to many details for each project. We are trying to use Lomboz automation to make these problems can discover early. Developers can observe and modify Lomboz behavior through custom settings.

Here are three ways to add J2EE's characteristics by using Lomboz for your project:

New J2EE Projects: New J2EE project, this option is adapted for you to build a J2EE project, J2EE Engineering Wizard will help you set some of your projects.

New J2EE Module: New J2EE Module, this option is appropriate to add new Web and EJB Module for your already existing projects. The J2EE Module Wizard will create a new module in your project. This option may require additional steps to determine if your Java Build Path (ClassPath) contains the necessary library files.

New Ear Module: This option is suitable for you to pack your J2EE Modules into a document for an application server. Ears is a primary package tool that contains a variety of WEBs and EJB Modules, which can form an application. You can make an EAR file from the Web and EJB Modules you already exist. Similarly, many application servers (such as WebSphere, Orion, Oracle) do not easily recognize independent Web and EJB Modules. For their best way to configure an EAR and use it as the primary deployment unit. Enabling EXISTING MODULES: This option is available for you have Web and EJB Modules that is not created with Lomboz. You will make them as J2EE's modules by increasing the required Lomboz components and the J2EE specification. This option may require some additional steps to determine if your Java Build Path (ClassPath) contains the necessary library files.

Eclipse3.01 and JBoss3.2.6, plus Lomboz3.01 (must be installed EMF-SDK-2.0.1)

There have been many problems, but the problem is small, but it costs a lot, but there are some solutions on the Internet, but it can't understand the real reasons, let me think it still needs research.

1. Why is the Lomboz's Server Definitions in Preferences, why is it jboss2.4.4 each time, I am not set and "app" JBoss3.2.6?

Cause: The concept is not understood.

The content of Server Types in Server Definitions is actually read by multiple files in the folder "c: /eclipse3.01/plugins/com.objectlearn.jdt.j2ee_3.0.1/servers", each file corresponds to one Configuration of a server.

And here just represent a list, indicating that your JBoss can support those servers. As for which one your project is used, you need to set it when you create your Project, and you can add multiple.

Here is just a setting for each server, but not, you use this by default.

You can completely delete the configuration file of the server you don't have to use under the Server folder. For example, I delete the JBoss244, JBoss244Tomcat, JBoss300all, etc. I don't have to use the server.

2, how to write the Server file

In fact, every Server Type in Server Definition corresponds to 4 tabs, and settings for these four tabs are the content of the Server file.

The first property page: The modified content is mainly the content of the corresponding server and the content of the ClassPath variable.

The latter ClassPath property page, the CLENT CLASSPATH Property page and the Project ClassPath Properties page: The main check is the correct variable and the library file is correct, is there a lack of it.

I personally think that now Eclipse does not seem to check the correctness immediately, as long as the specified ClassPath variables content is the JBoss installation directory, the default settings in the server file are the same icon. No matter whether your JAR file is really in the specified directory.

3. Due to the problem of 2, it can't find javax.servlet.jar and jboss-boot.jar files.

Reason: These two files have no existence

Solution:

I have been looking for a long time online, I found a Server file that provides ready-made JBoss3.2.6 on a Japanese website. Download it can be used. The URL is: http://www.kawaz.jp/pukiwiki/? JBoss% 203.2.3% A2% AA3.2.4 But the national complex makes me feel that I will know how to figure out, compare two files

New has removed Javax.Servlet.jar and jboss-boot.jar files.

But in Server ClassPath and Project Classpath, there are more settings:

$ {classpathvariablename} / server / $ {serverconfig} /deploy/jbossweb-tomcat50.sar/servlet-api.jar

Also found that the default jdom.jar file in Server ClassPath has replaced with the Dom4j.jar file. It is not the case in the LIB directory of jboss3.2.6.

4, why after manual changes and replaced several Server files, the button in the Lomboz J2EE VIEW in Eclipse is not good, can only perform Run.bat in the JBoss directory?

Originally, you can start the server:

However, it is suddenly not good.

Finally, I found that a "small error" appeared because of his own server file.

Because I change the file name of the JBoss32x.server file under the Server directory to jboss326.server, it is clear JBoss3.2.6 in Server Definitions in the Preferences, but I There is no change in the second line of this Server file,

Name = "jboss 3.2.x" should be changed to Name = "JBoss 3.2.6" and the name is consistent, so that there will be no "strange" problem.

I think I will encounter a lot of small problems, I hope to record it, help yourself. In addition, I still want to further understand the meaning of the Server file, I know, please tell me, thank you.

转载请注明原文地址:https://www.9cbs.com/read-92755.html

New Post(0)