944,172 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 12558
  • Java RSS
Sep 13th, 2005
0

An unexpected error has been detected by HotSpot Virtual Machine:?

Expand Post »
hello everybody

i am writing a jni for some api's in c++ in linux
i sending vector as parameter and returning a vector through the same function.
all i need to do is
read a file put all the lines in vector.
pass the vector object as parameter to function 4m java,
read the vector retrive single line and pass it to the c++ function.
code :

public class classify {
25
26 public static native Vector Submit(Vector vecData);
27 static
28 {
29 String appPath = System.getProperty("user.dir");
30 System.load(appPath + "/libclassifyJni.so");
31
32 }
33 public static void main(String args[])
34 {
35
36 try{
37
38 Vector vecData=new Vector();
39 String dirName=args[0];
40 System.out.println("the dir name is "+dirName);
41 String text="";
42 File dir = new File(dirName);
43 String children[] = dir.list();
44 if (children != null)
45 {
46 for (int i=0; i<children.length; i++)
47 {
48 // Get filename of file or directory
49 String path;
50 String filename = children[i];
51 if(dirName.startsWith("."))
52 {
53 path = System.getProperty("user.dir");
54 path += dirName.substring(1);
55 path += "/";
56 path += filename;
57 }
58 else
59 path = filename;
60
61 FileReader fstream = new FileReader(path);//txt
62 BufferedReader br = new BufferedReader(fstream);
63 String headerArr[]=null;
64 String header=br.readLine();
65 headerArr=header.split("\\:\\:");
66
67 String cddType=headerArr[2];
68 // System.out.println("header type is:"+cddType);
69 while((text=br.readLine())!=null)
70 {
71 vecData.addElement(text);
72
73 }
74 }
75
76 Vector vecObj=new Vector();
77 vecObj = Submit(vecData);
78
79 for (Enumeration e = vecObj.elements();e.hasMoreElements()
80 {
81 String myString = (String) e.nextElement();
82 // System.out.println("String: "+myString.toString());
83 }
84
85 }
86 else
87 {
88 System.out.println("\nDirectory is EMPTY !!");
89 }
90 }
91 catch(Exception e)
92 {
93 System.out.println(e);
94 }
95 }

but in java i m getting this error
An unexpected error has been detected by HotSpot Virtual Machine:
#
# SIGSEGV (0xb) at pc=0x0000002a959320cb, pid=11361, tid=182894179040
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_01-b08 mixed mode)
# Problematic frame:
# V [libjvm.so+0x3b60cb]
#
# An error report file with more information is saved as hs_err_pid11361.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
Aborted
[vandana@SIOCR001 JWrapper]$ java classifyPckg.classify ./cdd


can u plz help me out
why am i getting this error
regards
vps
Similar Threads
vps
Reputation Points: 10
Solved Threads: 0
Newbie Poster
vps is offline Offline
10 posts
since Jul 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Monthly payment program
Next Thread in Java Forum Timeline: finding repeated subsequence in string





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC