ServerSocket problem, please help, thanks a lot
Hi,
My program has a method as follow:
private ServerSocket serverSocket;
public void Connecting( )
. try
. serverSocket = new ServerSocket(1234);
. catch (Exception e) {}
. while (true)
. try
. Socket socket = serverSocket.accept();
. socket.close();
. break;
. catch (Exception e) {System.out.println(e.getMessage( );}
The first time I called this method, it worked fine. But the second time I called this method, it didn't work. An exception was caught and I got the message as follow:
Address already in use: JVM_Bind
Would you please advise how I can change the method so that each time I call this method and the serverSocket will be able to setup correctly (given that I want to use the same port again and again) ?
Thanks for your help.
Regards,
Jackie
sigh
Continue in original thread:
http://forum.java.sun.com/thread.jspa?threadID=703568
Similar Messages
-
i am using firefox 3.6.17 i upgraded it to 4.1.but it does not work properly sometimes it opens every website and most of the time it does not work . so what is the problem please help . thank you
Did you check your security software (firewall)?
A possible cause is security software (firewall) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
Remove all rules for Firefox from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process.
See:
* [[Server not found]]
* [[Firewalls]] -
I'm missing a bracket or parentheses somewhere, please help, THANKS A LOT!
Here's my code: it's extremely lengthy!
public class MainTester
public static void main (String[] args)
System.out.println("Hello program user, I'm pretty curious about your grades so let me ask you a few questions!");
System.out.println(" ");
InputStreamReader istream = new InputStreamReader(System.in);
BufferedReader bufRead = new BufferedReader(istream);
Grade g = new Grade();
try
System.out.print("Please enter your grade(A letter such as (A), (B-)):");
String firstGrade = bufRead.readLine();
System.out.println(" ");
System.out.print("Your GPA would be:");
g.getGPA(firstGrade);
System.out.println("Unless of course you're lying to me...");
System.out.println("But let's move on...would you like to be asked your grade again?(Type y/yes to continue or type n/no to terminate the program)");
String usersRequest = bufRead.readLine();
InputChecker checkIt = new InputChecker(usersRequest);
if (checkIt.itIsTrue())
System.out.println("I see you want to continue, alright then!");
System.out.println(" ");
System.out.print("Please enter another grade:");
String secondGrade = bufRead.readLine();
System.out.println(" ");
System.out.print("Your GPA would be:");
g.getGPA(secondGrade);
System.out.println("Unless of course you're lying to me again...:");
System.out.println(" ");
System.out.print("Oh well...do you want to asked your grade again?:");
String usersRequest2 = bufRead.readLine();
InputChecker checkIt2 = new Input Checker(usersRequest2); <<<<<<<<--It keeps highlighting this part and
^^^^^^^^saying I need a parentheses or backet around here
if (checkIt.itIsTrue())
System.out.println("I see you want to continue, alright then!");
System.out.println(" ");
System.out.print("Please enter another grade:");
String secondGrade = bufRead.readLine();
System.out.println(" ");
System.out.print("Your GPA would be:");
g.getGPA(thirdGrade);
System.out.println("Unless of course you're lying to me again...:");
System.out.println(" ");
System.out.println("Since there are only 3 semesters in the 2007 part of this school year, the program will terminate since it already asked your 3 grades");
System.out.println("Have a nice day!")
else if (checkIt.itIsFalse())
System.out.println("Alright then, the program is terminating, have a nice day!");
else
System.out.println("Ok the program will terminate anyway since you put an invalid input! Have a nice day!");
else if (checkIt.itIsFalse())
System.out.println("The program will be terminating, have a nice day!");
else
System.out.println("Ok the program will terminate anyway sicne you put an invalid input! Have a nice day!");
catch (IOException err)
//Nothing Necessarry
}Thanks to everyone who tries to attempt to answer this. Really appreciate your time to take help.check that you haven't mislabeled some of the later "checkIt" variables. I get the feeling that right after you create checkIt2, you don't want:
if (checkIt2.itIsTrue()) but rather want:
if (checkIt2.itIsTrue()) Also check the same variable for the same problem further on down your code.
Finally, Is it possible for both checkIt.itIsTrue() and checkIt.itIsFalse() to be false at the same time? What I'm asking is will your program ever get to this statement:
else
System.out.println("Ok the program will terminate anyway sicne you put an invalid input! Have a nice day!"); -
Power PC G4 running OSX 10.3.9 - software problems - Please help, thanks
After downloading Software Update 2007-004, all of my applications will start up partially, but will soon stop loading and give me an endless clock. If anyone has any suggestions on how to fix this it would be greatly appreciated. Thanks
Have you tried repairing permissions on your startup disk using Disk Utility?
Matt -
Could JMF and FrameAcess do these jobs? Plz help, Thanks a lot!
I have an encrypted video, every frame is encrypted. Could JMF decrypt this video and play it during the decryption? Could The sun example FrameAccess.java read encrypted information on each frame of video?
I am new, please help, Thanks a lot!!!
Edited by: attarwang on Dec 9, 2008 11:05 PM
Edited by: attarwang on Dec 9, 2008 11:29 PMthanks againIII
I have study the function "process", but it is too hard to me. could you give some tips?
how to get every frames of the video and modified the data of a frame and play it ?
use the following code?how?
public int process(Buffer in, Buffer out) {
// This is the "Callback" to access individual frames.
accessFrame(in);
// Swap the data between the input & output.
Object data = in.getData();
in.setData(out.getData());
out.setData(data);
// Copy the input attributes to the output
out.setFormat(in.getFormat());
out.setLength(in.getLength());
out.setOffset(in.getOffset());
return BUFFER_PROCESSED_OK;
} -
MacBook Pro (15-inch, Late 2011) It turns on for less than 60 sec thens shutsoff by itself, it won't load to recovery hd partition, won't load to mac OS and already replaced with new MLB, but the problem still persist.. able to run ASD EFI but ASD OS wont work.please help thanks in advance
Holy crap, I got it to work.
Essentially, I just waited until DiskWarrior reached Step 9 and told it to skip the step before it had a chance to freeze. It skipped successfully, moved on, rebuilt and replaced the faulty directory files.
So far the computer is booting like normal, I can log in, and I'm currently copying all of the data to an external as I type this.
I still have no idea why the computer wouldn't mount or boot to any drive, but I guess I'll deal with that later. -
my iphone is on recovery mode and i can´t turn on it, when i try to recover it from itunes i get: unknown error (36), i´ve tried to do lot of things but i can´t solve my problem. please help!!
Hi, i had the same problem. Try to find the file "apple" or "itunes" don't know it anymore exactly. Ahm well you need to delet any information or just plug in your iphone into an other computer. important is that your iphone never has been pluged in this computer before. This was what i did, and it worked!
-
I am billed 3 times for a same item. How can I get the problem fixed? Thanks a lot for yur help. nhuttan448
Go here:
http://www.apple.com/support/itunes/contact/
and follow the instructions to report the issue to the iTunes Store.
Regards. -
P6N Lots of problems please help
P6N Lots of problems please help
The setup is the following:
P4 D935 3.2gHz
P6N Diamond MS-7320 Bios 1.3V
Corsair XMS2-6400C4DHX
NX8600GT-TD512EZ/D2
Seagate Barracuda 7200 250Gb SataII 16Mb
Akasa 460W Dual Rail
Please help I have lots and lots of problems with lockups that can happen any time post , bios , loading vista and sometimes during OS. Some times will work ok play games etc. Already tried different combinations fitting the mem modules even tried and some pc4200 modules same problems. Spent lots of hours clocking the mems with different settings but non is stable. I am not interested in overcloking just to make it stable to start with. When is actually running is fine is more than enough for me. Already looked to lots of posts on the msi forum but… Since the cpu is old can I go back on an older bios version???? The Corsair modules have to run at 2.1V or is it possible to use them with slower setting. So confused so lost ….. please HELLPPPPP
Any help greatly appreciated.please, don't buy any more unneded parts. first find the problem then buy if no solutions available.
One thing I find with BIOS issues is to do a full clear.
1. disconnect the power cord from the power supply(turn switch to off if there is one.
2. hit the power switch to clear the power out of the system.
3. set the cmos jumper to clear and leave there if one is available.
4. Pull the battery.
5. carefully short out the battery connector on the motherboard to drain any power left.
6. press the clear cmos button and hold for 30sec minimum, if you didn't have a jumper to set.
7. replace battery, move jumper back, plug in power cord, turn on power sipply switch.
Now it should hopefully power up. go into BIOS and load optimized results. hit save and exit and when it gets back to the post screen, go back into bios and set your normal MB settings(ie. set boot devices, boot order, disable sound if using sound card, etc...)
go into your H/W Monitor section and list the CPU Vcore settings to make sure it is getting the power it needs. I just looked it up and it's suppose to run from 1.225v - 1.325v.
also, try your most generic ram you have with auto settings. the faster the ram usually the more volts they need and default volts are 1.8v for ram and sometimes faster chips have issues with lower volts.
Let me know how this works for you.
-=Mark=-
ps. make sure everything is unplugged from the computer you don't need. just cpu, 1 stick of ram, and video. and of course keyboad and mouse. Please make a signature with all your systems specs including make and model numbers. I hate guessing at solutions and I'd hate to see you buy any more unneccessary parts because of lack of information. -
Guys how to fix the audio problems of my itouch? The volume bar dosnt exist and the loudspeaker doesnt work. . .Sounds only works in headset please help thanks!!!!
Post this in the iPod Touch forum.
https://discussions.apple.com/community/ipod/ipod_touch
B-rock -
I have been trying to put some of my music and artwork, on youtube. Youtube says you need an encoder to upload music. But the problem is the only encoders available are for windows. Please help, thank you
The formats YouTube supports can be found here:
http://www.google.com/support/youtube/bin/answer.py?answer=55744
Since YouTube supports AAC, the file format iTunes uses by default, it's probable you don't need any sort of converter.
If you continue to have problems with uploading to YouTube, I'd suggest you ask for assistance in their forums:
http://www.google.com/support/forum/p/youtube?hl=en
Regards. -
Problem Please help me.....Let me know the area to look for it I am a DBA..Thanks in advance to let me know the cause and the area to look and fix it...
Server Error in '/' Application.
Problem with SAP/BAPI. SAP.Connector.RfcCommunicationException: Connect to message server failed Connect_PM MSHOST=prddb01.lamrc.com, R3NAME=PRD, GROUP=Prod HR PRD LOCATION CPIC (TCP/IP) on local host ERROR service 'sapmsPRD' unknown TIME Wed May 04 08:59:06 2005 RELEASE 620 COMPONENT NI (network interface) VERSION 36 RC -3 MODULE ninti.c LINE 428 DETAIL NiPServToNo SYSTEM CALL getservbyname COUNTER 1 at SAP.Connector.SAPConnection.ThrowRfcException(RFC_ERROR_INFO_EX rfcerrInfo, Encoding encoding, String languangeCode) at SAP.Connector.SAPConnection.Open() at SAP.Connector.SAPClient.RfcInvoke(String method, Object[] methodParamsIn) at SAP.Connector.SAPClient.SAPInvoke(String method, Object[] methodParamsIn) at SoftwareKeySAPG.SAPProxy1.Z_Bapi_Load_Kpi_Region(ZSOFT_KPI_REGIONS_MTable& Kpi_Regions, ZSOFT_PROD_TYPETable& Prod_Type) at SoftwareKeySAPG.SAPGSK.LoadKPIRegion(DataSet dsProduct)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Services.Protocols.SoapException: Problem with SAP/BAPI. SAP.Connector.RfcCommunicationException: Connect to message server failed Connect_PM MSHOST=prddb01.lamrc.com, R3NAME=PRD, GROUP=Prod HR PRD LOCATION CPIC (TCP/IP) on local host ERROR service 'sapmsPRD' unknown TIME Wed May 04 08:59:06 2005 RELEASE 620 COMPONENT NI (network interface) VERSION 36 RC -3 MODULE ninti.c LINE 428 DETAIL NiPServToNo SYSTEM CALL getservbyname COUNTER 1 at SAP.Connector.SAPConnection.ThrowRfcException(RFC_ERROR_INFO_EX rfcerrInfo, Encoding encoding, String languangeCode) at SAP.Connector.SAPConnection.Open() at SAP.Connector.SAPClient.RfcInvoke(String method, Object[] methodParamsIn) at SAP.Connector.SAPClient.SAPInvoke(String method, Object[] methodParamsIn) at SoftwareKeySAPG.SAPProxy1.Z_Bapi_Load_Kpi_Region(ZSOFT_KPI_REGIONS_MTable& Kpi_Regions, ZSOFT_PROD_TYPETable& Prod_Type) at SoftwareKeySAPG.SAPGSK.LoadKPIRegion(DataSet dsProduct)
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SoapException: Problem with SAP/BAPI.
SAP.Connector.RfcCommunicationException: Connect to message server failed
Connect_PM MSHOST=prddb01.lamrc.com, R3NAME=PRD, GROUP=Prod HR PRD
LOCATION CPIC (TCP/IP) on local host
ERROR service 'sapmsPRD' unknown
TIME Wed May 04 08:59:06 2005
RELEASE 620
COMPONENT NI (network interface)
VERSION 36
RC -3
MODULE ninti.c
LINE 428
DETAIL NiPServToNo
SYSTEM CALL getservbyname
COUNTER 1
at SAP.Connector.SAPConnection.ThrowRfcException(RFC_ERROR_INFO_EX rfcerrInfo, Encoding encoding, String languangeCode)
at SAP.Connector.SAPConnection.Open()
at SAP.Connector.SAPClient.RfcInvoke(String method, Object[] methodParamsIn)
at SAP.Connector.SAPClient.SAPInvoke(String method, Object[] methodParamsIn)
at SoftwareKeySAPG.SAPProxy1.Z_Bapi_Load_Kpi_Region(ZSOFT_KPI_REGIONS_MTable& Kpi_Regions, ZSOFT_PROD_TYPETable& Prod_Type)
at SoftwareKeySAPG.SAPGSK.LoadKPIRegion(DataSet dsProduct)]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +1503
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +218
SoftwareKeyUI.InstalledBaseDataWS.InstalledBaseData.LoadKPIRegionMulti(DataSet products)
SoftwareKeyUI.InstalledBaseDataAccess.LoadKPIRegionMulti(DataSet products)
SoftwareKeyUI.InstalledBase.GetRegionDetails(Int32 userId, String product, String regionType)
SoftwareKeyUI.FilteredAccess.GetRegionDetails(Int32 userId, String product, String regionType)
SoftwareKeyUI.search.LoadRegionDetails()
SoftwareKeyUI.search.regionType_SelectedIndexChanged(Object sender, EventArgs e)
System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs e) +108
System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +26
System.Web.UI.Page.RaiseChangedEvents() +115
System.Web.UI.Page.ProcessRequestMain() +1099The error is a very basic one - the sapmsPRD service is not known. You will have to go to <NT_ROOT>\system32\drivers\etc and add the entry sapmsPRD 3600 to this file.
This is basically telling the requester at what port to look for the message server.
C -
Problem Please help me.....Let me know the area to look for it
Problem Please help me.....Let me know the area to look for it I am a DBA..Thanks in advance to let me know the cause and the area to look and fix it...
Server Error in '/' Application.
Problem with SAP/BAPI. SAP.Connector.RfcCommunicationException: Connect to message server failed Connect_PM MSHOST=prddb01.lamrc.com, R3NAME=PRD, GROUP=Prod HR PRD LOCATION CPIC (TCP/IP) on local host ERROR service 'sapmsPRD' unknown TIME Wed May 04 08:59:06 2005 RELEASE 620 COMPONENT NI (network interface) VERSION 36 RC -3 MODULE ninti.c LINE 428 DETAIL NiPServToNo SYSTEM CALL getservbyname COUNTER 1 at SAP.Connector.SAPConnection.ThrowRfcException(RFC_ERROR_INFO_EX rfcerrInfo, Encoding encoding, String languangeCode) at SAP.Connector.SAPConnection.Open() at SAP.Connector.SAPClient.RfcInvoke(String method, Object[] methodParamsIn) at SAP.Connector.SAPClient.SAPInvoke(String method, Object[] methodParamsIn) at SoftwareKeySAPG.SAPProxy1.Z_Bapi_Load_Kpi_Region(ZSOFT_KPI_REGIONS_MTable& Kpi_Regions, ZSOFT_PROD_TYPETable& Prod_Type) at SoftwareKeySAPG.SAPGSK.LoadKPIRegion(DataSet dsProduct)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Services.Protocols.SoapException: Problem with SAP/BAPI. SAP.Connector.RfcCommunicationException: Connect to message server failed Connect_PM MSHOST=prddb01.lamrc.com, R3NAME=PRD, GROUP=Prod HR PRD LOCATION CPIC (TCP/IP) on local host ERROR service 'sapmsPRD' unknown TIME Wed May 04 08:59:06 2005 RELEASE 620 COMPONENT NI (network interface) VERSION 36 RC -3 MODULE ninti.c LINE 428 DETAIL NiPServToNo SYSTEM CALL getservbyname COUNTER 1 at SAP.Connector.SAPConnection.ThrowRfcException(RFC_ERROR_INFO_EX rfcerrInfo, Encoding encoding, String languangeCode) at SAP.Connector.SAPConnection.Open() at SAP.Connector.SAPClient.RfcInvoke(String method, Object[] methodParamsIn) at SAP.Connector.SAPClient.SAPInvoke(String method, Object[] methodParamsIn) at SoftwareKeySAPG.SAPProxy1.Z_Bapi_Load_Kpi_Region(ZSOFT_KPI_REGIONS_MTable& Kpi_Regions, ZSOFT_PROD_TYPETable& Prod_Type) at SoftwareKeySAPG.SAPGSK.LoadKPIRegion(DataSet dsProduct)
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SoapException: Problem with SAP/BAPI.
SAP.Connector.RfcCommunicationException: Connect to message server failed
Connect_PM MSHOST=prddb01.lamrc.com, R3NAME=PRD, GROUP=Prod HR PRD
LOCATION CPIC (TCP/IP) on local host
ERROR service 'sapmsPRD' unknown
TIME Wed May 04 08:59:06 2005
RELEASE 620
COMPONENT NI (network interface)
VERSION 36
RC -3
MODULE ninti.c
LINE 428
DETAIL NiPServToNo
SYSTEM CALL getservbyname
COUNTER 1
at SAP.Connector.SAPConnection.ThrowRfcException(RFC_ERROR_INFO_EX rfcerrInfo, Encoding encoding, String languangeCode)
at SAP.Connector.SAPConnection.Open()
at SAP.Connector.SAPClient.RfcInvoke(String method, Object[] methodParamsIn)
at SAP.Connector.SAPClient.SAPInvoke(String method, Object[] methodParamsIn)
at SoftwareKeySAPG.SAPProxy1.Z_Bapi_Load_Kpi_Region(ZSOFT_KPI_REGIONS_MTable& Kpi_Regions, ZSOFT_PROD_TYPETable& Prod_Type)
at SoftwareKeySAPG.SAPGSK.LoadKPIRegion(DataSet dsProduct)]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +1503
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +218
SoftwareKeyUI.InstalledBaseDataWS.InstalledBaseData.LoadKPIRegionMulti(DataSet products)
SoftwareKeyUI.InstalledBaseDataAccess.LoadKPIRegionMulti(DataSet products)
SoftwareKeyUI.InstalledBase.GetRegionDetails(Int32 userId, String product, String regionType)
SoftwareKeyUI.FilteredAccess.GetRegionDetails(Int32 userId, String product, String regionType)
SoftwareKeyUI.search.LoadRegionDetails()
SoftwareKeyUI.search.regionType_SelectedIndexChanged(Object sender, EventArgs e)
System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs e) +108
System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +26
System.Web.UI.Page.RaiseChangedEvents() +115
System.Web.UI.Page.ProcessRequestMain() +1099Hi
You should make a mapping for the service sapmsPRD in your /etc/services file (On Windows: C:WINDOWSSYSTEM32DRIVERSETCservices). If your instance number is 00 you will have to add the following entry:
sapmsPRD 3600/tcp
Good luck!
René van Es -
Dear Sirs,
I had just upgraded my OS to the OS X Mavericks. After doing so, I noticed the following changes:
1) My MS Outlook for Mac 2011 does not sync with my Mac book's calendar/contacts/notes.
2) My iPhone4s does not sync with my Mac book's calendar/contacts/notes anymore.
Please help, thank you.
aawwiiCorrect, USB local sync was taken away from iphones and ipads with 10.9.1 and 2. We are not allowed to speculate on rumours it might come back in 10.9.3 plus new iTunes. Either wait and see or explore Syncmate 5 beta free trial.
icloud still works.
Cant help with the Outlook problem. -
Iphone restoring PROBLEM PLEASE HELP! HANK U!
My ITunes not restoring my IPhone, it stuck on Restoring iPhone Softwear, I was trying to downgrade my iPhone softwear and did something to the hosts file and after that my iTunes would not let me Restoring my IPHONE Please HELP Thank U
I been trying different thing and I finally found a solution to fix this PROBLEM GO into finder, GO on the Straus bar select GO to folder, then type /ect/ then select the file hosts and right click open with text edit and delete 74.208.10.249 gs.apple.com and save and save to the desktop than drag it back it in to hosts file and replace it then restart your comp. then download iTunes again hope this help U out cause it work 4 ME
Maybe you are looking for
-
Left alignment issue with XML report having Excel as output..
Hello I am using XML Publisher report and the output format as Excel. When my output opens in Excel all numeric values are right justified and all characters values are left justified. I want numeric values also left justified.. How to achieve this?
-
Connect PowerMac G4 to 27" iMac
I would like to connect my G4 to my iMac and use the iMac as a video source for both. How do I do this?
-
How to draw symbol for avalanche diode in multisim ?
Hello all, I have to include a symbol for diode array in multisim... SP0503BAHT, can anyone please suggest how to draw it? I am very new to multisim... thanks, Now on LabVIEW 10.0 on Win7 Solved! Go to Solution.
-
Forms 6i availability? I'm Disappointed.
Here is my issue/question. It is obvious that 6i has been out for a WHILE! I have seen many posted messages, iTARS, etc referencing the availability of downloading forms updates, availablity of getting patches, etc. My company currently owns serveral
-
Planning based on availability of prt's
Hi, we plan our prod based on availability of dies. if same die available then only we schedule the prod order on certain day. die are specific to materials. is there any pp functionality whether certain dies are availble on certain day? can we do ca