Tomcat6.0 project deployment

Source: Internet
Author: User

Some days ago, college students asked me to help their company get a small project and analyze his needs. I thought it was very simple and agreed. It took a whole day to complete. There are also some gains, so you can quickly record the knowledge gained from the project and use it later.

Development Tool: jdk1.5 tomcat6.0 eclipse oracle10gxe

Framework: strust2.x spring3.x mybatis3.x foreground mainly jquery

The results are as follows:

1. As a persistent layer framework, mybatis has a null exception. For example

Sqlsession sqlseesion;

Users users = new users (); // user is a keyword, depressing

Users. setuname (null );

Users. setuage (20 );

Sqlsession. insert ("insertusers", users );

// Sqlsession is injected

// Mybatis Mapper. xml and spring XML configurations will not be written.

When you run the code, a null exception occurs. First, I thought about whether orcale data is not empty. The result is that it can be empty. For verification, an SQL statement is directly used to insert data successfully under orcale.

At this time, I thought it may be the problem of mybatis. maybe you would want to say that sqlsession may be empty. Of course, it was verified long ago and spring injection was successful.

If mybatis is always used, it is necessary to identify the problem in that link. If I modify the SQL statement in mapper directly, change # {uname} to null, run, and insert successfully.

This indicates that there may be a type conversion problem, that is, the reason why the javatype conversion fails to determine the type in jdbctype's null value. If so, I searched the internet and found many people

Also encountered the same problem. Some people say that it is okay to change null to "". But the solution is too direct to explore the problem itself. The final solution is as follows:

# {Uname }==># {uname, jdbctype = varchar}

 

2. tomcat6.0 deployment project problems

Let's talk about the solution.

A. D:/jdk1.5/bin to configure to the path of the Environment Variable

B. Configure java_home and jre_home in the environment variables. Later, I checked the information on the Internet and learned that these two environment variables are in atat6.0/bin/setclasspath. BAT was used, so someone proposed another solution. Write the two variables directly to setclasspath. bat.

Set java_home = D: \ jdk1.5
Set jre_home = D: \ jdk1.5 \ JRE

C. Run startup. bat.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.