A week ago, the teacher asked us to use Java to build projects. To tell the truth, I was a real stranger to Java, and I was helpless. The teacher's task could not be completed, I had to work hard on my scalp.
We have a project called "Data Warehouse", which was previously developed by the Teacher. Tomcat is used as the server and JSP + JavaBean is used for development. Later, the teacher decided to change to the J2EE version in order to "improve the technical content of the project". Almost no one of us used J2EE as a project here, so everyone began to look for information and download the compiler, so they were very busy.
In the end, we decided to use Oracle9i as the database and weblogic7 + jbuilder7 as the development environment. The reason is that WebLogic has better support for J2EE and the JBuilder development environment is good, the machine requirements are not too high (our machine is relatively poor, P3-550 + 256m memory, just to meet the minimum requirements :), I thought it is very simple configuration, it is easy to get, however, the results are surprising.
According to the training materials, install weblogic7 step by step, test the console, pass the test, and then install jbuilder7 according to the instructions, and configure it in sequence. The general process is as follows:
After Weblogic and jbuilder7 are integrated, the session bean is configured properly, indicating that the configuration is correct.
Then test the Entity Bean:
1. Set the driver for Oracle9i:
In jbuilder7, tools --> enterprise setup... --> database driver, click Add, and select Oracle Location D:/Oracle/ora91/jdbc/lib/classes12.zip. After confirmation, the driver appears in the list, and then restart JBuilder.
2. Create a project demo, create an EJB module named hustli, and import the database schema information.
3. Enter the database connection information: I use oracle9 on another machine, and the machine name is flyers and SID = Daito. The details are as follows:
Driver: Oracle. JDBC. Driver. oracledriver
URL: JDBC: oracle: thin: @ flyers: 1521: Daito
User = Daito Password = Daito
JNDI name: datasource
4. After successful creation, create a cmp ejb and enter the EJB information. The interface uses remote
5. Configure JDBC pool and data source in WebLogic:
JDBC pool:
Name: Pool
URL: JDBC: oracle: thin: @ flyers: 1521: Daito
Properties: User = Daito
Password: Daito
Initial Capacity: 5
Maximum capacity: 10
Test Table Name: hustli (a table I created)
Add myserver to targets, and use the default configuration for the rest.
Data source:
Name: datasource
JNDI name: datasource
Pool name: Pool
Add myserver to targets, and use the default configuration for others.
Then restart the Weblogic settings page.
6. Package the EJB and deploy it successfully.
7. Use jbuilder7 to automatically generate a test program. Modify the main function as follows:
Public static void main (string [] ARGs)
{
Try
{
Client client = new client ();
Hustliremotehome home = client. gethome ();
Hustliremote r = home. findbyprimarykey ("jjli ");
System. Out. println (R. getage ());
}
Catch (RemoteException ex)
{
Ex. printstacktrace ();
}
Catch (finderexception E)
{
E. printstacktrace ();
}
}
The result shows an error in Object ref = CTX. Lookup ("hustliremote"); (automatically generated)
The error is as follows:
Javax. Naming. namenotfoundexception: unable to resolve 'hustliremod' resolved: ''unresolved: 'hustliremote'; remaining name 'hustliremod'
Later, this problem also appeared on the machine of fellow engineers, without exception.
This problem has not been solved after discussion for a long time, so we split our heads and let everyone calm down and study all kinds of information self-confidence. We found that there is one thing in common: when the program was compiled, there was a warning that everyone was not paying attention to it. Later I noticed this problem. The warning roughly meant that there were spaces in the temporary file directory, it may cause fatal errors.
However, we found that the system's environment variables do have two different settings: temp and TMP, but one in the user variables and one in the system variables. In my opinion, the compiler should first search for the system variables. The value in the system variables is C:/winnt/temp. This should be fine, so we created a directory on drive C, the name is temp, and the values of temp and TMP in the user variable are set to C:/temp, then save and start jbuilder7. Everything is OK!
Does it look very BT? I wonder why jbuider first looks for user variables?
If the problem above is not a problem, we did not pay attention to the warning. The problem below is too depressing.
After WebLogic + JBuilder was installed, it took 2 days to run. Then I installed several anti-virus software to scan the hard disk and killed several viruses by using lovegate, delete all the infected files, restart the machine, and do something else. Then, forget about this. Wait until JBuilder is started tomorrow. Unfortunately, this happened, when the deploy component is deployed, the following error occurs: Unable to connect to T3:/localhost: 7001.
Isn't that strange? My server is clearly open, and it does not show any abnormal performance. Then I turn off JBuilder and use the Weblogic console to open the server. The server runs well. When the result is entered in the address bar: http: // when localhost: 7001, the connection cannot be found.
At first, I suspected that WebLogic had a problem and uninstalled Weblogic and re-installed it. The problem persists. Finally, I unmounted Weblogic and JBuilder and re-installed it. The problem still persists in front of me, what happened? Is it because important files are deleted during anti-virus attacks? No way, I had to re-format the hard disk, reinstall the system, first install WebLogic, run well, install JBuilder, complete configuration, everything is no problem, and then install a series of software, naturally, the kv3000 Anti-Virus is installed, and JBuilder is run. That strange problem occurs again !!!!
To solve the problem, I decided to uninstall the installed software one by one. Finally, I found that if kv3000 was uninstalled, JBuilder would not have any problems. Otherwise, jbuilder7 could not be run as long as real-time monitoring was enabled.
There is no way to uninstall kv3000. I personally suspect that kv3000 monitors Java and then kills it as a virus. Of course, this is just a guess. If the expert can give me some advice, I am very grateful.