Jintegra problem - accessing Matlab from Java??

Hi:
Sorry if this post doesn't belong here!!
I am accessing Matlab from JAVA using JIntegra for COM. I tried running the example in their website.
(http://j-integra.intrinsyc.com/support/com/doc/other_examples/Matlab.htm)
I have also posted the example below. I am using their trial version and have included all the jars as said. I get the an unexpected output (all zero's) for reading a variable in the matlab workspace. I don't understand why I get this. Can anyone let me know if this runs for you??
Thanks
Pavan
Example code from Jintegra website:
public class MatlabExample {
public static void main(java.lang.String[] args) throws Exception {
try {
// DCOM authentication: Make sure NT Domain, NT User, NT Password are valid credentials.
// Uncomment this line if MatlabExample.java remotely accesses MATLAB :
// com.linar.jintegra.AuthInfo.setDefault("NT DOMAIN", "NT USER", "NT PASSWORD");
// Create the MATLAB object
// Specify host name or IP address of MATLAB machine as parameter if
// MatlabExample.java remotely accesses MATLAB.
// mlapp.MLApp mlApp = new mlapp.MLApp("123.456.789.0");
mlapp.MLApp mlApp = new mlapp.MLApp();
String result = mlApp.execute("a = [1 2 3 4; 5 6 7 8;]");
System.out.println("Execute result is " + result);
double mreal[][] = new double[2][4];
double mimage[] = new double[0];
mlApp.getFullMatrix("a", "base", new Object[]{mreal}, new Object[]{mimage});
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 4; j++) {
System.out.println(mreal[i][j]);
} finally {
com.linar.jintegra.Cleaner.releaseAll();
}

......How are you declaring the class in your JSP? ... are you instantiating it as a bean using the useBean tag, or just instantiating it in your code like normal.
Maybe you could post the relevant JSP code too?
Hello again,
Only the last string is populating after the file has be tokenized. What I'll like to accomplish is passing the very first string in the file. I did not get too far in the JSP file setup because the code is still in it's testing stage, but any help will be highly appreciated.
Here is the JSP code
<%@page import="dev.*" %>
<%@page session="true" language="java" import="java.io.*" %>
<jsp:useBean id="wagerhist" scope="request" class="dev.RoundDetail2" />
<html>
<head>
<title>Round Detail</title>
<body>
  <table width="530" bordercolor="#000000" valign="top">
    <tr>
          <td align="left"  width="19%">Game ID<%=wagerhist.string_gameID%></td>
          <td align="left"  width="30%">  </td>
          <td align="left"  width="20%">card1</td>
          <td align="left"  width="31%">  </td>
        </tr>
  </table>
</body>
</html>

Similar Messages

  • Problem accessing variables from java file to JSP page

    Hello Everyone,
    I have small problem accessing my method variables from my java bean file to a JSP page. can some please take a look and tell me why I can't populate my JSP page, I've been trying all day to get this done!!!
    This is my Java file
    package dev;
    import java.io.*;
    import java.util.*;
    public class RoundDetail2
    public String string_gameID;
    public int string_card1;
    public String readDetail_topLayer;
    public static final String SUITS[] = {" ", "Clubs", "Hearts", "Spades", "Diamonds", "Joker", "FaceDown"};
    public static final String VALUES[] = {"Joker ","Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"};
    public static final String SuitVALUES[] = {" ","1","2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14"};
    public RoundDetail2() throws FileNotFoundException
    DataInputStream inFile=
                 new DataInputStream(
                    new BufferedInputStream(
                   new FileInputStream("C:/apps/jakarta-tomcat-4.0.6/webapps/ROOT/WEB-INF/classes/dev/Data_452SY2.txt")));
    try { 
                 while((readDetail_topLayer = inFile.readLine()) != null)
              StringTokenizer tokenizer_topLayer = new StringTokenizer(readDetail_topLayer,"\t", true);
                   while  (tokenizer_topLayer.hasMoreTokens())
                        string_gameID = tokenizer_topLayer.nextToken();
         catch(IOException e)
                    System.out.println(e.getMessage());
         Thanks KT

    ......How are you declaring the class in your JSP? ... are you instantiating it as a bean using the useBean tag, or just instantiating it in your code like normal.
    Maybe you could post the relevant JSP code too?
    Hello again,
    Only the last string is populating after the file has be tokenized. What I'll like to accomplish is passing the very first string in the file. I did not get too far in the JSP file setup because the code is still in it's testing stage, but any help will be highly appreciated.
    Here is the JSP code
    <%@page import="dev.*" %>
    <%@page session="true" language="java" import="java.io.*" %>
    <jsp:useBean id="wagerhist" scope="request" class="dev.RoundDetail2" />
    <html>
    <head>
    <title>Round Detail</title>
    <body>
      <table width="530" bordercolor="#000000" valign="top">
        <tr>
              <td align="left"  width="19%">Game ID<%=wagerhist.string_gameID%></td>
              <td align="left"  width="30%">  </td>
              <td align="left"  width="20%">card1</td>
              <td align="left"  width="31%">  </td>
            </tr>
      </table>
    </body>
    </html>

  • Problems Accessing VARRAY from Java

    Hi,
    I am calling a stored procedure with IN parameters as VARRAYS from Java application.
    There are two schemas in the database. One main schema, say 'MAIN_SCHEMA' which contains all the table,VARRAYS,packages etc. There are public synonyms for all the database object including VARRAYS in this schema. The java application uses a connection pool created using another user say 'ADMIN'. This user has been granted priviliges for acccessing all the objects in the 'MAIN_SCHEMA'. For the VARRAYS we have created public synonyms and granted EXECUTE for ADMIN.
    However when I try to execute the stored procedure from java , I get an SQLException("invalid name pattern: ADMIN.UIDARRAY")
    I solved the problem temporarily by prefixing the main schema name to the name of the VARRAY. The sample code I have used is as below. but I am not sure if this is the correct way of doing it. I do not understand why we have to prefix the schema name if we have priviliges and public synonyms on the object.
    public void setPendingForfeituresUids(java.util.List pendingForfeituresUids) throws DAOException{
    try{
    ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor(
    "MAIN_SCHEMA.UIDARRAY", con);
    array = new ARRAY(descriptor, con, pendingForfeituresUids.toArray());
    if(array == null){
    stmt.setNull(3,java.sql.Types.ARRAY);
    }else{
    stmt.setArray(3, array);
    }catch(SQLException e){
    closeStatement();
    releaseLobWrappers();
    throw new DAOException(e);
    Database and Drivers used
    I am using Oracle 9.2.0.1.0, Weblogic 8.1, Oracle Jdbc thin driver for 9.2 that comes bundled with weblogic (ojdbc14.jar)
    Any help on this is welcome.
    Thanks,
    Sunil

    Hi Sunil,
    I was wondering if you had any solution to the problem you listed.
    We are also facing a similar problem and is reported to oracle. Its a Bug as per oracle.
    Any help in getting this resolved is appreciated.
    Thanks,
    Sandip
    [email protected]

  • Problem accessing servlet from java class which uses Basic Authentication

    "Hi,
    I am using weblogic 6.1 server. I am calling a servlet file from a class file using HttpURLConnection. This is the code below.
              String theUsername="B1A1Z1T2";
              String thePassword="hlladmin";
              String urlString="http://rsnetserver:113/hll/servlet/CallSSRUpload";
              String userPassword = theUsername ":" thePassword;
              String encoding = new sun.misc.BASE64Encoder().encode (userPassword.getBytes());
              try
                   URL url = new URL (urlString);
                   HttpURLConnection uc=(HttpURLConnection)url.openConnection();
                   int it = 0;
                   while ((it = encoding.indexOf('\n')) != -1
                        || (it = encoding.indexOf('\r')) != -1) {
                             encoding = encoding.substring(0, it)
                             encoding.substring(it 1);
                   uc.setRequestProperty("Authorization","BASIC " encoding);
                   uc.setRequestProperty("SOAPAction", url.toString());
                   System.out.println(uc.getResponseCode());
                   System.out.println(uc.getResponseMessage());
              catch(Exception io)
                   io.printStackTrace();
                   System.out.println("error message........" io.getMessage());     
    In web.xml I have d

    Hello,
    Could you post the stack trace?
    Thanks,
    Bruce
    Vijay Babu wrote:
    >
    "Hi,
    I am using weblogic 6.1 server. I am calling a servlet file from a class file using HttpURLConnection. This is the code below.
    String theUsername="B1A1Z1T2";
    String thePassword="hlladmin";
    String urlString="http://rsnetserver:113/hll/servlet/CallSSRUpload";
    String userPassword = theUsername ":" thePassword;
    String encoding = new sun.misc.BASE64Encoder().encode (userPassword.getBytes());
    try
    URL url = new URL (urlString);
    HttpURLConnection uc=(HttpURLConnection)url.openConnection();
    int it = 0;
    while ((it = encoding.indexOf('\n')) != -1
    || (it = encoding.indexOf('\r')) != -1) {
    encoding = encoding.substring(0, it)
    encoding.substring(it 1);
    uc.setRequestProperty("Authorization","BASIC " encoding);
    uc.setRequestProperty("SOAPAction", url.toString());
    System.out.println(uc.getResponseCode());
    System.out.println(uc.getResponseMessage());
    catch(Exception io)
    io.printStackTrace();
    System.out.println("error message........" io.getMessage());
    In web.xml I have d

  • SYSTEM ERROR : com/adobe.processingexception:Problem accessing data from De

    Hi SAP Guru,
    We have configured ADOBE for separate ABAP server and Java Server.
    But when I am execution report FP_TEST_00 getting below error
    ADS: com.adobe.ProcessingException: Problem accessing d(200101) Message no. FPRUNX001
    FP_CHECK_DESTINATION_SERVICE
    FP_CHECK_HTTP_DATA_TRANSFER giving error
    SYSTEM ERROR : com/adobe.processingexception:Problem accessing data from Destination dest :FP_ICF_DATA_IP1//sap/bc/fp/form/layout/FP_FORM_SECURITY_TEST.XDP?fp-language=DE
    But report fp_pdf_test_00 is giving postive response.
    I have troubles hooted according to note 944221 , my configuration is ok but no success.
    Please help to resolve this issue.

    Hi,
    Check your ADS Connection .
    Do one thing
    Go to T-code "SM59"  -  "RFC Destinations (Display/Maintain)"
    select "HTTP Connections to External Server" - > ADS
    Double click there and check the all the settings " Administrations "  ,  Technical setting , Logon and security , Special option .
    Please check the log on and pass word with the help of your SAP BASIS consultant it will work fine .

  • Problem accessing data from Destination: dest:FP_ICF_DATA_ SID //sap/bc/fp/

    This error message has many threads.  However, I have not seen any postings for NW CE 7.1.  The configuration for this version of JAVA and ADS is very different from any of the documentation that we have found.  We suspect a config issue but cannot find any pertinent documentation for ADS configuration and NW CE 7.1 (we are SP11). 
    Where can we find ADS configuration documentation for NW CE 7.1?
    Please help.
    So far, we are mainly using test FP_CHECK_DESTINATION_SERVICE which seems to prove that the destination configuration is the problem.  Fortunately, some of the configuration was automated. But not all.

    Thanks for the help, so far.  I have gotten one step closer by manually starting all processes and services related to Adobe Document Services.  CE 7.1 is quite a bit different.
    I can now get a byte count returned with the test FP_CHECK_DESTINATION_SERVICE in SE38 without checking the "with destination service" box.  When I check the box, I still get the "Problem accessing data from Destination: dest:FP_ICF_DATA_<SID>//sap/bc/fp/ message".
    The problem is related to the return of the rendering service from the Java side via the Java destination service.
    Note that the ABAP side with the problem is ECC 6.0 EHP3 SP1.

  • Accessing SAP from JAVA

    Hi Friends,
       I've a requiremnet to create SO where data will be provided in JAVA screens. Is there any way to access SAP from java as we can do this through VB using API methods.
    Regards,
    Anupam

    see these links
    [link1|http://www.sapdevelopment.co.uk/java/jco/jcohome.htm]
    [link2|http://searchsap.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid21_cid417095,00.html]
    [link3|http://www.experts-exchange.com/Database/Software/ERP/SAP_ERP/Q_20693539.html]
    Regards,
    SAPient

  • What is the easiest way to access the router from an iPad?  I have no problems accessing it from my laptop.  Even though I am entering the address in the left address box, not the Google search box, it wants to do either a search, or add www beginning of

    What is the easiest way to access the router from an iPad?  I have no problems accessing it from my laptop.  Even though I am entering the address in the left address box, not the Google search box, it wants to do either a search, or add www to the beginning of the IP address.
    I usually can eventually access the router, but it is way to much trouble.  However, I use my iPad hundreds of times more often than my laptop.

    Are you typing http:// in front of the IP address of the router? e.g. http://192.168.0.1
    Sometimes, and with some routers it doesn't seem to like it if you miss off the http://

  • [JDBC][ODBC] How to compact access database from Java ?

    Hello,
    I'm developping a java applcation wich is connected to an MS Access file database.
    For now, I don'y compact it but it would be better.
    So How can I compact an access database from Java ?
    thanks :)

    Hi ypiel,
    Try this:
    1) Download JETCOMP.exe (freeware from Microsoft);
    2) Put the following code in your app (assuming your database file name is: "DB.mdb"):
    try {
    File current = new File("DB.mdb");
    File backup = new File("BACKUP.mdb");
    if (current.renameTo(backup)) {
    Runtime.getRuntime().exec("jetcomp -src:BACKUP.mdb -dest:DB.mdb");
    } catch (Exception e) {
    System.out.println(e.getMessage());
    Best regards,
    YT.

  • Calling MS Access queries from Java

    Anyone have any idea if it's possible to call MS Access queries from Java? I have a client who is insistent on keeping MS Access for their database, and it'd be nice if I didn't have to receate all their queries in Java.
    I've successfully connected to and queried the Access MDB, but I need to know if it's even possible to execute the stored MS Access queries they have setup in the database.
    Thanks!

    See reply 6 in the following....
    http://forum.java.sun.com/thread.jspa?forumID=48&threadID=203818

  • How to invoke Matlab from Java

    Hi, I want to pass some data generated from Java class to Matlab, then invoke Matlab from Java to run the computation program (file written in Matlab, myfile.m). I know Matlab can use classes generated from Java, how to drive Matlab from Java?
    I appreciate your help!
    yaya

    According to their documentation, you can't. Having said that, again according to their documentation, there are plans to support this in future releases.
    m

  • ADS, Problem accessing data from Destination

    Hello All,
    I'm facing an error when executing transaction TRIP.
    If I use the standard Adobe form it's OK no error.
    If I use a Z-form copy of this standard form (after doing customizing in PE03) I have an error message: Error while initiating travel form
    When I was deeper in the debugging I found that there was an exception rose which is:
    ADS: com.adobe.ProcessingException: com.adobe.ProcessingException: Problem accessing data from Destination: ...
    I found some threads talking about ADS and transaction SM59u2026
    When testing the connection in tx SM59 I have an error message 403: forbidden access
    Is it the cause of the error generated in TRIP tx?
    If yes why using the standard form works fine??
    Thank you in advance for your help.
    Regards,
    Moez.

    Hello Otto,
    Yes I'm using the same user for the two forms.
    It works for the standard form and not for the Z-form.
    That's why I'm expecting a customizing issue to resolve this problem.
    All solution that I found are talking about administration and Visual Admin tool.
    Regards,
    Moez.

  • Com.adobe.processingException : Problem accessing data from destination

    hi guys,
    i have an ECC 6.0 server(db : sql) and i am getting the below error while testing the destination service
    (((com.adobe.processingException:Problem accessing data from destination
    dest: fp_icf_data_isp)))
    i checked rfc connection and it is working fine .
    i dont remember the ADS_AGENT password for checking the user.but i have provided all the required roles for that.
    please guide me to resolve this issue

    Hi
    When you say you checked the rfc are you refering to the one in SM59? The fp_icf_data_isp should be an entry in the visual admin of the server that runs the ADS. In the visual admin under server->services->destinations goto to the http folder and check that there is an entry with that name there. Also the address should be http://<host of abap system>:<abap http port> and the client field and username field should be filled in.
    Regards
    Thashin

  • Calling Matlab from Java

    Hi everybody,
    I need to call Matlab from Java, run some programs in matlab and get the standard output.
    I know I can start matlab with:
    Process proc = Runtime.getRuntime().exec("matlab");
    But then how do i run a program in matlab? (For example, if I have "myprogram.m", I would run it in matlab by typing "myprogram")
    If I start a new process [Process proc2 = Runtime......exec("myprogram")], it does not start in matlab.
    Any ideas?
    thanx in advance.

    Sounds like myprogram is just a parameter of a call to matlab.
    Try some variations on
    exec("matlab myprogram");
    There is also - I believe - an exzec call that takes an array of parameters.

  • [Fwd: Security problem accessing MBeanServer from a servlet]

    Reposting to Security and Servlet newsgroups.
    -------- Original Message --------
    Subject: Security problem accessing MBeanServer from a servlet
    Date: 10 Feb 2004 13:02:09 -0800
    From: Alain <[email protected]>
    Reply-To: Alain <[email protected]>
    Organization: BEA NEWS SITE
    Newsgroups: weblogic.developer.interest.management
    Hi,
    I am trying to understand how WLS 7.0 secures a call to an MBean. Got
    the following
    scenario:
    - I am in a servlet context
    - I have created and registered an MBean with the WLS MBeanServer. Fine
    so far
    - Within the same call I can retrieve the MBean attributes. Fine so far
    - I keep the MBeanServer reference in an object global to the servlet
    context
    The problem:
    - When I do another request and try to use the cached MBeanServer
    instance to
    access the MBean, I get the following error:
    weblogic.management.NoAccessRuntimeException: Access not allowed for
    subject:
    principals=[], on ResourceType ...
    Any idea?
    Alain

    PaulF <paulf@reply_in_newsgroup.com> wrote:
    On 10 Feb 2004 13:02:09 -0800, Alain <[email protected]> wrote:
    Hi,
    I am trying to understand how WLS 7.0 secures a call to an MBean. Got
    the following
    scenario:
    - I am in a servlet context
    - I have created and registered an MBean with the WLS MBeanServer.Fine
    so far
    - Within the same call I can retrieve the MBean attributes. Fine sofar
    - I keep the MBeanServer reference in an object global to the servlet
    context
    The problem:
    - When I do another request and try to use the cached MBeanServer
    instance to
    access the MBean, I get the following error:
    weblogic.management.NoAccessRuntimeException: Access not allowed for
    subject:
    principals=[], on ResourceType ...
    Any idea?
    AlainWhat ResourceType are you trying to access. From the Exception you're
    trying to access it as an Anonymous user (principals=[]) and evidently
    you're attempting to access something that is protected. I can't tell
    what
    from the snippet you've included.
    Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
    Thanks Paul for your reply.
    You are right. I can access my custom MBeans if I am authenticated for example
    as an Administrator. My problem is that I want any application to access this
    MBean authenticated or not. I am trying to find how I could grant permission to
    this MBean to everyone. Still searching.
    Thanks.

Maybe you are looking for

  • Multiple Angle - Only want to use One Audio

    Hi! I have a three camera project. Presentation, subject was on a lav mike. How do we edit using only the audio from that angle? New to production and FCPX, explain like I'm 5 please...Please tell me it's something as simple as separating the audio t

  • Error -200452 depends on channel order

    LV 2010, NI-DAQ 9.2.2, Win Vista, cDAQ 9172 chassis, NI-9211, NI-9219. My client has the same issue with LV 8.6.1, NI-DAQ 9.1.5, Win XP, same hardware. I am getting an error -200452 (Property not applicable) in a case where I don't understand why. I'

  • Error when open RSPLAN (Modeler or Wizard)

    When I run RSPLAN (modeler or wizard), I've got the following error: URL http://gowsap21.pratika.br:8000/sap/public/myssocntl call was terminated because the corresponding service is not available. Note: The termination occured system DB2 with error

  • Question re OS 9 driver

    I posted here a couple of days ago re DIMM First Aid, which I need to make some RAM I just acquired work in my Sawtooth. Unfortunately, it only runs under OS 9, which I haven't used in ages. So last night I connected an old HD with 3 separate OS 9 pa

  • ESC close Popup-Window

    Hi, i have created a popup-window with   wd_comp_controller->window         = lo_window_manager->create_window_for_cmp_usage(                      interface_view_name    = 'W_DEFAULT'                      component_usage_name   = 'XYZ'