f



java.sql.Time

Can somebody pls explain me why is the result of

System.out.println("Difference: " + new
java.sql.Time(Math.abs(java.sql.Time.valueOf("18:44:36").getTime() -
java.sql.Time.valueOf("08:44:36").getTime())));

-----> Difference: 11:00:00

When it is so obvious that it shoud be 10:00:00!!!!????
I really can't locate the problem, maybe there is some underlying
conversion that I'm not aware of???

Thx
Dejan
0
dejandj7 (2)
12/21/2003 9:25:19 AM
comp.lang.java.help 13340 articles. 0 followers. Post Follow

8 Replies
320 Views

Similar Articles

[PageSpeed] 19

"DeZZaN" <dejandj7@yahoo.com> wrote in message
news:37e1738e.0312210125.2d3d34f9@posting.google.com...
> Can somebody pls explain me why is the result of
>
> System.out.println("Difference: " + new
> java.sql.Time(Math.abs(java.sql.Time.valueOf("18:44:36").getTime() -
> java.sql.Time.valueOf("08:44:36").getTime())));
>
> -----> Difference: 11:00:00
>
> When it is so obvious that it shoud be 10:00:00!!!!????
> I really can't locate the problem, maybe there is some underlying
> conversion that I'm not aware of???

A simpler question would be why does:

System.out.println(new java.sql.Time(0));

give 01:00:00

System.out.println(java.sql.Time.valueOf("00:00:00").getTime()/(float)(60*60
*1000));

gives -1.0

System.out.println(java.sql.Time.valueOf("02:00:00").getTime()/(float)(60*60
*1000));

gives 1.0

System.out.println(new java.sql.Time(2*60*60*1000));

gives 03:00:00

sorry no explanation.

-- 
Mike W


0
spam19 (1056)
12/21/2003 11:46:57 AM
"VisionSet" <spam@ntlworld.com> wrote in message
news:iGfFb.7661$526.53728@newsfep4-glfd.server.ntli.net...
.....
> A simpler question would be why does:
>
> System.out.println(new java.sql.Time(0));
>
> give 01:00:00

An API ahead of it's time?     ;-)


0
andrew64 (796)
12/21/2003 6:39:41 PM
VisionSet wrote:

> "DeZZaN" <dejandj7@yahoo.com> wrote in message
> news:37e1738e.0312210125.2d3d34f9@posting.google.com...
> 
>>Can somebody pls explain me why is the result of
>>
>>System.out.println("Difference: " + new
>>java.sql.Time(Math.abs(java.sql.Time.valueOf("18:44:36").getTime() -
>>java.sql.Time.valueOf("08:44:36").getTime())));
>>
>>-----> Difference: 11:00:00
>>
>>When it is so obvious that it shoud be 10:00:00!!!!????
>>I really can't locate the problem, maybe there is some underlying
>>conversion that I'm not aware of???
> 
> 
> A simpler question would be why does:
> 
> System.out.println(new java.sql.Time(0));
> 
> give 01:00:00
> 
> System.out.println(java.sql.Time.valueOf("00:00:00").getTime()/(float)(60*60
> *1000));
> 
> gives -1.0
> 
> System.out.println(java.sql.Time.valueOf("02:00:00").getTime()/(float)(60*60
> *1000));
> 
> gives 1.0
> 
> System.out.println(new java.sql.Time(2*60*60*1000));
> 
> gives 03:00:00
> 
> sorry no explanation.

What time zone are you in?

02:00:00 GMT might well be output as 03:00:00 where you live.

0
noway4 (67)
12/22/2003 12:06:08 AM
DeZZaN wrote:
> 
> Can somebody pls explain me why is the result of
> 
> System.out.println("Difference: " + new
> java.sql.Time(Math.abs(java.sql.Time.valueOf("18:44:36").getTime() -
> java.sql.Time.valueOf("08:44:36").getTime())));
> 
> -----> Difference: 11:00:00
> 
> When it is so obvious that it shoud be 10:00:00!!!!????
> I really can't locate the problem, maybe there is some underlying
> conversion that I'm not aware of???
> 
> Thx
> Dejan

The underlying conversion is to GMT.

Your code has subtracted two longs, which does give the correct
answer.  The mistake you and Andrew are making is to convert that correct
result back into a Time object.  (You and Andrew seem to be on ECT, one
hour ahead of GMT.)

