Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439

Author: Chris Wong

Relevance: Studentsusing Linux workstations for Weblogic based subjects

Subjects: 32549Advanced Internet Programming

31337 Advanced Internet Technologies

31337 Advanced Internet Technologies

Advanced Java Programming (Short Course)

This list of Frequently Asked Questions is a compilation ofmany queries and problems which students in the above subjects haveencountered.

If you wish to enter a FAQ entry, please email Chris Wong

 

 

Look in the subject online web site. There is a link called "machines".

 

 

The faculty portal has some online documentation. Look in the top right hand corner, and select the documentation link

 

You are probably running an older version of WebLogic. Check:

  • Have you installed an older version (v6 or v7) of WebLogic previously?
  • Do you have a ~/webLogic/config/$USER directory?
  • Check the PATH and CLASSPATH variables (hint: just type set on a command prompt to see all the variables). Does it refer to anything other than /opt/bea8/ ?

Solution:

  1. Optionally backup your ~/WebLogic directory.
    cd; tar cf WebLogic | ( cd destdir; tar xfBp - )
    where destdir with your backup directory)
  2. remove the ~/webLogic directory and re-install.
    rm rf ~/WebLogic
  3. re-install
    installWebLogic

The .bash_profile only runs once when you login.

Type

. .bash_profile
You can also add this line into your ~/.bashrc to execute this everytime a bash shell is run

 

Here is an example ~/.bashrc:

# this is a sample .bashrc
. .bash_profile

 

You probably haven't run the wlenv command

 

You can check whether the classpath has(not) been set by typing

 

echo $CLASSPATH

 

(you should see some /opt/bea8 directories in this list)

 

If you get a message saying
Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/Admin
then check that you have setup the environment correctly
(eg: run
wlenv )

Check the CLASSPATH and PATH variables to see that /opt/bea8/ is included.

Are you running wlstop on the correct machine?

Check in .bash_profile that the wlstop alias is on ONE single line. The lab notes could imply that there is a separate system "userid" command. This should be on the SAME line as the "alias wlstop" line, ie:
alias wlstop='java weblogic.Admin -url t3://localhost:7001 -username system -password password SHUTDOWN'

 

 

From a unix command prompt type
hostname


This will give you a result like: machinename

The full internet name of this machine is:
machinename.it.uts.edu.au

 

 

You certainly can. Just ensure that you boot RedHat/Gnome/KDE  (not windows 2000 or XP or BSD). Everything should be exactly the same (assuming that you are running the default bash shell).

You may have a problem with the default browser (Galeon or Mozilla) not displaying the "console tree" on the left. In order to do this, you need to setup a Java Plugin on this browser.

From a command prompt, you need type in the following commands

mkdir ~/.mozilla/plugins
ln -s /opt/JDK-1.4.2/jre/plugin/i386/ns610-gcc32/libjavaplugin_oji.so ~/.mozilla/plugins

You then need to restart the browser.

 

Q9: I get the error message "The WebLogic Server did not start up properly"

You also see:

Exception raised: 'weblogic.server.ServiceFailureException: Could not obtain an exclusive lock to the embedded LDAP data files directory: ./myserver/ldap/ldapfiles because another WebLogic Server is already using this directory. Ensure that the first WebLogic Server is completely shutdown and restart the server.'

 

This can mean either:

  1. You are running more than one copy of WebLogic on the machine
  2. You are running WebLogic on rerun
  3. You did not stop the weblogic server correctly.

You should not run more than one copy of WebLogic on a workstation, and you are not allowed to run weblogic on rerun or sally. !!

If you didn't stop weblogic via the wlstop or the shutdown console option, you may need to remove a lock file.


You can do this with the following command:


