|
Bob Stanneveld wrote: When the correct URL is passed to the constructor (checked it with Internet Explorer), the exception gets thrown.
I don't think this is your problem. I have tried URLs with real and bogus domains and, as long as they are correctly formed, then there is no problem. You need to catch the exception that is being thrown and check exactly what message it is producing. Also check the validity of all your variables within your exception handler.
It's time for a new signature.
|
|
|
|
|
Bob Stanneveld wrote: a bogus domain in the URL results in a correctly constructed URL object
The URL constructor does not check that the domain exists, it merely checks that the URL is properly formed according to the documented standard (whatever that happens to be).
Bob Stanneveld wrote: When the correct URL is passed to the constructor (checked it with Internet Explorer), the exception gets thrown
Do you mean that you have checked the actual string value being passed to the URL constructor at runtime? This works for me:
String a = "https://abc.crmapplication.com";
String b = "SSOID";
URL url = new URL(a + "/Services/Integration?command=ssoitsurl&ssoid=" + b);
If that exact same piece of code does not work for you, then I am at a loss to understand what is happening, I'm afraid.
|
|
|
|
|
Hi all,
I'm using the Talend Open Studio ETL tool for my integration. Unfortunately, this tool doesn't have advaneced debuging facilities and I don't have access to a nice IDE.
So after a couple of hours, pain and agony I discovered that the exception is thrown elsewhere in the code where a URL object is constructed with an empty string (a redirection URL should have been obtained from the reply from the server, but this is a different issue).
Thank you all for your help. Perhaps I'll post another question soon .
Kind regards,
Bob Stanneveld
|
|
|
|
|
Hello Friends
I am creating a applet based application in Netbeans.When I run that jar file on Desktop then it is running fine.But when I try to run this jar file on any other system then I am running this jar file thru batch file with specifying Heap space in that because without batch file it is not running.Is any way so that I can provide that heap space thru coding bcoz I dont want to do thru batch file?
here is My batch file:
@echo off
java -Xms512m -Xmx1024m -jar Test.jar
Thanks & Regards
Yogesh
|
|
|
|
|
dont make jar file....make executable jar file...it will run.
using
jar -cmf mainclass filename.jar packagename.
in this case,u will be able to run on other system too..
|
|
|
|
|
Thanks a Lot Arpita.
With ur suggestion I am able to load it without batch file.
Thx Again
Regards
Yogesh
|
|
|
|
|
read d calc problem shown below..in msg board by me..try .if u can...
|
|
|
|
|
Hello, everyone!I'm a freshman for JBPM.I found there were only create and delete functions in IdentityService,but no update.If I want to update the name of a group or user,how to do?
I thought I could delete the group first,then recreate it.However,when I delete the group,the memberships associated with this group will be also deleted.I have to rebuild those associations,and that's very troublesome.
Could you please tell me how to deal with it?
Thank you!
|
|
|
|
|
using method
JTextField tf=new JTextField("0");
tf.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
in a text field..& when i use concatenation of any number with 0 which is already in text field using as below..
tf.setText(tf.getText()+".0");
then dot is coming in in other side of 0...as .0
but if do as...
tf.setText(tf.getText()+"10");
tf.setText(tf.getText()+"+0");
i.e. "1" or "+" in place of ".",then answer is coming as usual... as 09 or 0+
any ideas????? m so confused...
|
|
|
|
|
don't do this
TextFiled.setText(TextFiled.getText())
please use some variables. There are some operations on numbers which can ruin your day. Always convert Numbers to String if you want to concat them in some way. And use String.concat, the + Operator is multible overloaded.
Operators in Java @ sun.com Doc
greets
Torsten
I never finish anyth...
|
|
|
|
|
me saying...dis problem is in case of right allignment only,not in d left.....y is it so?????
|
|
|
|
|
this shouldn't be a matter of alignment, this is a general problem. Also there is an
The TextField uses Strings, your input is an int-Value or float. Using the + Operator within this environment is risky. Also is there an hierachy of those operator-actions:
Hierachy of Operators @ princeton.edu
If you want to concat an certain string to another, no matter if the Value of the String is a number or not, always use String.concat()
in your given example:
JTextField tf=new JTextField("0");
tf.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
String strText = tf.getText();
String strNewText = strText.concat(strText, ".0");
tf.setText(strNewText);
and just in case:
you know, there are far better ways to give a number a certain format:
NumberFormat in Java doc @ sun.com
greets
Torsten
I never finish anyth...
|
|
|
|
|
|
i am doing project in voip in java eclipse..
now i am unable do this but short time (5 days ) remaining for review..
so please if anyone have coding me mail me arunbca_xxx@yahoo.co.in..
please its urgent
|
|
|
|
|
Did you read guideline #2 above?
|
|
|
|
|
sam_dheol wrote: i am doing project in voip in java eclipse..
Well it seems that you are not doing it as you appear not to have started yet. Or do I misunderstand and you have completed most of the project and are just stuck on one problem?
If you have not started then I doubt that you are going to complete it in 5 days.
BTW saying that it is urgent is unlikely to get people to write it for you.
It's time for a new signature.
|
|
|
|
|
Hello Friends
I am reading a file Like this here is the code below:
FileInputStream in = new FileInputStream(file);
Reader r = new InputStreamReader(in, "ISO-8859-1");
int intch;
while ((intch = r.read()) != -1) {
int temp = intch;
}
Previously I was putting all data into another file char by char like this
OutputStream out = new FileOutputStream(outFilePath);
and using out.write(temp); in while loop
And it was working fine.
But now The value coming in temp ,I want to store in a string.temp contains some int value of that charset and I want tht in string.
Any Suggestions??
Thanks In Advance.
Regards
Yogesh
|
|
|
|
|
Or Is there any way to read file line by line thru BufferedReader whose data is in ISO-8859-1 charset.
I tried like this even
this(new BufferedReader(new InputStreamReader(new FileInputStream(file),"ISO-8859-1")));
but bufferedReader is coming null.
Any Ideas??
Regards
Yogesh
|
|
|
|
|
I'm kind of new to this whole Java thing but there is a readLine() method on BufferedReader. How about something like this? ISO-8859 is a standard 8 bit character encoding so you shouldn't have problems reading the file.
<br />
String line;<br />
BufferedReader br = new BufferedReader(new FileReader(fileName));<br />
<br />
while ((line = br.readLine()) != null) {<br />
}<br />
<br />
br.close();<br />
|
|
|
|
|
I already Tried like this but bufferedReader is coming null.
And moreover it would be better if somebody suggest how can I convert each ISO-8859-1 character into String Bcoz I have to do some decoding for each character.
Thanks
Yogesh
|
|
|
|
|
What do you mean "bufferedReader is coming null"?
If I do this:
BufferedReader br = new BufferedReader(new FileReader(fileName));
then either I will get a BufferedReader created or I will get a FileNotFoundException. I can't quite see how you are getting a null here.
If file encoding is a problem for you then use InputStreamReader:
http://java.sun.com/docs/books/tutorial/i18n/text/stream.html[^]
|
|
|
|
|
Thx a Lot David.Tht link is very helpful and solves my prob.
And actually bufferedReader.readLine is coming null tht i just forget to write.
Anyway,Thx again.
Regards
Yogesh
|
|
|
|
|
Hi
There is no problem to convert JSON which looks like this:
"{\"response\": {\"Code\":200, \"Text\":\"Ok\", \"Id\":\"123\"}}
to the following object:
public class JsonCL
{
private int Code;
private String Text;
private int Id;
setters;
getters;
}
But what about the JSON, which contains arrays of data, and nested arrays?
For example:
{\"response\": {\"Code\":200, \"Text\":\"Ok\", \"Id\":\"123\", \"data\":{\"groups\": [{\"key1\":\"value1\", \"nestedData\":[{\"key1\":\"value1\", \"key2\":\"value2\", \"key3\":\"value3\"},{\"key1\":\"value4\", \"key2\":\"value5\", \"key3\":\"value6\"}]},{\"key1\":\"value2\", \"nestedData\": [{\"key1\":\"value7\", \"key2\":\"value8\", \"key3\":\"value9\"},{\"key1\":\"value10\", \"key2\":\"value11\", \"key3\":\"value12\"}]}]}}}
How can I convert such JSON into java object?
Thanks!
|
|
|
|
|
|
Hello all dear friends
I was wondering if anyone can helps me, I'm doing my final year project and it's on VPN in Java , so can anybody provides me with an idea, tip or anything to do in VPN and I'll be so thankful
The way of Professional softwares start in two:
Simple codes and develop it.
Simple but effective ideas.
|
|
|
|