| | |
An unexpected error has been detected by HotSpot Virtual Machine:?
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2005
Posts: 10
Reputation:
Solved Threads: 0
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
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
- Error msg ' Operation Aborted' when accessing some websites. (Web Browsers)
- IE shuts down and leaves message on desktop (Viruses, Spyware and other Nasties)
- Java Virtual Machine Problem (ColdFusion)
- Errors in My XP Error Log. (Windows NT / 2000 / XP)
- Problems with Win2k3 Serv and VmWare (Windows NT / 2000 / XP)
- Trouble with JVM (Java)
- VMWare Unrecoverable Error (*nix Software)
Other Threads in the Java Forum
- Previous Thread: Monthly payment program
- Next Thread: finding repeated subsequence in string
| Thread Tools | Search this Thread |
Tag cloud for Java
android api appinventor apple applet application arc arguments array arrays automation binary bluetooth c++ chat class classes client code codesnippet compiler component csv database doctype draw ebook eclipse error event exception fractal freeze game givemetehcodez graphics gui html ide image input integer intellij iphone j2me java java.xls javaprojects jni jpanel julia linux list login loop loops mac map method methods mobile netbeans newbie number online oracle page parameter print problem program programming project recursion reporting rotatetext scanner screen server set size sms socket sort sourcelabs sql string superclass swing system template test testautomation threads time title tree tutorial-sample windows working