rm ~/webLogic/$USER/myserver/ldap/ldapfiles/*.lok



(note: you can replace the $USER path with your username)


You can then restart the server.

 

There are 2 options

  1. Install WebLogic on your home machine. This can be on a Windows 2000/XP machine (see Q11) or on a Linux machine.
  2. Remotely access the Faculty's machines via the internet (see Q12)

 

You will need to download WebLogic server 8.1 from BEA
You can do this by connecting to
You will be asked to register with BEA to download.

 

Because the files are rather large, it may be best to download with Broadband connections or to login to the ITD machines on level 2 (the open air lab with black Dell workstations with LCD screens). The ITD lab machines also have the advantage of having a CD burner built in J!

 

The basic machine requirements to run WebLogic Server 8.1 are:
Windows 2000 SP2 or Windows XP SP1
Pentium III-700Mhz
256Mb Memory (prefer 512Mb)
400Mb disk space

Please install the WebLogic Server 8.1 with SP1 (*not* platform, as this file is over 450Mb large!).

There are 2 modes of installing:

  1. Net Installer
  2. Package installer.

 

The Net Installer will download a 20Mb file. This installer will download components that you need. However, you need to be connected to the internet to run this installer.
The Package installer is the entire WebLogic 8.1 server in one executable. This file is rather large, 259Mb.

Once you have downloaded the installer, just execute it and follow the prompts. It is a good idea to install the samples (the default configuration will work just fine.)

Just remember that the directory structure is different, mostly following the Windows conventions.

 

In general, after you install weblogic server, you run the QuickStart to create a new domain configuration.

 

This by default, creates a domain called "mydomain".

 

The setup dialogs ask you to enter the name (default is "myserver"), listen address, listen port and the admin username and password.
YOU choose what the username and password is (the default username is "weblogic" - you CAN change this to "system".

 

The default directory structure is:

c:\bea\user_projects\domains\mydomain
(this is the equivalent to your usual ~/webLogic/$USER directory)

 

Note that it DOESN'T install the DefaultWebApp.
To install this:

(1)     go back to QuickStart

(2)   Create/Extend Domain configuration

(3)   Extend an existing WebLogic configuration

(4)   Select mydomain in the filetree (hint: expand the domains folder to see this. Be careful, you *must* select it explicitly)

(5)   Select the DefaultWebApp configuration extension

(6)   *IMPORTANT STEP*: When you get to the "Create WebLogic Configuration" screen, choose the Configuration Applications Location by pressing the Browse button. By default, Weblogic on Windows places the DefaultWebApp in c:\bea\user_projects\applications\mydomain.

(7)   Instead, select
c:\bea\user_projects\domains\mydomain\applications
You then press Import to load it.

(8)   Note that in the console, instead of the domain being your faculty userid, it will display mydomain.

 

 

 

 

 

You cannot access the lab workstations from OUTSIDE UTS using these instructions. See Q18 for external access.

 

Basically, you will need to use SSH to connect to a workstation, and then use a recent browser to access the WebLogic console.

 

*CAUTION*: You need to CHECK that no one else is using WebLogic on the target workstation. Please use common sense and courtesy when you do this as someone may need the workstation for their lab or assignment work. Check the lab schedules on the start.it.uts.edu.au web site to ensure the room isn't booked.

Step1: Determine the name of the workstation.

You should have a workstation that you are using in the labs. This is displayed on the login prompt and on the X-Console window. This looks something like: zigzager The full internet name of this machine would be zigzager.it.uts.edu.au

Step2: Check that the machine isn't being used.

The simplest method is to use a browser to see if WebLogic is running
ie:
http://zigzager.it.uts.edu.au:7001/console.
If you get an error about the server not being found or not responding, this is GOOD and means no one is currently running WebLogic.
We will do one more check to see if anyone is using the machine.

Step3: Use an SSH compliant client to access this machine.

We highly recommend using:

  • SSH (on the unix machines)
  • Putty (on the FIT Windows lab machines)
  • TeraTerm Pro (on the ITD windows lab machines)

This is very much like Telnet, except it is encrypted. If the client asks you to accept a key, please do so.
You should get a prompt to enter your userid and password.
This provides a session much like the Xterminal consoles you get on the unix machines.
You SHOULD check that no one else is using the workstation at the moment.
Type:
who at the commmand prompt to check.

Step4: Use the session

You should start multiple sessions with your SSH client. One should be used to start WebLogic (hint: wlstart). The other can be used for other purposes (eg: wlstop)

Step5: Access WebLogic remotely via a browser

Where ever the lecture/lab notes refer to localhost, replace this with the full internet name of your machine. For example,
http://zigzager.it.uts.edu.au:7001/console
Don't forget to stop the WebLogic server cleanly when you are finished.

 

 

I get the following message:

The WebLogic Server did not start up properly.
Reason: weblogic.security.SecurityInitializationException: Authentication
denied: Bood identity not valid; The user name and/ or password from the
boot identity file (boot.properties) is not valid. The boot identity may
have been changed since the boot identity file was created. Please edit
and update the boot identity file with the proper values of username and
password. The first time the updated boot identity file is used to start
the server, these new values are encrypted.

This occurs if you have corrupted the userid/password entry in your ~/webLogic/$USER directory.

You can fix this by editing boot.properties and ensuring the following entries are added

username=systempassword=password

 

WebLogic will automagically update your boot.properties file with an encrypted version of these entries. This MAY look like the following

#Sun Aug 10 15:51:40 EST 2003password={3DES}Xsy8MY0hgZDcoUoXe6Lv/Q\=\=username={3DES}1XDkCIg77y8\=

 

 

Unfortunately, the main Oracle database, smaug.it.uts.edu.au , is firewalled from the rest of the internet - this means that you can't run it from home.

 

However, you can run any ODBC enabled database instead.

Refer to the link called "Microsoft Access example using JDBC-ODBC bridge" in the JDBC lab notes page

In this case, your dbdriver is now
sun.jdbc.odbc.JdbcOdbcDriver
and your dburl is
jdbc:odbc:mydsn
(where you define mydsn in the Windows Control Panel -> Data Sources (ODBC) )
For example, you can use Excel as your database (see ) for how to do this.
Note that the table name is the Sheet name in brackets
eg:
SELECT * FROM [Sheet1$] You will also have to create the excel spreadsheet by hand J!

NOTE: ODBC is not supported for database connection pools, data sources or EJB's in WebLogic!!!!

NOTE: You should use "native" JDBC drivers provided by (1) Weblogic and (2) the database server vendor where possible.

 

 

There is a known bug in the install of the Java JDK on the Linux machines. For most people, this has been fixed, but you might be the unlucky few with a problem.

You need to setup a Java Plugin on Mozilla/Galeon.

From a command prompt, you need type in the following commands

mkdir ~/.mozilla/plugins
ln -s /opt/JDK-1.4.2/jre/plugin/i386/ns610-gcc32/libjavaplugin_oji.so ~/.mozilla/plugins

You then need to restart the browser.

 

(See Q12 for access from machines WITHIN the UTS network

You are not allowed to directly access the faculties Linux workstations from the internet. Therefore, you will need to use SSH tunnelling to access the workstations from a remote location.

Basically, you will need to use SSH to connect to a workstation, and then use a recent browser to access the WebLogic console.

 

*CAUTION*: You need to CHECK that no one else is using WebLogic on the target workstation. Please use common sense and courtesy when you do this as someone may need the workstation for their lab or assignment work. Check the lab schedules on the start.it.uts.edu.au web site to ensure the room isn't booked.

Step1: Determine the name of the workstation.

You should have a workstation that you are using in the labs. This is displayed on the login prompt and on the X-Console window. This looks something like: workstation The full internet name of this machine would be workstation.it.uts.edu.au. For a list of workstation hostnames see:

Step2: Install an SSH client on your PC

We highly recommend using:

  • SSH (on unix machines)
  • Putty (on Windows machines) (see )

Step3a: Configure the SSH client on your PC to access rerun.it.uts.edu.au

If you have SSH installed, you can type:

ssh -l userid -L 7001:workstation:7001 rerun.it.uts.edu.au

Change the userid to your FIT userid, and workstation to the name of the remote Linux workstation.

If the client asks you to accept a key, please type in yes.
You will be asked for your password. Enter your FIT password here.

Once you are logged onto rerun, type ssh workstation to logon to the remote workstation.

Step3b: Configure the Putty client on your PC to access rerun.it.uts.edu.au

If you have Putty installed (see step 2), you have to create a profile to logon to the workstation.

We have provided a sample for you to modify here: 

Download this and EDIT this file. This file looks like this:

REGEDIT4[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\workstation]"Present"=dword:00000001"HostName"="rerun.it.uts.edu.au""Protocol"="ssh""PortNumber"=dword:00000016"Remotecommand"="ssh workstation""X11Forward"=dword:00000001"X11Display"="localhost:0""X11AuthType"=dword:00000001"PortForwardings"="L7001=workstation:7001,""compression"=dword:00000001

Change ALL references to the keyword "workstation" to the name of your target Linux workstation eg: zigzagger

You then need to load this into your Windows registry. You can do by either double clicking this file in Windows explorer, or typing in from a command line

regedit workstation.reg

You will be prompted by the registry editor add this into the registry. Press YES to continue

You should now start putty. You should see the entry appear in the saved sessions area of Putty.

Double click the entry to start your connection to the workstation.

If you are asked to accept a key for rerun or the workstation, press YES (or enter) to accept the key.

You will then be asked to enter your FIT userid and password. Please do so.

You will be asked to enter your password again. This is the workstation asking you to login, so enter your password again.

You now have a command prompt on the workstation!

Step4a: Weblogic remote setup

This step only needs to be done the very first time to set up the weblogic enviroment to work from a terminal if you have set up weblogic to be run under Eclipse only. Edit the file ~/.bash_profile and add the following two lines:

export JAVA_HOME=/usr/java/default
export MW_HOME=/opt/oracle-middleware


If you have just logged in via a terminal; either close and reopen the terminal session or execute the two lines above on the terminal to make sure the enviroment variables are set correctly.

Next, the weblogic environment needs to be configured using the following command:

/opt/oracle-middleware/configure.sh

This completes the setup tasks.

Step4b: Run Weblogic

To run Weblogic:

~/weblogic/startWebLogic.sh

Step5: Access WebLogic remotely via a browser

You now can access the weblogic server remotely, by referring to the localhost eg:

What is happening is that the SSH/Putty client will listen on port 7001 locally and will transparently connect you to the remote workstation at 7001 as well.

NOTE: if you shut down the SSH/Putty client, you will lose your connection to the remote workstation as well.

 

File transfer

Note that rerun.it.uts.edu.au shares your home directory with  your remote Linux workstation.

本站部分内容来自互联网,仅供学习和参考