• Post Reply Bookmark Topic Watch Topic
  • New Topic

facing problem while executing java program  RSS feed

 
anish reddy
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
iam using jdk1.5 while executing java program iam getting exception


java.lang.NoSuchMethodError: java.io.StringWriter.append(Ljava/lang/CharSequence Ljava/io/StringWriter;
at javax.persistence.Persistence.createErrorMessage(Persistence.java:258)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:120)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
at org.an.StudentInst.main(StudentInst.java:14)
can any one suggges how to fix this problem
 
Bill Shirley
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you want help, the code would be useful,
use CODE tags,

it looks like your passing something invalid as a parameter,
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That method has been added in Java 5.

It seems that the code is compiled against a Java 5 SDK but with Java 1.4 compatibility, and is now run under Java 1.4 (or something similar).

Can you try recompiling your source?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!