This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Websphere and the fly likes Error running application on WSAD in local system! Problem explained in detail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Error running application on WSAD in local system! Problem explained in detail " Watch "Error running application on WSAD in local system! Problem explained in detail " New topic
Author

Error running application on WSAD in local system! Problem explained in detail

Andrew Yadlapa
Greenhorn

Joined: Jun 13, 2007
Posts: 10
Hi, I am new to working on WSAD . We have an application that needs the user to log in before he can do anything . Basically the login page is the first page.

This application is running in our runtime environment well and good at the Data Center. The client wanted to make a couple of changes and they wanted me to do that on WSAD. But when I deploy that ear file onto WSAD of my system and try to run it, it doesn't seem to be catching up the servlets well . Is it because of my system unable to connect to the DataBase tables(DB2) and pull up my login info ? I get the connectivity issues mentioned below as soon as I try to run the application. The problem I'm getting is - It says

1) Did not realize init() exception thrown by servlet DownLoadServlet: javax.servlet.ServletException: TcpIpConnection.connect(): Cannot call connect method until both IP address and port have been set.

2) [Servlet Error]-[DownLoadServlet]: Failed to load servlet: java.net.UnknownHostException: TcpIpConnection.connect(): Cannot call connect method until both IP address and port have been set.

The "cannot call ...bla bla bla was set by us to notify if either port no or IP Address are not specified."


I gave it the properties file giving it which port to connect to and which ip address to connect to. But alas it won't. Am I placing it in the wrong place ? Are there some settings/preferences that we need to set for WSAD before it can actually pick up connection issues from application? Please clarify and help me out.
Thanks,
Your dearest dumb fellow
Andrew Yadlapa
Greenhorn

Joined: Jun 13, 2007
Posts: 10
Here is a prt of error log I get when I try to log in.
It keeps on saying port number is 0 and IP addres is ""
[6/13/07 9:35:39:828 PDT] 413e49ce WebGroup I SRVE0180I: [TCM] [/tcm] [Servlet.LOG]: /index.jsp: init
[6/13/07 9:55:43:688 PDT] 5bf789ce WebGroup I SRVE0180I: [TCM] [/tcm] [Servlet.LOG]: /Pages/index_login.jsp: init
[6/13/07 9:56:00:110 PDT] 5a73c9ce SystemOut O Wed Jun 13 09:56:00 PDT 2007: gov.ca.dhs.tcm.user.UserServlet: UserServlet.doTask(): Page=UserLogin, Bttn=Login
Wed Jun 13 09:56:00 PDT 2007: gov.ca.dhs.tcm.user.UserServlet: problem reading namespace bindings : javax.naming.NameNotFoundException: Context: localhost/nodes/localhost/servers/server1, name: tcm/PORT: First component in name tcm/PORT not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL mg.org/CosNaming/NamingContext/NotFound:1.0]
Wed Jun 13 09:56:00 PDT 2007: gov.ca.dhs.tcm.user.UserServlet: properties file has a non numeric port number: java.lang.NumberFormatException: For input string: ""
Wed Jun 13 09:56:00 PDT 2007: gov.ca.dhs.networking.TcpIpConnection: TcpIpConnection.setPort(): port is 0
Wed Jun 13 09:56:00 PDT 2007: gov.ca.dhs.tcm.user.UserServlet: problem reading namespace bindings : javax.naming.NameNotFoundException: Context: localhost/nodes/localhost/servers/server1, name: tcm/IP_ADDRESS: First component in name tcm/IP_ADDRESS not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL mg.org/CosNaming/NamingContext/NotFound:1.0]
Wed Jun 13 09:56:00 PDT 2007: gov.ca.dhs.networking.TcpIpConnection: TcpIpConnection.setIpAddr(): ip address is
Wed Jun 13 09:56:00 PDT 2007: gov.ca.dhs.networking.TcpIpConnection: TcpIpConnection.connect(): java.net.UnknownHostException: TcpIpConnection.connect(): Cannot call connect method until both IP address and port have been set.
Wed Jun 13 09:56:00 PDT 2007: gov.ca.dhs.tcm.user.UserDataBean: Problem communicating with mainframe: java.net.UnknownHostException: TcpIpConnection.connect(): Cannot call connect method until both IP address and port have been set.
Wed Jun 13 09:56:00 PDT 2007: gov.ca.dhs.tcm.user.UserServlet: UserServlet.gotoPage(): Page=6
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

