Medes Agri

Greenhorn
+ Follow
since Jul 07, 2006
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 Medes Agri

thanks , do you mean mod_jk connector, i used following link and install it

http://archive.apache.org/dist/jakarta/tomcat-connectors/jk/source/jk-1.2.15/
17 years ago
Hi,

I am newbie at tomcat, I have installed it (5.5.17) under /usr/lib/ when i browse to http://localhost i get default apache page, and when i browse to htt://localhost:8080 I get default tomcat page and i can run the examples.

I have two problem, when i change the port to 80 in server.xml to get default tomcat page when you run http://localhost, it does not work it generate connection was refused....

somebody told me that i must create a connection between apache and tomcat I installed jakarta-tomcat-connectors-1.2.15 but when i run following commandos
> ./configure --with-apxs=/usr/bin/apxs2

after a while it generates following:

......
need to check for Perl first, apxs depends on it...
checking for perl... /usr/bin/perl
could not find /usr/bin/apxs2
configure: error: You must specify a valid --with-apxs path

but i know i have apxs2 under /usr/bin and i see it.

how i can solve my problem, thanks

i am newbe and need som description.
17 years ago
Hi all,

now I have created my applications but I think it does not work correctly.

I have two servers and one client , the client must get data from the servers simultaneously.

It get the data from them, but it sometimes does not work correctly, and it writes the data from one of the servers.
here is my code.

[ July 10, 2006: Message edited by: Medes Agri ]
17 years ago
I used catch(IOException) {e.printStackTrace();

and the result is

init:
deps-jar:
Compiling 3 source files to C:\JavaProjects\OneClientTwoServer\build\classes

Note: Recompile with -Xlint:unchecked for details.
compile:
run:
java.net.BindException: Address already in use: JVM_Bind
Server 1
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at java.net.ServerSocket.<init>(ServerSocket.java:97)
at oneclienttwoserver.ServerOne.<init>(ServerOne.java:22)
at oneclienttwoserver.Main.main(Main.java:30)
FAILED TO HOST ON 7500
BUILD SUCCESSFUL (total time: 0 seconds)

how it could use port 7500 when it generated exceptions always
[ July 10, 2006: Message edited by: Medes Agri ]
17 years ago
thank you,

I changed to catch(Exception e)instead.
and moved MyServerSocket = new ServerSocket(port); to the accept method

but now it generates


FAILED TO HOST ON 7500
[ July 10, 2006: Message edited by: Medes Agri ]
17 years ago
Thanks,

here is MyServer


public class MyServer
{
private ServerSocket MyServerSocket = null;
ArrayList words = new ArrayList();
ArrayList numbers = new ArrayList();

public MyServer(int port)
{
try
{
MyServerSocket = new ServerSocket(port);
}catch(IOException e){}
}

public void accept()
{
try
{
System.out.println("Server 1");
Socket s;
int ThreadId = 0;
while(true)
{
s = MyServerSocket.accept();
ThreadId++;


and I have called MyServer as i wrote in my first topic
17 years ago
yes,

line 41 is s = MyServerSocket.accept();

s is socket.
17 years ago
Hi,

I have created a server application (very simple) when i run it by using JCreator it goes well and it wates untill a client connect on it.

for the first time i used NetBeans and I made my first Java Application I added my Server to the project and removed the main method of the server.

the main method of the Main class of my project looks like this.

public static void main(String[] args)
{
int port = 7500;
MyServer MS = new MyServer(port);
MS.accept();
}

when i compile it , it goes well and it does not generate any error but when i run my project i get following error:

Exception in thread "main" java.lang.NullPointerException
at MyPackage.MyServer.accept(MyServer.java:41)


thanks for your help
17 years ago
Hello everybody,

I want to do an applet that connects a server , (send and get strings).

I can do applet but I dont know how must an applet connnect to a server,

Must I use socket connection or there is another way to connect a server by an applet?

I mean when you browse to a web page and click a button and it opens an applet and you write a string in a text area and click a button to send your string to a server, what happens ? has this applet used socket connection?

thanks for your response
[ July 07, 2006: Message edited by: Medes Agri ]
17 years ago
Thank you so much,

what i must to do know? what is the answer, do i use while(in.readLine() != null) instead of while(in.ready()) ?

do i must have more on my servers if i just want that thay send a string to the client?

thanks again.
17 years ago
Hi,

there is a client and two servers. the client must communicate with them simultaneously and get data from them (a string).

I have used threading and it works but with a little problem.

the problem is when i exceute the client, sometimes it gets nothing from servers it just generates "press any key to continue ..." and sometimes it gets data from one of the servers and sometimes it gets the data from both and it works correct. I dont know why?

I am very gratefull for your response and advices

here is a bit of my code:
17 years ago