For calendar math, use Date after() and before() for comparison, but the
only standard Java classes that add (or with negative operand, subtract)
dates are the Calendar subclasses like java.util.GregorianCalendar.

Hey you guys think your results are wierd, look at mine (PST):

new Time( 2*60*60*1000): 6:00:00 PM
new Time(10*60*60*1000): 2:00:00 AM

This is because 2am GMT is 6pm here, and 10am is 2am.
Clear as mud, right?

HTH.  Tony Dahlman
---------------------------------------
a (no spam)d ahlman( a t )att global( d o t )ne t
0
adahlman (55)
12/22/2003 1:10:40 AM
DeZZaN wrote:
> 
> Can somebody pls explain me why is the result of
> 
> System.out.println("Difference: " + new
> java.sql.Time(Math.abs(java.sql.Time.valueOf("18:44:36").getTime() -
> java.sql.Time.valueOf("08:44:36").getTime())));
> 
> -----> Difference: 11:00:00
> 
> When it is so obvious that it shoud be 10:00:00!!!!????
> I really can't locate the problem, maybe there is some underlying
> conversion that I'm not aware of???
> 
> Thx
> Dejan

The underlying conversion is to GMT.

Your code has subtracted two longs, which does give the correct
answer.  The mistake you and Mike are making is to convert that correct
result back into a Time object.  (You and Mike seem to be on ECT, one
hour ahead of GMT.)

For calendar math, use Date after() and before() for comparison, but the
only standard Java classes that add (or with negative operand, subtract)
dates are the Calendar subclasses like java.util.GregorianCalendar.

Hey you guys think your results are wierd, look at mine (PST):

new Time( 2*60*60*1000): 6:00:00 PM
new Time(10*60*60*1000): 2:00:00 AM

This is because 2am GMT is 6pm here, and 10am is 2am.
Clear as mud, right?

HTH.  Tony Dahlman
-- 
---------------------------------------
a (no spam)d ahlman( a t )att global( d o t )ne t
0
adahlman (55)
12/22/2003 1:13:04 AM

"Tony Dahlman" <adahlman@jps.net.invalid> wrote in message
news:3FE64520.4E220B50@jps.net.invalid...
>
> The underlying conversion is to GMT.
>
> Your code has subtracted two longs, which does give the correct
> answer.  The mistake you and Mike are making is to convert that correct
> result back into a Time object.

> (You and Mike seem to be on ECT, one hour ahead of GMT.)

I am on GMT,

but you're right: time - time != time

-- 
Mike W


0
spam19 (1056)
12/22/2003 12:16:52 PM
VisionSet wrote:
> 
> "Tony Dahlman" <adahlman@jps.net.invalid> wrote in message
> news:3FE64520.4E220B50@jps.net.invalid...
> >
> > The underlying conversion is to GMT.
> >
> > Your code has subtracted two longs, which does give the correct
> > answer.  The mistake you and Mike are making is to convert that correct
> > result back into a Time object.
> 
> > (You and Mike seem to be on ECT, one hour ahead of GMT.)
> 
> I am on GMT,
> 
> but you're right: time - time != time
> 
> --
> Mike W

Mike,
Have you read this "JavaWorld" article on time zones in java:

http://www.javaworld.com/jw-10-2003/jw-1003-time.html

Good Luck,
Avi.
0
eat17 (21)
12/23/2003 1:33:02 AM
Angus wrote:
> 
> VisionSet wrote:
> >
> > "Tony Dahlman" <adahlman@jps.net.invalid> wrote in message
> > news:3FE64520.4E220B50@jps.net.invalid...
> > >
> > > The underlying conversion is to GMT.
> > >
> > > Your code has subtracted two longs, which does give the correct
> > > answer.  The mistake you and Mike are making is to convert that correct
> > > result back into a Time object.
> >
> > > (You and Mike seem to be on ECT, one hour ahead of GMT.)
> >
> > I am on GMT,
> >
> > but you're right: time - time != time
> >
> > --
> > Mike W
> 
> Mike,
> Have you read this "JavaWorld" article on time zones in java:
> 
> http://www.javaworld.com/jw-10-2003/jw-1003-time.html
> 
> Good Luck,
> Avi.

Thank you, Angus.
---------------------------------------
a (no spam)d ahlman( a t )att global( d o t )ne t
0
adahlman (55)
1/31/2004 2:33:51 AM
Reply:

Similar Artilces:

