Returned array from a method don't work properly over my Servlet

Hi folks,
I show you my code and then explain ;).
        double particle_sys[] = new double[100*5];
     double particle[];
  try {
         for(i = 0; i < 10; i++)
          particle_sys[i*5] = 1;
          particle_sys[i*5 + 1] = 0;
          particle_sys[i*5 + 2] = 1;
          particle_sys[i*5 + 3] = 0;
          particle_sys[i*5 + 4] = 0;     
     class call = new class();
     particle = call.MyFailingMethod(particle_sys);Now the code for the class which owns the method I call
public class Jfjni
     static
             System.loadLibrary("nativelibrary");
     public native void .........
     public double[] MyFailingMethod(double particle_sys[])
           double particle[] = new double[100*5];
           .... A call to a the native library to recibe the new data of particle_sys ....
         for(int i = 0; i < 10; i++)
          particle[i*5] = particle_sys[i*5];
          particle[i*5 + 1] = particle_sys[i*5 + 1];
          particle[i*5 + 2] = particle_sys[i*5 + 2];
          particle[i*5 + 3] = particle_sys[i*5 + 3];
          particle[i*5 + 4] = particle_sys[i*5 + 4];     
          return particle; 
}A function in the native code changes the "particle_sys" array, but the returning value stills the same as the original passed to the function.
Because of this, I have tested returning the array, dont works. I have tested also returning a copy of the array in "particle", dont works.
Over standalone app and applet it runs correctly in all different ways, when I try it over a servlet the values of the array stand the same as before the method call.
Please suggestions!
Edited by: bifiado on Jan 15, 2008 10:27 AM
Edited by: bifiado on Jan 15, 2008 10:28 AM

I have partially solutioned this mistake but I have collateral ones. Looks like I forgot to put in web.xml the definition of the class I was calling from the principal servlet class. In other words, I have two classes, one is the extension of Httpservlet and the other (the class that make mistakes) is a class I call to do the JNI work.
Now, I added in web.xml the definition of the JNI class (before I forgot) and looks the mistakes with arrays works, but know the there's a new problem and get an IOexception on the applet that call the servlet. When I coment the JNI calls the exception dissapears and all works ok, but I am not getting any exception report on the tomcat ".out".
Please suggestions.

