Alexander Cowie

Greenhorn
+ Follow
since Mar 25, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Alexander Cowie

Hi all, i hope someone can help me. Im new to tomcat and have just installed tomcat 6.0 i had a few issues setting the CATALINA_HOME ENV VAR but i have managed to get this to work. but i appears to not be saved, when i view the environment vars in the control panel it is as it should be(C:\Program Files\apache-tomcat-6.0.32) but i have to set it again from the command line in order for it to work??

in addition to this when i try to compile a servlet i get the error (package javax.servlet.http does not exist) i understand this is due to tomcat not being on the CLASSPATH. I have set the CLASSPATH ENV VAR to (.;C:\Program Files\apache-tomcat-6.0.32\lib\servlet-api.jar\;) but this has not helped.

any advice on this matter will be gratefully received

thanks in advance Alex
13 years ago
Hi guys wonder if anyone can help me, im trying to write a peer to peer client server application. The app should connect to a server which performs a look up and returns the ip address and port number of the client that holds a particular file(this part works). The client should then send the name of the file to the client that has it, which should then return the file. This part is working to some extent (it connects to the client and sends the name of the file). But i am having trouble receiving the response. For the purpose of testing im just sending a string as the response. The approach i have taken is to run a server in a thread within the client, from the results i have been getting i believe the send method is sending the string, but the thread i written to listen for the incoming response (IncomingSong) is not seeing it. I feel that somehow the response is being sent before the listening thread is active. Please see my code below, i have posted the whole client class apologies if this was not necessary.


Thanks in advance ALex
Hi guys i am having some trouble reading a serialized object. I wrote some code to store login details, i had the serializing and reading of this information working but needed to change my approach. I have changed my code as to store the login info as an object, instead of storing each variable individually. My code for serializing seems to work fine but i will include that anyway.


Here is the code that is not working
I am getting this error msg im getting: java.lang.ClassCastException: SystemUser cannot be cast to [C



thanks in advance for any comments.

13 years ago
hi guys i have decided to change the way in which my login info in my earlier post is stored. Ihave taken the approach of creating a SystemUser object that contains all of the relevent login info. I have managed to serialize the object, but i am having some trouble when tring to deserialize again.
this is the code im using to serialize:


this is the code im using to deserialize

im getting this error msg: .ClassCastException: SystemUser cannot be cast to [C

any advice on this will appreciated
thanks in advanve Alex
13 years ago
thanks guys, that has solved my problem.
and apologies for the sloppy post
13 years ago
Hi there, i am attempting to write a simple login system in java. I have taken the approach of Serializing the login data of the user (username and password), which seems to work just fine. I am then trying to deSerialize the username and password in order to check them against the username and password entered in a JText/JpasswordField in my login gui class. This does not seem to work, please see my code below. I welcome any advice on the approach i am taking for this login system, as im not sure if i am going about this in the right way at all .

thanks in advance
Alex

13 years ago
hey thanks man, i dont think i explained the problem very well so i will try to make it a little clearer.lol

i have a String Ex. "BLUE"

i want to place each character of the String at a different index of the ArrayList.

s = word.charAt(i);
System.out.print(s);
by using the charAt() im getting the desired Char from the String

wordList.set(i, s);
but then when i try and set this to the ArrayList it doesnt work.
ive tried converting the value of s to a String but cant seem to do it?
14 years ago
I am having some trouble getting a string into an array list, below is the code i have tried. Any advice on where i am going wrong would be great.

while(i != (word.length())){
s = word.charAt(i);
System.out.print(s);
wordList.set(i, s);
i++;
}

thanks in advance.
14 years ago