java.sql.SQLException: java.sql.Time
I get the following error message... java.sql.SQLException: Value '00:00:00 can not be represented as java.sql.Time >From the following SQL call... SELECT COUNT(pageurl) AS PageCount, pageurl, MAX(datetime) AS LastAccess, SUM(VisitLength) as TotalVisitLength, VisitLength, RecordNum, SUM(CASE WHEN VisitLength IS NULL THEN 1 ELSE 0 END) AS NullVisits FROM clubvisits WHERE groupid = #clubid# GROUP BY pageurl ORDER BY #OrderKey# I am using ColdFusion 7 on MySQL 4.1.12a. I'm not a Java programmer - I don't know any Java, but ColdFusion acts essentially as a script layer to J2EE, so for some reason it's throwing a Java error. I'm especially stuck, because I need to resolve this without programming any Java, and the Adobe forums for ColdFusion and MySQL groups are no help. The error refers to the "VisitLength" field which is a "time" data type in the database. In the MySQL documentation, it says that 00:00:00 is allowable for time (http://dev.mysql.com/doc/refman/4.1/ en/ time.html). So my question is, why is this error coming up if it's an allowable value? And is there anything I can do? >So my question is, why is this error coming up if it's an allowable >value? And is there anything I can do? one way is to store the values as raw ints or longs as far as SQL is concerned. -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com <mehatespam1085@yahoo.com> wrote... ...

java.sql.SQLException: java.sql.Time
I get the following error message... java.sql.SQLException: Value '00:00:00 can not be represented as java.sql.Time >From the following SQL call... SELECT COUNT(pageurl) AS PageCount, pageurl, MAX(datetime) AS LastAccess, SUM(VisitLength) as TotalVisitLength, VisitLength, RecordNum, SUM(CASE WHEN VisitLength IS NULL THEN 1 ELSE 0 END) AS NullVisits FROM clubvisits WHERE groupid = #clubid# GROUP BY pageurl ORDER BY #OrderKey# I am using ColdFusion 7 (not my choice - don't laugh) on MySQL 4.1.12a. The error refers to the "VisitLength" field which is a "time" da...

Java Java
Have my first Open Source Linux Java Project. Working on a second right now. Coming out with a distro called OPEN*WINDOWS. It will be at www.black-and-company.com tab wrote: > Have my first Open Source Linux Java Project. > Working on a second right now. > > Coming out with a distro called OPEN*WINDOWS. > > It will be at www.black-and-company.com > Wasn't that the whole point of Lindows? Oh, right, we didn't care for that either. tab wrote: > Have my first Open Source Linux Java Project. > Working on a second right now. > > Coming out with a ...

java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException
Hi, I am new to DB2. I am getting this error while loading the DB2Driver. I don't have any idea about where i might have gone wrong. please help me. Below is the stack trace. Stack Trace: java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException at COM.ibm.db2.jdbc.app.DB2Driver.SQLAllocEnv(Native Method) at COM.ibm.db2.jdbc.app.DB2Driver.<init>(DB2Driver.java:245) at COM.ibm.db2.jdbc.app.DB2Driver.<clinit>(DB2Driver.java:130) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:120) Thanks in advance, Ganesh Majji ganesh.m@gmail.com wrote: > I am new to DB2. I am getting this error while loading the DB2Driver. I > don't have any idea about where i might have gone wrong. please help > me. Unfortunately my crystal bowl stays dark because you didn't mentioned your operating system and which DB2 version you're using. For Windows, *nix and OS/2 please ensure that your application is using the db2java.zip from SQLLIB\java. Check if there are multiple db2jdbc.dll on your system, remove any extra db2jdbc.dll files on the system. Ensure that you can connect to DB2 with the DB2 workstation tools from your machine. sorry for not mentioning the system details. Operation System is SunOS (Solaris) and DB2 SDK 8.2.2 Thank you very much for the kind response, Ganesh Bernd Hohmann wrote: > ganesh.m@gmail...

Java in Java
Is it possible to download a Java app (applet etc?) and run it inside a desktop Java app? -- Dirk http://www.transcendence.me.uk/ - Transcendence UK http://www.theconsensus.org/ - A UK political party http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff Dirk Bruere at NeoPax wrote: > Is it possible to download a Java app (applet etc?) and run it inside a > desktop Java app? > Quite likely, but you won't necessarily get the same security model, unless you were careful about it. -- Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/&g...