Similar Messages

  • Cookies Don't Work Properly

    OK, I've looked through this Forum carefully and tried everything.... Even though cookies for certain web sites (NYTimes, WatchGeeks) appear in Safari Preferenes they don't work, Why?
    My settings are as follows: Block Cookies from Third Parties, etc.; Prompt from website one time only. The NYTimes cookie indicates Cache, Cookies & Local Storage. NYT cooke indicates Cookie. But every time I go from one page to another on their site, the sign-in screen re-appears. I'm using Last Pass to sign me in and I'm good until i go to another page. Then the same thing happens. With WatchGeeks, I'm prompted to sign it every time I return to the site...same problem.
    I have deleted all cookies and started over, but that doesn't solve the problerm. Safari recognizes and stores the cookies again, but they don't work properly.This all started when I started to use  'Cookie" a cookie management program. But once this started, I uninstalled "Cookie'" and removed all traces of it, to no avail.
    What's wrong? Can I do something in Time Machine to get me back on track? I'm open to any and all suggestions. Thanks!

    You can check on the <b>about:config</b> page if the javascript.enabled pref is set to true.
    *http://kb.mozillazine.org/about:config
    You can try basic steps like these in case of issues with web pages:
    Reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Hold down the Shift key and left-click the Reload button
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (Mac)
    Clear the cache and the cookies from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Desktop SMS and Windows Mail don't work properly together

    Hi
    thought I would post there here as been having some issues with my Windows Mail but my desktop computer doesn't suffer same issues and on a Vista forum where I posted my problem a couple of very helpful told me who to try solving the issues.
    One of them suddenly realised I'd said my laptop was a Toshiba and apparently the Desktop SMS and Windows Mail just don't work properly together so the person suggested unless I use it to uninstall it apparently amongst the technically trained its known that these two programs don't like each other and would explain why my desktop doesn't have the issue but laptop does.
    After resetting the Windows Mail (tutorial on a vista site http://www.vistax64.com/tutorials/) Touch wood don't be put off by vistax64 as site does both 32 and 64 and followed Brink's excellent resetting Windows Mail (didn't restore any mail) and then uninstalled Desktop SMS and touch wood no more mail issues as has been giving me problems virtually daily with marking draft emails as read/sent.
    So had to click on forward then delete those bits and finish email to send it and touch wood since doing these two things as soon as send an email to draft or outbox get the number of emails in the brackets whereas before this wouldn't happen unless I closed the program then reopened it.
    Hoping these solutions have fixed my problem and wanted to share it with anybody else who wants to read this thread and would recommend the Vista 64 site as they're all really helpful over there and speak in non technical terms for those of us not technically trained.
    Debbie

    I have marked this as answered as it was more a post to help others who may have experienced the same problem I did and didn't get a reply or just didn't know that this program could be the reason their Windows Mail has issues that can't seem to be resolved any other way apart from ignore them and hope they don't get worse.

  • TS3297 What do I do if music files purchased/downloaded for the iTunes store don't work properly?

    What do I do if music files purchased/downloaded for the iTunes store don't work properly?

    Buddhabeat...clicking on the "Report a Problem" button next to the song(s) in question, should open a drop-down list menu, that allows you to select the specific issue/area of concern that you are experiecing (or you can select a generic "My problem is not on the list" (or something to that effect). Underneath this drop-down menu box, there should be another message box where you can describe  the issue/problem your having. Below this message box will be a "Submit" button...clicking on that will send your message to the Apple iTunes Store Customer Support Centre (you will see a confirmation message that your message has been sent), as well as receive an email notification from the Support Centre confirming your message has been received, a case number, and that you will receive an email response pertaining to the issue/problem you're having, from the Support Centre asap (usually within 24 hours). That's how it worked for me, anyhow.

  • The Proximity sensor don't work properly of ios4

    hello! ive just update to ios 4 on my 3gs, and the problem is that the Proximity sensor don't work properly, when I put the iPhone near my ear it turns off the screen, but when I move it back from my ear it doesn't turn on...
    i tried to restore, and at first the problem was gone, and now it's back...
    is it a bug? I'm pretty sure my sensors are fine..
    tnx!

    I was having the same issue with my new iphone 4 with screen going dark when I lowered it during a call & not having access to the call or controls of the phone. I discovered the problem was the 3G case I was using on my iphone 4 (it happens to fit pretty well). When I removed the case the proximity sensor now seems to function properly. The 3G case must have been interfering with the sensor. I guess I'll be getting a new case. Hope this helps.

  • Had a hard time all of sudden opening photos in PS via Bridge. Updated all my software and now halfway through editing a photo, my actions don't work properly. Should I remove all programs and re-install?

    Had a hard time all of sudden opening photos in PS via Bridge. Updated all my software and now halfway through editing a photo, my actions don't work properly. Should I remove all programs and re-install?

    <moved from Adobe Creative Cloud to Photoshop General Discussion>

  • Satellite A300-1G5 PSAG4E - Multimedia Buttons don`t work properly

    My multimedia buttons don`t work properly any more. I`m talking abut the first 2 buttons (Mute and Media Player - buttons).
    I just tried to reinstall VAP but it`s the same. I must say i can use Mute button but it won`t shows up that icon for mute.
    The Media player button doesen`t work at all.
    I just tried to search on this form for a sollution but i couldn`t find it.
    All the rest of the buttons (play/pause, stop, next, previews) are working just fine.
    As far as i remember 2 days ago all my multimedia buttons worked perfectly.
    In this time i didn`t reinstalled OS or any other drivers.
    I`m using the last version of BIOS (downloaded from toshiba website) and Windows 7 Ultimate. I have a Toshiba Satellite A300 - 1G5 PSAG4E.
    Can you give me some advices about that pls?
    Message was edited by: blunthlox

    Solved. I used a system restore at yesterday`s date and it`s ok now.

  • App store don't work properly

    App store on iphone don't work properly, i cann't install any app, cause the install button is lagging or there is no install button at all, and i can't see any pictures, only the first. on iPad it's work good...iPhone 2)) And sorry for my English

    =_=
    1. i tap for example *Free*
    2. then i need to tap install, but there is no button at all or there is just half of the button....
    3. and images... i can't slide

  • My eBay pages don't work properly. There are parts missing. The symbols on the My eBay page have gone. The £ paid sign, checkout, feedback, and probably more. I can't list an item as the submit button has disappeared. It all works fine on IE.

    My eBay pages don’t work properly. There are parts missing. The symbols on the My eBay page have gone. The £ paid sign, checkout, feedback, and probably more.
    I can’t list an item, as the submit button has disappeared.
    It all works fine on IE. I’ve uninstalled and reinstalled Firefox, but still the same.
    How can I regain my missing bits please.
    Thanks

    Can you attach a [http://en.wikipedia.org/wiki/Screenshot screenshot]?
    Use a compressed image type like PNG or JPG to save the screenshot and make sure that you do not exceed the maximum file size (1 MB).
    See http://kb.mozillazine.org/Websites_look_wrong
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

  • ID3v2 tags don't work properly on zen microph

    I e-mailed tech support on this one, but it seemed like they spent 2 seconds reading it and then sending a template reply.
    I have a lot of older mp3 files which I only used ID3V2 tags on, because that was the field with most info when right-clicking files in winamp.
    When I try looking for a file which only has id3v2 tags, things don't work properly. Let's say I have this info in the id3v2 tag: "Mr.Artist - Mr. Track - Mr.Album".
    Now let's turn the player on. Artists: "Mr.Artist" shows. When clicking on "Mr.Artist", "Mr.Album" shows. BUT, when clicking on the album, where the hell is "Mr. Track"? I only see blank space! I have to click "all tracks" and scroll my way to "mr. track" to find it.
    This is a highly unneccesary hassle. I've updated the firmware, but that didn't do anything at all. I download a lot of unsigned, free music, which only has id3v2 information in it.
    Id3v tags on the other hand, work just like they should.
    Please help me out on this one. It would be greatly apreciated.Message Edited by Rognalf on 06-09-20070:57 AM
    Message Edited by Rognalf on 06-09-2007:00 AM

    From my own experience it seems that ID3v2 tags seem to cause problems like this with most mp3 players. I'm guessing because it's newer. I've heard that ID3v2 is more flexible but ID3v is more compatible.

  • Google maps don't work properly with ADF

    Hi!
    I have tried to integrate Google maps with ADF http://blogs.oracle.com/middleware/2010/06/integrating_google_maps_with_adf.html. This tutorial works good, but then I insert the same code in real ADF application Google maps don’t work properly, there are problems with zoom buttons, map doesn’t display right region but shows another one (does it with offset) etc.
    Can be this issues connected with ADF Security? Or there are some other things in my project which doesn’t allow JavaScript to work correctly?

    andrejs,
    I just tried the tutorial (works fine) and the tutorial with ADF security (works fine). It seems to be something more specific to your application than anything else.
    John

  • Edge animations don't work properly in DPS.

    I've recently update CC to the latest 2014 version and since then Edge animations don't work properly in DPS (struggle to load and play). Can anyone help?

    Hi Bob,
    What real details do you need? I create a digital magazine using DPS with the occasional Edge oam file inserted to lift a couple of the openers. However recently, they either stutter on loading, don't load or crash the viewer/ipad. I test them in Content viewer.
    Thanks
    Mat

  • Why am I facing so many problem after upgrading to ios7, my phone hangs/stuck many times, applications just stop working and close themselves, battery drainage,Facebook and all applications don't work properly. What should I do? They punished me for upgra

    I'm using iPhone 5
    Why am I facing so many problem after upgrading to ios7, my phone hangs/stuck many times, applications just stop working and close themselves, battery drainage,Facebook and all applications don't work properly. What should I do? They punished me for upgrading to ios7. I now hate apple and I'm thing of getting samsung.

    Basic troubleshooting
    Reset
    Restore with backup
    Restore as new ( better )

  • Returning arrays from methods

    Hello,
    I'm trying to write a program that is structured like this;
    - The first method gets the user to enter 20 integers, which are stored in an array.
    - This method is then supposed to return this array.
    - The main method calls the first method (the one with the array).
    - The main method then calls another method which finds the highest value in the array passed to it (from the initial method) and then prints this value.
    I've tried for about 2 hours now though, and can't get it to return the array.
    Bear in mind I'm a novice at Java. I'll put my code below. Any help on this would be really appreciated because I'm totally stumped.
    public class part1
         static int counter=20;
         public static void enterMarks()
                   int classMarks[] = new int[20];
                   for (int i=0; i<20; i++)
                             classMarks[i] = getScannerInput.anInt("Please enter an integer value between 0 and 20 for each mark :");
                             System.out.println();
                             System.out.print("The marks entered were ");
                             for (int j=0; j<counter; j++)
                                       System.out.print(classMarks[j]+", ");
         public static void max()
    //               int[] classMarks2=classMarks;
         public static void main(String args[])
                   int[] marks=enterMarks();
    }Can someone tell me how I need to alter this so that the first method will return the array? Thanks in advance.

    Thanks for all the help so far everyone, I'm finally getting somewhere, but I've another problem. Here's my current code:
         static int counter=20;
         public static int[] enterMarks()
                   int classMarks[]= new int[counter];
                   for (int i=0; i<counter; i++)
                             classMarks[i] = getScannerInput.anInt("Please enter an integer value between 0 and 20 for each mark :");
                             System.out.println();
                             System.out.print("The marks entered were ");
                             for (int j=0; j<counter; j++)
                                       System.out.print(classMarks[j]+", ");
                                  return classMarks;     
         public static int max(int arr[])
                   int[] marks = classMarks;
                   int tempStore=0;
                   for (int k=0;k<counter;k++)
                        if(marks[k]>marks[k+1])
                        tempStore=marks[k];
                   return tempStore;
         public static void main(String args[])
                   int[] marks = enterMarks();
    }When I try to compile that, I'm told that the variable classMarks may not have been initialised. Surely it should be getting classMarks from the first method now that the first method is set up to return the array?

  • NEED HELP on returning values from a method

    Hello Java World,
    Does anyone know how to return more then 1 value from a method..
    ex.
    //the following returns one value
    //Person Class
    private String getname()
    return this.name;
    how can i get two values (ex. name and occupation of person)
    Thank you in advance.

    Create a Class which will hold the values you want and return that object. Or return a List, or return an array, or - taking your example with the person, why don't you return the whole person object?
    Thomas

Maybe you are looking for

  • How do i fix 502 bad gateway on macbook pro

    hi my laptop keeps saying 502 bad gateway can you please help me lucas

  • ATI Radeon X1800 as PCI-e, when?

    Hi, Does anybody know some details, when the ATI Radeon X1800 for Mac in PCI-e will be available? ATI showed it on MacWorld this year. JO

  • System tray Icon!!!

    Hi all, I have created an application. Now i want that application to be converted to an exe and i also want to post that into the system tray. I just need to have an icon in the destop and wen double cliked it has to reach the system tray. On right

  • Translation of DOKU texts objects

    Hello, We have create a new DE customer documentation in english by the transaction CMOD.  And we want to translate it in other language, how can we do this ? We tried by SE63 , but the system is returning this abap code : INCLUDE ZBU_BTCSTATUS OBJEC

  • Cropping Gradient Mesh

    Is there anyway to crop a gradient mesh which, in essence, acts like a masked gradient mesh, but actually trims all the excess? For example, lets say I use a quick mesh, using a rectangle, to quickly get the blends and colors I want (example: bright