"Dumb Fellow", welcome to JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must contain your first name, a space, then your last name. Fictitious names are not allowed. (And aren't you taking self-deprecation a bit far?)

Please edit your profile and correct your display name since accounts with invalid display names will be deleted.
Andrew Yadlapa
Greenhorn

Joined: Jun 13, 2007
Posts: 10
hey just chanegd the name.... Thanks.
Andrew Yadlapa
Greenhorn

Joined: Jun 13, 2007
Posts: 10
Hey Bear,

I just added my last name too. Hey I posted the same question in servlets and JDBC coz I thought it had to deal with them too and I would miss some of the people who are experienced in servlets and JDBC here.It didn't mean to spam/something like that. Hope you understand
Aaah first time here. Is it always this strict
Thanks,
Andrew
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979
Wed Jun 13 09:56:00 PDT 2007: gov.ca.dhs.tcm.user.UserServlet: properties file has a non numeric port number: java.lang.NumberFormatException: For input string: ""
Andrew Yadlapa
Greenhorn

Joined: Jun 13, 2007
Posts: 10
This is my properties file

#Wed Aug 16 16:01:24 PDT 2000
PORT=2997 //this is a numeric still getting the error
IP_ADDRESS=*********** / just blocked this on security concern
REGION=_UNIT_TEST
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Thanks for fixing your name, Andrew. (And yes, cross-posting is a no-no. It does waste people's time.)

Anyway, it looks like your application isn't finding your properties file.

Are your servlets trying to read the properties file and open their own database connections based on its contents? If so, you aren't really working within the JEE framework. First, there's a place for application parameters that supersedes properties files. And second, there's a place to configure connection pools so you don't have to write your own code to open JDBC connections.

But if you're not ready to convert your code to The JEE Way, then how about posting the part that tries to read the properties file and open the connection?
Andrew Yadlapa
Greenhorn

Joined: Jun 13, 2007
Posts: 10
That's ok Paul ... Didn't know that initially and moreover was a bit disturbed with the kinda silly error, I've been trying to rectify for the last two days.
The thing is .... This is the same ear I've taken from the production server...The application is running well there...so that obviously means there is no problem with the coding and stuff Right?

But I have a problem there. Donno if my thinking is correct..Kinda new to this stuff.

We use a TCPIP connection object created to communicate.
They initialized ipaddress with "" and port number with 0, and then try and catch an exception when ipaddress=="" and port number ==0
and then comes the code that sets up sockets with the ipaddress and port number which looks like they never get executed.
The code follows:
Socket sckt;
InputStream inStrm;
OutputStream otStrm;
String ipAddr = "";
int port = 0;
byte[] buffer;
boolean debug = false;

//--------------------------------------------------------------
public void connect() throws UnknownHostException, IOException {

try {
if(ipAddr.equals("") || port == 0)
throw new UnknownHostException("TcpIpConnection.connect(): Cannot call connect method until both IP address and port have been set.");

// setup sockets, connect, create streams to the mainframe.
gov.ca.dhs.tcm.Log.write(this.getClass().getName(), "TcpIpConnection.connect(): will connect to " + ipAddr + ":" + port);
sckt = new Socket(ipAddr, port);
gov.ca.dhs.tcm.Log.write(this.getClass().getName(), "TcpIpConnection.connect(): connected");

inStrm = sckt.getInputStream();
otStrm = sckt.getOutputStream();
gov.ca.dhs.tcm.Log.write(this.getClass().getName(), "TcpIpConnection.connect(): streams established");
// if an exception occurs kill the streams so that further method calls will fail.
}
catch(UnknownHostException _excpt) {
gov.ca.dhs.tcm.Log.write(this.getClass().getName(), "TcpIpConnection.connect(): " + _excpt.toString());
try { if(inStrm != null) inStrm.close(); } catch(IOException _excpt2) {;}
try { if(otStrm != null) otStrm.close(); } catch(IOException _excpt2) {;}
try { if(sckt != null) sckt.close(); sckt = null; } catch(IOException _excpt2) {;}
throw _excpt;

// if an exception occurs kill the streams so that further method calls will fail.
}
catch(IOException _excpt) {
gov.ca.dhs.tcm.Log.write(this.getClass().getName(), "TcpIpConnection.connect(): " + _excpt.toString());
try { if(inStrm != null) inStrm.close(); } catch(IOException _excpt2) {;}
try { if(otStrm != null) otStrm.close(); } catch(IOException _excpt2) {;}
try { if(sckt != null) sckt.close(); sckt = null; } catch(IOException _excpt2) {;}

throw _excpt;
}
return;

Just wondering how it is able to contact the backend.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error running application on WSAD in local system! Problem explained in detail