java.lang.StringIndexOutOfBoundsException: String index out of range: 23 at java.lang.String.charAt(String.java:460)
Hi All I am having the torque3.1.jar and postgresql-7.4. I have compiled the new jdbc driver called as postgresql.jar and have placed it in the lib directory from where the ant scripts catch the jars. Whenever i try to access through torque gestList = BaseGestlistPeer.doSelect(new Criteria()); this error arises java.lang.StringIndexOutOfBoundsException: String index out of range: 23 at java.lang.String.charAt(String.java:460) at org.postgresql.jdbc2.ResultSet.toTimestamp(ResultSet.java:1653) at org.postgresql.jdbc2.ResultSet.getTimestamp(ResultSet.java...

java.lang.Set with elements of type java.lang.Set
Roughly I do something along the lines of: Set set = new HashSet(); Set elem = new HashSet(); set.add(elem); // now we change the elem and add it again to the set elem.add(some object here); set.add(elem); I found out the hard way that 'set' may now contain 'elem' either once or twice, the reason being that 'elem.add()' changes the hashCode of elem such that it is not noticed that it is in 'set' already on the 2nd 'set.add()'. Question: What I would actually want is an IdentityHashSet() set = new IdentityHashSet() but this does not...

to use import java.lang.* or import java.lang.Math or none at all?
Hi guys, i knew that by default all java.lang classes will be imported by the compiler during compilation. but, to make it easier for the computer, should i specify which class i really will be using? does this action will boost the performance during compilation and runtime or not a matter at all? the answer to this post will definitely affect my programming style in the future when i'm considering "to import or not to import"... hmm,,, thanks in advance. JPractitioner wrote: > i knew that by default all java.lang classes will be imported by the > compiler during compilation. but, to make it easier for the computer, > should i specify which class i really will be using? does this action > will boost the performance during compilation and runtime or not a > matter at all? Whether and how you import classes has exactly zero effect at runtime. Imports (with or without wildcards) are only a kind of abbreviation provided by the compiler to save us the effort of typing in fully-qualified type names every time. In theory explicit importing should make compilation faster -- by a very tiny amount. I've never heard anyone claim that they've even managed to measure a difference let alone found a case where it made a practical difference. So the question comes down to how to write your code for maximum clarity. One school of thought asserts that you should always import each class explicitly (rather than by a wildcard). There's a fai...

java.lang vs java.util
Surprising to see something defined in java.lang <http://developer.android.com/reference/java/lang/Iterable.html> depend on something defined in java.util <http://developer.android.com/reference/java/util/Iterator.html>. Surely the hierarchy should go the other way? On 4/1/2011 9:11 PM, Lawrence D'Oliveiro wrote: > Surprising to see something defined in java.lang > <http://developer.android.com/reference/java/lang/Iterable.html> depend on > something defined in java.util > <http://developer.android.com/reference/java/util/Iterator.html>. > > Surely the hierarchy should go the other way? I think Iterable may make it into java.lang because of its significance in the foreach statement. Patricia On 04/02/2011 12:23 AM, Patricia Shanahan wrote: > On 4/1/2011 9:11 PM, Lawrence D'Oliveiro wrote: >> Surprising to see something defined in java.lang >> <http://developer.android.com/reference/java/lang/Iterable.html> depend on >> something defined in java.util >> <http://developer.android.com/reference/java/util/Iterator.html>. >> >> Surely the hierarchy should go the other way? Not if it wants to be consistent with http://download.oracle.com/javase/6/docs/api/ don't'cha think? And the so-called "hierarchy" of java.util and java.lang is that they are equal. The language reserves for itself the entire panoply of java.* and javax.* packages. > I think It...

modifying java.lang.String.java
Hi, I'm trying to modify java.lang.String.java and add the modified String.class to rt.jar [THIS IS FOR MYSELF ONLY AND WILL NOT BE DEPLOYED]. I cannot add "private final boolean tainted[] = new boolean[5];" to String.java. If I do, it still compiles and I can add it to rt.jar and compile a test program against it. However, the JVM crashes with a strange message: java.lang.IllegalArgumentException: name can't be empty at java.security.BasicPermission.init(Unknown Source) at java.security.BasicPermission.<init>(Unknown Source) at java....

Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object
Good day to all, I have installed the j2se/netbeans binary bundle on red hat 9. I can run everything perfectly as root but when I try to compile with any other user I get: Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object When I saw this it seemed like a permissions problem but I checked the permissions and everything seemed fine. All users have execute permissions of javac and java. I have read other threads dealing with the same or similar problem but have not reached any solution yet. I would appreciate if anyone that has run into this type of problem and has solved it if he/she could give me a hand or if anyone could just point out what I should be looking for in this type of problem. Thanks in advance... gek ...

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
I downloaded jdk-6u7-solaris-sparcv9.tar.Z and installed it by these commands: # zcat jdk-6u7-solaris-sparc.tar.Z | tar -xf - # pkgadd -d . SUNWj6rtx SUNWj6dvx SUNWj6dmx # /usr/jdk/instances/jdk1.6.0/bin/sparcv9/java -version Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object # ls /usr/jdk/instances/ jdk1.5.0 jdk1.6.0 # uname -a SunOS sun1 5.10 Generic sun4u sparc SUNW,Sun-Blade-2500 Please help to fix the error. Thanks. TsanChung wrote: > I downloaded jdk-6u7-solaris-sparcv9.tar.Z and installed it by these > commands: > # zcat jdk-6u7-solaris-sparc.tar.Z | tar -xf - > # pkgadd -d . SUNWj6rtx SUNWj6dvx SUNWj6dmx > > # /usr/jdk/instances/jdk1.6.0/bin/sparcv9/java -version > Error occurred during initialization of VM > java/lang/NoClassDefFoundError: java/lang/Object It's missing or can't find rt.jar, right? How does the Solaris version find it's runtime files? Can you show us where rt.jar is? On Aug 20, 6:24=A0pm, Mark Space <marksp...@sbc.global.net> wrote: > TsanChung wrote: > > I downloaded jdk-6u7-solaris-sparcv9.tar.Z and installed it by these > > commands: > > # zcat jdk-6u7-solaris-sparc.tar.Z | tar -xf - > > # pkgadd -d . SUNWj6rtx SUNWj6dvx SUNWj6dmx > > > # /usr/jdk/instances/jdk1.6.0/bin/sparcv9/java -version > > Error occurred during initialization of VM > > java/lang/NoClassDefFoundError: java/lang/Object > > It'...

Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.
Hi, Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please put YES or NO as the first word in your reply. Add comments after it if you wish. I'll make a YES/NO count after some time. Kind regards, Paka Paka Small wrote: > Poll: Is a Java Method an Instance of the Java Class > java.lang.reflect.Method? It's not subject to vote. It's defined by the language. You might as well ask, "Is 'int' a primitive or a reference type?". Your vote will not change reality. > Please put YES or NO as the first word in your reply. Add comments > after it if you wish. > > I'll make a YES/NO count after some time. And what exactly do you hope to accomplish by this exercise? Distinguish who knows Java from those who don't? A method is not a class, and a class is not a method. That's reality in Java. The law of gravity is not subject to repeal by opinion, and neither is this. Instead of wasting your time and trying to waste ours conducting meaningless polls, why don't you read the material linked upthread and learn the truth for yourself? Learn the truth and it will set you free, or at least keep you from making errors like claiming that methods and classes are the same in Java. -- Lew On 5 feb, 20:38, Lew <lewbl...@gmail.com> wrote: > Paka Small wrote: > > Poll: Is a Java Method an Instance of the Java Class > > java.lang.reflect.Method? > > It's not sub...

HELP !!! java.sql.SQLException: General error HELP!!!!!
Hello When I wanna remove a record from my Database or update a record in my database. I get a java.sql.SQLException: General error, but he does remove the record. what does it mean java.sql.SQLException: General error and how can i fix it?! Greets Vampyrotica There might be another thread running a query on the table which has locked the table. Vampyrotica wrote: > Hello > > When I wanna remove a record from my Database or update a record in my > database. I get a java.sql.SQLException: General error, but he does > remove the record. what does it mean java.sql.SQLException: General > error and how can i fix it?! > > Greets Vampyrotica I had the same problem and I found the mistake: "statement.close()" was before I tried to run "statement.ExecuteUpdate()". Check it. "Vampyrotica" <leandra_s@hotmail.com> skrev i melding news:92b9eb78.0406141413.546ed930@posting.google.com... > Hello > > When I wanna remove a record from my Database or update a record in my > database. I get a java.sql.SQLException: General error, but he does > remove the record. what does it mean java.sql.SQLException: General > error and how can i fix it?! > > Greets Vampyrotica ...

Help with java and sql
Can someone please help me? I am getting the error message: [MySQL][ODBC 3.51 Driver][mysqld-5.0.24a-community-nt]No database selected When I open up (control panel) (administrative tools) (ODBC) and click on plantco, then configure and then test, it says success connection was made, but when I open command prompt and put in C: cd\ cd j2sdk1.4.2_12\testprog javac EXO.java java EXO data2 I get the above error message This is what I have put in notepad: import java.sql.*; import javax.swing.*; import java.awt.*; import java.io.*; public class EXO { public static void main (String [ ] args ) { String recordInput=" "; String sqlCommand= " "; try { String url="jdbc:odbc:plantco"; String user="root"; // The user name String password=""; // The password Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection conn=DriverManager.getConnection(url, user, password); Statement sttmnt=conn.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); String filename=""; if (args.length > 0) { filename = args [0];//Filename } else { System.out.println("Must supply a file name!"); System.exit(0); } BufferedReader inputFile=new BufferedReader (new FileReader(filename + ".txt")); sttmnt.executeUpda...

Help debugging Java code with Java 1.3.1_01 Java HotSpot Client VM (jvm.dll)
Hi everybody, I am seeking help in my attempt to configure proper debugging functionality for my classes with an application on a win32 platform that uses Java HotSpot(TM) Client VM (JRE 1.3.1_01 - jvm.dll). For those of you that may actually know this application, it is Matlab. For those not familiar, it is an executable that links jvm.dll. I have a number of Java IDEs (Sun ONE Studio, JBuilder, NetBeans) and I would appreciate help in setting up at least one of them to be able to debug my classes. Does anybody have an idea where to start? I think I have figured out a way to pass...

CheckBox in Column of JTable: Exception: java.lang.String cannot be cast to java.lang.Boolean
Hello, I have discovered a hidden error. My project was working for awhile, but then I started to get the below error. My error comes from the fact that I'm using a checkbox in a jtable, and I'm using the below "getColumnClass". Thank you, compile: run: Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean at javax.swing.JTable$BooleanRenderer.getTableCellRendererComponent(JTable.java:5412) at javax.swing.JTable.prepareRenderer(JTable.java:5735) at javax.swing.plaf.basic.BasicTableU...

java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
Hi, I'm trying to use the httpclient within Jython (see http://jakarta.apache.org/commons/httpclient/ for more information on the httpclient). My Jython version is: Jython 2.1 on java1.4.2_04 (JIT: null) My Java version is: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) My CLASSPATH includes: jdom.jar xerces.jar jython.jar jt400.jar log4j-1.2.8.jar commons-httpclient-2.0.jar When I just try to perform the import statements from example code I get the error pasted below....

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object (ant/tomcat/spring)
Hi, I've been trying to get Spring working with ant and tomcat. Ant was building just fine, but I came in today and tried to build it and got this: Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object ?!?! Makes no sense to me. There _is_ an older version of java installed on my machine; but JAVA_HOME and ANT_HOME are set to the correct paths, and <which java>and <java -version> produce the correct version. Any help would greatly alleviate my frustration! Thanks in advance... Courtney ...

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object (ant/tomcat/spring)
Hi, I've been trying to get Spring working with ant and tomcat. Ant was building just fine, but I came in today and tried to build it and got this: Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object ?!?! Makes no sense to me. There _is_ an older version of java installed on my machine; but JAVA_HOME and ANT_HOME are set to the correct paths, and <which java>and <java -version> produce the correct version. Any help would greatly alleviate my frustration! Thanks in advance... Courtney ...

java.io.File to java.lang.String
What's the best way to get the contents of a file represented by ajava.io.File object into a String? Benjamin wrote:> What's the best way to get the contents of a file represented by a> java.io.File object into a String?> You don't specify what you consider best so how about simple as best? Now for my curiosity, why would you want to do this?import java.io.*;public class test { public static void main(String[] args) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); File f = new File(args[0]); FileInputStream fis = new ...

java.lang.IllegalStateException: No Java compiler available
tearing my hair out on this one.Thuis started as an upgrade issue till i realised that my un-usedtomcat5 installation didn't work either with my test jsp.I have, in desparation, un-installed all java / tomcat libs and re-installed only those required to get thetomcat6-6.0.14-1jpp.noarch.rpm (and the band-waggon) loadedfirst I installed java_app_platform_sdk-5_02-linux.binthis shows (after I set alternatives to point to the /opt/SDK/jdkdirecrtory)[root@squirrel ~]# javac -versionjavac 1.6.0java shows the same.I have set the following in profileCLASSPATH=$JDKHOME:$JDKHOME/lib/tools.jarJAVA_H...

New to advane java help me in Java beans!
Hai! I am new to ad.java.I want to do java beans programs.I have Jdk1.6,j2eesdk 1.4,j2sdk 1.4,tomcat 6,netbeans ide 5.5. is there needany other software? And give complete details how to run beans programwith small example step viz pleas! NANY(kshore) wrote:> Hai!> I am new to ad.java.I want to do java beans programs.I have Jdk> 1.6,j2eesdk 1.4,j2sdk 1.4,tomcat 6,netbeans ide 5.5. is there need> any other software? And give complete details how to run beans program> with small example step viz pleas!> Try Sun's tutorial:http://java.sun.com/docs/books/tutorial/javabeans/ NANY(kshore) wrote:>> I am new to ad.java.I want to do java beans programs.I have Jdk>> 1.6,j2eesdk 1.4,j2sdk 1.4,tomcat 6,netbeans ide 5.5. is there need>> any other software? And give complete details how to run beans program>> with small example step viz pleas!Mark Space wrote:> Try Sun's tutorial:> > http://java.sun.com/docs/books/tutorial/javabeans/NANY: I am guessing that "ad.java" means "advanced java", is that correct?You can google for "Java tutorials", which will lead you to answers for all you are asking.One does not usually speak of "java beans [sic] programs". Java Beans are a set of patterns and conventions in class design that work with certain of the Java APIs to make program development easier and more robust.Were you aware that "j2sdk 1.4" is the older version of "Jdk1...

java.lang.IncompatibleClassChangeError when running java tests
Hi, When execute the junit test we get: java.lang.IncompatibleClassChangeError at se.company.wcdma.rbs.boam.pms.impl.RBScanner.preperAndPush(RBScanner.java:526) at se.company.wcdma.rbs.boam.pms.impl.RBScanner.scan(RBScanner.java:766) at se.company.wcdma.rbs.boam.mao.rmo.iub.tb.sut.IubDataStreamMoImplTest.testNewCounters(IubDataStreamMoImplTest.java:254) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.extensions.TestSetup.run(TestSetup.java:23) 0.086 testOldCounters Error N/A Any ideas what IncompatibleClassChangeError is and how we can correct it? Cheers, //mikael The cause for this is probably that the RBScanner classes depends on another class which has changed. This can happen if you didn't perform a full recompile of the sources. Delete your class output, recompile the whole source tree and fix any errors that pop up BartCr wrote: > The cause for this is probably that the RBScanner classes depends on > another class which has changed. This can happen if you didn't perform > a full recompile of the sources. > > Delete your class output, recompile the whole source tree and fix any > errors that pop up > Hi, Than...

Web resources about - java.sql.Time - comp.lang.java.help

Java - Wikipedia, the free encyclopedia
This article is about the Indonesian island. For the programming language, see Java (programming language) . For other uses, see Java (disambiguation) ...

Indonesian Air Force plane crashes in residential East Java
An Indonesian Air Force plane has crashed in East Java.

Good riddance to the Java plugin
... cut down dramatically on the number of computers infected with malicious software. Good news: Oracle says the next major version of its Java ...

Contract Analyst Programmer (JAVA/J2EE/SQL) 160205/AP/541
Defining Technology for Australia's IT Leaders.

Indonesian Air Force plane crashes in residential East Java
An Indonesian Air Force plane has crashed in East Java.

Deal: learn to code in Java and make Android apps for $29
... a variety of different Android-related subjects. Included classes: Learn Android Lollipop Development (& Marshmallow!) The Complete Java Developer ...

Java Slams The Door On The Era Of The Web Plugin
The Java plugin will be deprecated by Oracle in the next release of the Java Development Kit.

Java “RAT-as-a-Service” backdoor openly sold through website to scammers
The JSocket website: open for business on the open Web (at least right now). (credit: Sean Gallagher) A family of Java-based malware that has ...

Oracle issues an emergency patch to Java for Windows
Security problems are not new to Java, though it is, admittedly, not the only platform that suffers from these problems. Now Oracle has acknowledged ...

Malaysian white coffee is NYC's hottest new java - Business Insider
Kopitiam, a Malaysian café, is making white coffee, a Malaysian favorite that is still basically unknown in the US.

Resources last updated: 3/9/2016 4:50:49 PM