Re: Java Search Record API
Hi Tom, Thanks for your reply. If I try the same piece of code on a different server (remprod using ARS 6.3), it works perfectly fine. It just breaks down in remtest (ARS 7.0). Mikhail Serate Remedy Development Team Information Technologies University of Calgary (403) 210-9308 [EMAIL PROTECTED] If debugging is the process of removing bugs, then programming must be the process of putting them in. _ From: Action Request System discussion list(ARSList) [mailto:[EMAIL PROTECTED] On Behalf Of Tim Widowfield Sent: Wednesday, December 20, 2006 11:25 PM To: arslist@ARSLIST.ORG Subject: Re: Java Search Record API ** Mikhail, I'm sorry I didn't notice your message earlier. I have crashed the JVM from time to time when I have accidentally passed a null object as part of a method argument. The people who wrote the Java API weren't the most careful programmers, so in some cases where you'd expect a NullPointerException to be thrown, you instead get a crashed JVM. The null gets passed all the way to the JNI layer where mayhem ensues. I've found that I have to be very careful to test every object before I use it. A simple try/catch block won't cut it. Sadly, the only way I've found to be safe is to literally check for null with an if statement, and then proceed only when I know it's OK. I'm not saying that's your problem, but it's a species of bug that's bitten me more than once. Tim Widowfield http://www.widowfield.com - Original Message From: Mikhail Serate [EMAIL PROTECTED] To: arslist@ARSLIST.ORG Sent: Friday, December 8, 2006 11:55:07 AM Subject: [ARSLIST] Java Search Record API ** Hello List, I've got an API that searches for a Record X in Form A. I created a Java API for this under the 6.3 version on our test server and it worked fine. Now we've upgraded this server to 7.0.00 Patch 002 200607211559 and when I ran it, it gives me this error: # # An unexpected error has been detected by HotSpot Virtual Machine: # # Internal Error (455843455054494F4E530E43505000FB), pid=7952, tid=2692 # # Java VM: Java HotSpot(TM) Client VM (1.4.2_12-b03 mixed mode) # An error report file with more information is saved as hs_err_pid7952.log # # If you would like to submit a bug report, please visit: #http://java.sun.com/webapps/bugreport/crash.jsp http://java.sun.com/webapps/bugreport/crash.jsp # This is the line where it crashes: Field[] formFields = FieldFactory.findObjects(userInfo, fListCrit, fCrit); This is the snippet of code that goes before the above: if(debugMode) System.out.println(retrieving... ); try { // Set the field criteria to retrieve all field info if(debugMode) System.out.println(\tSetting field criteria to retrieve all field info...); FieldCriteria fCrit = new FieldCriteria(); fCrit.setRetrieveAll(true); // Retrieve all types of fields if(debugMode) System.out.println(\tRetrieve all types of fields); FieldListCriteria fListCrit = new FieldListCriteria(formName, new Timestamp(0), FieldType.AR_ALL_FIELD); // Load the field array with all fields in the form if(debugMode) System.out.println(\tLoad the field array with all fields in the form); Field[] formFields = FieldFactory.findObjects(userInfo, fListCrit, fCrit); . . } This is our server information (test): -- Mid Tier Version - 7.0.00 Patch 002 200607211559 Web Server Information - Microsoft IIS ServletExec/5.0.0.10 Operating System Name - Windows 2003 Java Version - 1.5.0_10 -- I tested the same API on our production server and it works just fine. This is the server info: -- Mid Tier Version - 6.03.00 patch 015 Web Server Information - IBM WebSphere Application Server/5.1 Operating System Name - AIX Java Version - 1.4.2 -- All I know is that for Java APIs, when upgrading to a different version, as long as I'm using the same libraries as I used in a previous version, it should work just as fine. So I'm thinking it could be a problem with the server? If anyone can give me any information about this problem that would be greatly appreciated. Thanks! Mikhail Serate Remedy Development Team Information Technologies University of Calgary [EMAIL PROTECTED] __20060125___This posting was submitted with HTML in it___ __20060125___This posting was submitted with HTML in it___ ___ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:Where the Answers Are
Re: Java Search Record API
Mikhail, I'm sorry I didn't notice your message earlier. I have crashed the JVM from time to time when I have accidentally passed a null object as part of a method argument. The people who wrote the Java API weren't the most careful programmers, so in some cases where you'd expect a NullPointerException to be thrown, you instead get a crashed JVM. The null gets passed all the way to the JNI layer where mayhem ensues. I've found that I have to be very careful to test every object before I use it. A simple try/catch block won't cut it. Sadly, the only way I've found to be safe is to literally check for null with an if statement, and then proceed only when I know it's OK. I'm not saying that's your problem, but it's a species of bug that's bitten me more than once. Tim Widowfield http://www.widowfield.com - Original Message From: Mikhail Serate [EMAIL PROTECTED] To: arslist@ARSLIST.ORG Sent: Friday, December 8, 2006 11:55:07 AM Subject: [ARSLIST] Java Search Record API Java Search Record API** Hello List, I've got an API that searches for a Record X in Form A. I created a Java API for this under the 6.3 version on our test server and it worked fine. Now we've upgraded this server to 7.0.00 Patch 002 200607211559 and when I ran it, it gives me this error: # # An unexpected error has been detected by HotSpot Virtual Machine: # # Internal Error (455843455054494F4E530E43505000FB), pid=7952, tid=2692 # # Java VM: Java HotSpot(TM) Client VM (1.4.2_12-b03 mixed mode) # An error report file with more information is saved as hs_err_pid7952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # This is the line where it crashes: Field[] formFields = FieldFactory.findObjects(userInfo, fListCrit, fCrit); This is the snippet of code that goes before the above: if(debugMode) System.out.println(retrieving... ); try { // Set the field criteria to retrieve all field info if(debugMode) System.out.println(\tSetting field criteria to retrieve all field info...); FieldCriteria fCrit = new FieldCriteria(); fCrit.setRetrieveAll(true); // Retrieve all types of fields if(debugMode) System.out.println(\tRetrieve all types of fields); FieldListCriteria fListCrit = new FieldListCriteria(formName, new Timestamp(0), FieldType.AR_ALL_FIELD); // Load the field array with all fields in the form if(debugMode) System.out.println(\tLoad the field array with all fields in the form); Field[] formFields = FieldFactory.findObjects(userInfo, fListCrit, fCrit); } This is our server information (test): -- Mid Tier Version - 7.0.00 Patch 002 200607211559 Web Server Information - Microsoft IIS ServletExec/5.0.0.10 Operating System Name - Windows 2003 Java Version - 1.5.0_10 -- I tested the same API on our production server and it works just fine. This is the server info: -- Mid Tier Version - 6.03.00 patch 015 Web Server Information - IBM WebSphere Application Server/5.1 Operating System Name - AIX Java Version - 1.4.2 -- All I know is that for Java APIs, when upgrading to a different version, as long as I'm using the same libraries as I used in a previous version, it should work just as fine. So I'm thinking it could be a problem with the server? If anyone can give me any information about this problem that would be greatly appreciated. Thanks! Mikhail Serate Remedy Development Team Information Technologies University of Calgary [EMAIL PROTECTED] __20060125___This posting was submitted with HTML in it___ ___ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:Where the Answers Are
Re: Java Search Record API
I recomend using log4j when logging a java application.(or other applications) http://logging.apache.org/log4j/docs/index.html -- Jarl On 12/8/06, Mikhail Serate [EMAIL PROTECTED] wrote: ** Hello List, I've got an API that searches for a Record X in Form A. I created a Java API for this under the 6.3 version on our test server and it worked fine. Now we've upgraded this server to 7.0.00 Patch 002 200607211559 and when I ran it, it gives me this error: # # An unexpected error has been detected by HotSpot Virtual Machine: # # Internal Error (455843455054494F4E530E43505000FB), pid=7952, tid=2692 # # Java VM: Java HotSpot(TM) Client VM (1.4.2_12-b03 mixed mode) # An error report file with more information is saved as hs_err_pid7952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # This is the line where it crashes: Field[] formFields = FieldFactory.findObjects(userInfo, fListCrit, fCrit); This is the snippet of code that goes before the above: if(debugMode) System.out.println(retrieving... ); try { // Set the field criteria to retrieve all field info if(debugMode) System.out.println(\tSetting field criteria to retrieve all field info...); FieldCriteria fCrit = new FieldCriteria(); fCrit.setRetrieveAll(true); // Retrieve all types of fields if(debugMode) System.out.println(\tRetrieve all types of fields); FieldListCriteria fListCrit = new FieldListCriteria(formName, new Timestamp(0), FieldType.AR_ALL_FIELD); // Load the field array with all fields in the form if(debugMode) System.out.println(\tLoad the field array with all fields in the form); Field[] formFields = FieldFactory.findObjects(userInfo, fListCrit, fCrit); … … } This is our server information (test): -- Mid Tier Version - 7.0.00 Patch 002 200607211559 Web Server Information - Microsoft IIS ServletExec/5.0.0.10 Operating System Name - Windows 2003 Java Version - 1.5.0_10 -- I tested the same API on our production server and it works just fine. This is the server info: -- Mid Tier Version - 6.03.00 patch 015 Web Server Information - IBM WebSphere Application Server/5.1 Operating System Name - AIX Java Version - 1.4.2 -- All I know is that for Java APIs, when upgrading to a different version, as long as I'm using the same libraries as I used in a previous version, it should work just as fine. So I'm thinking it could be a problem with the server? If anyone can give me any information about this problem that would be greatly appreciated. Thanks! Mikhail Serate Remedy Development Team Information Technologies University of Calgary [EMAIL PROTECTED] __20060125___This posting was submitted with HTML in it___ ___ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:Where the Answers Are
Re: Java Search Record API
Mikhail, While it could be a bug in the v7 server. However, it is also (and maybe even as likely) an incompatibility between the v6.x JNI/Java API and the Java Version - 1.5.0_10 JRE that you are running the client in. If possible, it would be an interesting test to try to run this code in the Java Version - 1.5.0_10 env against the v6.x ARS server. BTW, the version of the Mid-Tier likely has nothing to do with the price of tea in china for this problem. Unless your Java client is being run from the Web server and then you might have issues because your loading the v7 Java env for the Mid-Tier and the v6 API for the other client and that could be a cause for concern in a shared JVM too. Maybe some of that will be helpful... -- Carey Matthew Black Remedy Skilled Professional (RSP) ARS = Action Request System(Remedy) Love, then teach Solution = People + Process + Tools Fast, Accurate, Cheap Pick two. ___ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:Where the Answers Are