Convert to Transaction Class to Use Market Basket Analysis Script (arules) in the Execute R Script Module

Hello,
I need to do Market Basket Analysis for my data, and have a working R script when using it in R Studio.  I need to transfer that R script to Azure ML Studio.  I read in another posting that the arules package is pre-installed and that I need
to use the Execute R Script module since there is not other built-in module/function that does anything similar to Market Basket.  I went ahead and copy-paste my R script into the module with some slight modifications in terms of importing the data. 
I use the R function read.transaction to import and convert my data frame (a csv file) into a transaction class directly from my working directory when using R Studio.  It appears that read.transaction does not work on Azure ML, and yet
I need my data to be in transaction class for the rest of the functions in arules to work.  Therefore, how do I get around this?
Thank you.

Thanks.
This is my R script:
library(arules)
library(arulesViz)
# Contents of optional Zip port are in ./src/
#source("src/MOD Targeting MBA ML.R");
Data = read.transactions("src/data.csv", format = "single", sep = ",", cols = c(1,2))
itemFrequencyPlot(Data, topN = 37, type = "absolute")
Baskets = apriori(Data, parameter = list(supp = 0.001, conf = 0.8))
inspect(Baskets)
Results = as(Baskets, "data.frame")
maml.mapOutputPort("Results")
And this is the output log:
Record Starts at UTC 12/23/2014 19:52:51:
Run the job:"/dll "ExecuteRScript, Version=6.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca;Microsoft.MetaAnalytics.RDataSupport.ExecuteRScript;Run" /Output0 "..\..\Result Dataset\Result Dataset.dataset" /Output1 "..\..\R Device\R Device.dataset" /bundlePath "..\..\Script Bundle\Script Bundle.zip" /rStreamReader "script.R" "
Starting process 'C:\Resources\directory\c3626c2575d5423e8cb58a9e7230be5e.SingleNodeRuntimeCompute.Packages\AFx\6.0\DllModuleHost.exe' with arguments ' /dll "ExecuteRScript, Version=6.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca;Microsoft.MetaAnalytics.RDataSupport.ExecuteRScript;Run" /Output0 "..\..\Result Dataset\Result Dataset.dataset" /Output1 "..\..\R Device\R Device.dataset" /bundlePath "..\..\Script Bundle\Script Bundle.zip" /rStreamReader "script.R" '
[ModuleOutput] DllModuleHost Start: 1 : Program::Main
[ModuleOutput] DllModuleHost Start: 1 : DataLabModuleDescriptionParser::ParseModuleDescriptionString
[ModuleOutput] DllModuleHost Stop: 1 : DataLabModuleDescriptionParser::ParseModuleDescriptionString. Duration: 00:00:00.0050971
[ModuleOutput] DllModuleHost Start: 1 : DllModuleMethod::DllModuleMethod
[ModuleOutput] DllModuleHost Stop: 1 : DllModuleMethod::DllModuleMethod. Duration: 00:00:00.0000598
[ModuleOutput] DllModuleHost Start: 1 : DllModuleMethod::Execute
[ModuleOutput] DllModuleHost Start: 1 : DataLabModuleBinder::BindModuleMethod
[ModuleOutput] DllModuleHost Verbose: 1 : moduleMethodDescription ExecuteRScript, Version=6.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca;Microsoft.MetaAnalytics.RDataSupport.ExecuteRScript;Run
[ModuleOutput] DllModuleHost Verbose: 1 : assemblyFullName ExecuteRScript, Version=6.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca
[ModuleOutput] DllModuleHost Start: 1 : DataLabModuleBinder::LoadModuleAssembly
[ModuleOutput] DllModuleHost Verbose: 1 : Trying to resolve assembly : ExecuteRScript, Version=6.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca
[ModuleOutput] DllModuleHost Verbose: 1 : Loaded moduleAssembly ExecuteRScript, Version=6.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca
[ModuleOutput] DllModuleHost Stop: 1 : DataLabModuleBinder::LoadModuleAssembly. Duration: 00:00:00.0074580
[ModuleOutput] DllModuleHost Verbose: 1 : moduleTypeName Microsoft.MetaAnalytics.RDataSupport.ExecuteRScript
[ModuleOutput] DllModuleHost Verbose: 1 : moduleMethodName Run
[ModuleOutput] DllModuleHost Information: 1 : Module FriendlyName : Execute R Script
[ModuleOutput] DllModuleHost Information: 1 : Module Release Status : Release
[ModuleOutput] DllModuleHost Stop: 1 : DataLabModuleBinder::BindModuleMethod. Duration: 00:00:00.0116536
[ModuleOutput] DllModuleHost Start: 1 : ParameterArgumentBinder::InitializeParameterValues
[ModuleOutput] DllModuleHost Verbose: 1 : parameterInfos count = 5
[ModuleOutput] DllModuleHost Verbose: 1 : parameterInfos[0] name = dataset1 , type = Microsoft.Numerics.Data.Local.DataTable
[ModuleOutput] DllModuleHost Verbose: 1 : Set optional parameter dataset1 value to NULL
[ModuleOutput] DllModuleHost Verbose: 1 : parameterInfos[1] name = dataset2 , type = Microsoft.Numerics.Data.Local.DataTable
[ModuleOutput] DllModuleHost Verbose: 1 : Set optional parameter dataset2 value to NULL
[ModuleOutput] DllModuleHost Verbose: 1 : parameterInfos[2] name = bundlePath , type = System.String
[ModuleOutput] DllModuleHost Verbose: 1 : parameterInfos[3] name = rStreamReader , type = System.IO.StreamReader
[ModuleOutput] DllModuleHost Verbose: 1 : parameterInfos[4] name = seed , type = System.Nullable`1[System.Int32]
[ModuleOutput] DllModuleHost Verbose: 1 : Set optional parameter seed value to NULL
[ModuleOutput] DllModuleHost Stop: 1 : ParameterArgumentBinder::InitializeParameterValues. Duration: 00:00:00.0102003
[ModuleOutput] DllModuleHost Verbose: 1 : Found trace source in Execute R Script module...
[ModuleOutput] DllModuleHost Verbose: 1 : Begin invoking method Run ...
[ModuleOutput] Microsoft Drawbridge Console Host [Version 1.0.2108.0]
[ModuleOutput] [1] 56000
[ModuleOutput]
[ModuleOutput] The following files have been unzipped for sourcing in path=["src"]:
[ModuleOutput]
[ModuleOutput] Name Length Date
[ModuleOutput]
[ModuleOutput] 1 data.csv 2875965 2014-12-04 17:08:00
[ModuleOutput]
[ModuleOutput] 2 __MACOSX/ 0 2014-12-23 09:39:00
[ModuleOutput]
[ModuleOutput] 3 __MACOSX/._data.csv 120 2014-12-04 17:08:00
[ModuleOutput]
[ModuleOutput] Loading objects:
[ModuleOutput]
[ModuleOutput] Loading required package: Matrix
[ModuleOutput]
[ModuleOutput]
[ModuleOutput]
[ModuleOutput] Attaching package: 'arules'
[ModuleOutput]
[ModuleOutput]
[ModuleOutput]
[ModuleOutput] The following objects are masked from 'package:base':
[ModuleOutput]
[ModuleOutput]
[ModuleOutput]
[ModuleOutput] %in%, write
[ModuleOutput]
[ModuleOutput]
[ModuleOutput]
[ModuleOutput] Loading required package: grid
[ModuleOutput]
[ModuleOutput]
[ModuleOutput] Attaching package: 'arulesViz'
[ModuleOutput]
[ModuleOutput] The following object is masked from 'package:base':
[ModuleOutput]
[ModuleOutput] abbreviate
[ModuleOutput]
[ModuleOutput] $value
[ModuleOutput] NULL
[ModuleOutput]
[ModuleOutput] $visible
[ModuleOutput] [1] FALSE
[ModuleOutput]
[ModuleOutput] Warning messages:
[ModuleOutput] 1: In strptime(x, format, tz = tz) :
[ModuleOutput] unable to identify current timezone 'C':
[ModuleOutput] please set environment variable 'TZ'
[ModuleOutput] 2: In strptime(x, format, tz = tz) : unknown timezone 'localtime'
[ModuleOutput] DllModuleHost Stop: 1 : DllModuleMethod::Execute. Duration: 00:00:14.5396895
[ModuleOutput] DllModuleHost Error: 1 : Program::Main encountered fatal exception: Microsoft.Analytics.Exceptions.ErrorMapping+ModuleException: Error 0063: The following error occurred during evaluation of R script:
[ModuleOutput] ---------- Start of error message from R ----------
[ModuleOutput] Error: Mapped variable must be of class type data.frame at this time.
[ModuleOutput]
[ModuleOutput]
[ModuleOutput] Error: Mapped variable must be of class type data.frame at this time.
[ModuleOutput] ----------- End of error message from R -----------
Module finished after a runtime of 00:00:14.6091783 with exit code -2
Module failed due to negative exit code of -2
Record Ends at UTC 12/23/2014 19:53:07.
Sorry, it won't let me send a link for some reason.
Thanks.
Cindy

Similar Messages

  • Market Basket Analysis

    Hi all,
    I am currently doing this course "Getting Started with MS Azure Machine Learning" by Buck Woody. One of the questions I have is How do I build a algorithm to develop a retail analytics solution? What retail data should I gather? My end objective
    of the app is, when the consumer scans a product is a retail store, the app should pop up other alternatives for him.
    my issue to achieve the market basket analysis using azure machine learning.
    the same as you provide idea in "Algorithm for Retail Analytics" discussion, 
    i know i have to use R-script but i dont have any idea for that so please provide some suggestion how to achieve this.
    Please help us.

    Hi,
    May I interest in considering the
    https://datamarket.azure.com/dataset/amla/recommendations offer in the marketplace. We are investing in this offer quite a bit and support a number of recommendation types, including frequently-bought-together (which is what I imagine you are trying to
    solve here).
    It is an end-to-end solution built with Azure Machine Learning that is already in production with real customers.
    Let us know if you have any questions,
    Luis Cabrera
    Program Manager
    Azure Machine Learning Marketplace
    Luis Cabrera. Program Manager -- Azure Machine Learning @luisito_cabrera Disclaimer: This post is provided "AS IS" with no warranties, and confer no rights.

  • Converting byte[] to Class without using defineClass() in ClassLoader

    so as to de-serialize objects that do not have their class definitions loaded yet, i am over-riding resolveClass() in ObjectInputStream .
    within resolveClass() i invoke findClass() on a network-based ClassLoader i created .
    within findClass() , i invoke
    Class remoteClass = defineClass(className, classImage, 0, classImage.length);
    and that is where i transform a byte[] into a Class , and then finally return a value for the resolveClass() method.
    this seems like a lengthy process. i mean, within resolveClass() i can grab the correct byte[] over the network.
    then, if i could only convert this byte[] to a Class within resolveClass() , i would never need to extended ClassLoader and over-ride findClass() .
    i assume that the only way to convert a byte[] to a Class is using defineClass() which is hidden deep within ClassLoader ? there is something going on under the hood i am sure. otherwise, why not a method to directly convert byte[] to a Class ? the byte[] representation of a Class always starts with hex CAFEBABE, and then i'm sure there is a standard way to structure the byte[] .
    my core issue is:
    i am sending objects over an ObjectInputStream created from a Socket .
    at the minimum, i can see that resolveClass() within ObjectInputStream must be invoked at least once .
    but then after that, since the relevant classes for de-serialization have been gotten over the network, i don't want to cascade all the way down to where i must invoke:
    Class remoteClass = defineClass(className, classImage, 0, classImage.length);
    again. so, right now, within resolveClass() i am using a Map<String, Class> to create the following class cache:
    cache.put(objectStreamClass.getName(), Class);
    once loaded, a class should stay loaded (even if its loaded in the run-time), i think? but this is not working. each de-serialization cascades down to defineClass() .
    so, i want to short-circuit the need to get the class within the resolveClass() method (ie. invoke defineClass() only once),
    but using a Map<String, Class> cache looks really stupid and certainly a hack.
    that is the best i can do to explain my issue. if you read this far, thanks.

    ok. stupid question:
    for me to use URLClassLoader , i am going to need to write a bare-bones HTTP server to handle the class requests, right?Wrong. You have to deploy one, but what's wrong with Apache for example? It's free, for a start.
    and, i should easily be able to do this using the com.sun.net.httpserver library, right?Why would you bother when free working HTTP servers are already available?

  • What transactions do you use for data analysis?

    hi ,
    can anybody please help me out and give the result.
    with regards
    PRP.

    Please check the forum before posting such basic question..
    You will find many links
    Anyways please check the following links
    data analysis
    Reg Data Analysis
    Regards
    Satish Boguda

  • ScreenImage class to use clipboard

    Anyone know how instead of writing this out to a file, it can copy that image to the clipboard?
    thanks
    here is the ScreenImage class..
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.*;
    import javax.swing.*;
    public class ScreenImage
          *  Create a BufferedImage for Swing components.
          *  The entire component will be captured to an image.
          *  @param      component Swing component to create image from
          *  @param      fileName name of file to be created or null
          *  @return     image the image for the given region
          *  @exception IOException if an error occurs during writing
         public static BufferedImage createImage(JComponent component, String fileName)
              throws IOException
              Dimension d = component.getSize();
              if (d.width == 0)
                   d = component.getPreferredSize();
                   component.setSize( d );
              Rectangle region = new Rectangle(0, 0, d.width, d.height);
              return ScreenImage.createImage(component, region, fileName);
          *  Create a BufferedImage for Swing components.
          *  All or part of the component can be captured to an image.
          *  @param      component Swing component to create image from
          *  @param      region The region of the component to be captured to an image
          *  @param      fileName name of file to be created or null
          *  @return     image the image for the given region
          *  @exception IOException if an error occurs during writing
         public static BufferedImage createImage(JComponent component, Rectangle region, String fileName)
              throws IOException
              boolean opaqueValue = component.isOpaque();
              component.setOpaque( true );
              BufferedImage image = new BufferedImage(region.width, region.height, BufferedImage.TYPE_INT_RGB);
              Graphics2D g2d = image.createGraphics();
              g2d.setClip( region );
              component.paint( g2d );
              g2d.dispose();
              component.setOpaque( opaqueValue );
              ScreenImage.writeImage(image, fileName);
              return image;
          *  Create a BufferedImage for AWT components.
          *  @param      component AWT component to create image from
          *  @param      fileName name of file to be created or null
          *  @return     image the image for the given region
          *  @exception AWTException see Robot class constructors
          *  @exception IOException if an error occurs during writing
         public static BufferedImage createImage(Component component, String fileName)
              throws AWTException, IOException
              Point p = new Point(0, 0);
              SwingUtilities.convertPointToScreen(p, component);
              Rectangle region = component.getBounds();
              region.x = p.x;
              region.y = p.y;
              return ScreenImage.createImage(region, fileName);
          *  Convenience method to create a BufferedImage of the desktop
          *  @param      fileName name of file to be created or null
          *  @return     image the image for the given region
          *  @exception AWTException see Robot class constructors
          *  @exception IOException if an error occurs during writing
         public static BufferedImage createDesktopImage(String fileName)
              throws AWTException, IOException
              Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
              Rectangle region = new Rectangle(0, 0, d.width, d.height);
              return ScreenImage.createImage(region, fileName);
          *  Create a BufferedImage from a rectangular region on the screen.
          *  @param      region region on the screen to create image from
          *  @param      fileName name of file to be created or null
          *  @return     image the image for the given region
          *  @exception AWTException see Robot class constructors
          *  @exception IOException if an error occurs during writing
         public static BufferedImage createImage(Rectangle region, String fileName)
              throws AWTException, IOException
              BufferedImage image = new Robot().createScreenCapture( region );
              ScreenImage.writeImage(image, fileName);
              return image;
          *  Write a BufferedImage to a File.
          *  @param      image image to be written
          *  @param      fileName name of file to be created
          *  @exception IOException if an error occurs during writing
         public static void writeImage(BufferedImage image, String fileName)
              throws IOException
              if (fileName == null) return;
              int offset = fileName.lastIndexOf( "." );
              String type = offset == -1 ? "jpg" : fileName.substring(offset + 1);
              ImageIO.write(image, type, new File( fileName ));
         public static void main(String args[])
              throws Exception
              final JFrame frame = new JFrame();
              final JTextArea textArea = new JTextArea(30, 60);
              final JScrollPane scrollPane = new JScrollPane( textArea );
              frame.getContentPane().add( scrollPane );
              JMenuBar menuBar = new JMenuBar();
              frame.setJMenuBar( menuBar );
              JMenu menu = new JMenu( "File" );
              ScreenImage.createImage(menu, "menu.jpg");
              menuBar.add( menu );
              JMenuItem menuItem = new JMenuItem( "Frame Image" );
              menu.add( menuItem );
              menuItem.addActionListener( new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        //  Let the menu close and repaint itself before taking the image
                        new Thread()
                             public void run()
                                  try
                                       Thread.sleep(50);
                                       System.out.println("Creating frame.jpg");
                                       frame.repaint();
                                       ScreenImage.createImage(frame, "frame.jpg");
                                  catch(Exception exc) { System.out.println(exc); }
                        }.start();
              final JButton button = new JButton("Create Images");
              button.addActionListener( new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        try
                             System.out.println("Creating desktop.jpg");
                             ScreenImage.createDesktopImage( "desktop.jpg" );
                             System.out.println("Creating frame.jpg");
                             ScreenImage.createImage(frame, "frame.jpg");
                             System.out.println("Creating scrollpane.jpg");
                             ScreenImage.createImage(scrollPane, "scrollpane.jpg");
                             System.out.println("Creating textarea.jpg");
                             ScreenImage.createImage(textArea, "textarea.jpg");
                             System.out.println("Creating button.jpg");
                             ScreenImage.createImage(button, "button.jpg");
                             button.setText("button refreshed");
                             button.paintImmediately(button.getBounds());
                             System.out.println("Creating refresh.jpg");
                             ScreenImage.createImage(button, "refresh.jpg");
                             System.out.println("Creating region.jpg");
                             Rectangle r = new Rectangle(0, 0, 100, 16);
                             ScreenImage.createImage(textArea, r, "region.png");
                        catch(Exception exc) { System.out.println(exc); }
              frame.getContentPane().add(button, BorderLayout.SOUTH);
              try
                   FileReader fr = new FileReader( "ScreenImage.java" );
                   BufferedReader br = new BufferedReader(fr);
                   textArea.read( br, null );
                   br.close();
              catch(Exception e) {}
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.pack();
              frame.setLocationRelativeTo( null );
              frame.setVisible(true);
    }

    guess i was making it harder than it really is...
         BufferedImage im = createImage (component );
         ImageClipboard.setClipboard( im );ImageClipboard:
    public  class  ImageClipboard {
        // This method writes a image to the system clipboard.
        // otherwise it returns null.
        public static void setClipboard(Image image) {
            ImageSelection imgSel = new ImageSelection(image);
            Toolkit.getDefaultToolkit().getSystemClipboard().setContents(imgSel, null);
        // This class is used to hold an image while on the clipboard.
        public static class ImageSelection implements Transferable {
            private Image image;
            public ImageSelection(Image image) {
                this.image = image;
            // Returns supported flavors
            public DataFlavor[] getTransferDataFlavors() {
                return new DataFlavor[]{DataFlavor.imageFlavor};
            // Returns true if flavor is supported
            public boolean isDataFlavorSupported(DataFlavor flavor) {
                return DataFlavor.imageFlavor.equals(flavor);
            // Returns image
            public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
                if (!DataFlavor.imageFlavor.equals(flavor)) {
                    throw new UnsupportedFlavorException(flavor);
                return image;
        // If an image is on the system clipboard, this method returns it;
        // otherwise it returns null.
        public static Image getClipboard() {
            Transferable t = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null);
            try {
                if (t != null && t.isDataFlavorSupported(DataFlavor.imageFlavor)) {
                    Image text = (Image)t.getTransferData(DataFlavor.imageFlavor);
                    return text;
            } catch (UnsupportedFlavorException e) {
            } catch (IOException e) {
            return null;
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
    }thanks for the help!

  • Using a tag manager with the Elq. tracking script.

    Has anyone had any luck using a tag managment tool to package the eloqua tracking scripts. We are using Google Tag Manager and not having any luck registering click-throughs on our emails.
    Let me know if you're having success and what you're doing to get there. Thanks.

    Jim -
    I've seen the scripts deployed and working properly across sites using various platforms from tag management to CMS that are truly tracking but where the tracking validator built into Eloqua doesn't validate the presences of the scripts.  The best way to check it is two fold: 1. visit the pages on with an uncookied browser, submit a form, etc. to get a cookie and then surf around and check the contact record in eloqua about 20 min later.  2.  look at the site map in eloqua to see if your pages are all visible.
    Lauren

  • Converting a class for use in a jsp page.

    I was just wondering if it is possible/normal to convert complex(ish) classes to change the output from the system.out, to a return value from a method that is displayed via a jsp page. (I am just beginning, and trying to make the coversion from asp with COM to jsp with beans/servlets and I am not yet fully understanding the technologies, and how you import classes etc - please bear with me!)
    first, I made a class that has a method that just returns a string. like:
         public String GetAValue()
              return "Hello there.";
         }and then I made a jsp page that imported the class (test) like:
    <%@ page import="Test" %>
    <jsp:useBean id="tst" scope="page" class="Test" />
    st = tst.GetAValue();
    out.println(st);
    Which to my delight, worked fine! Then I made another class that retrieved a value from a web service. kind of like...
         public String GetAValueFromAWebService(){
              return theWebService.GetValueFromWebServiceMethod();
         }This class also works good when I just run via "java testit". But when I went to do the same as above ,ie, import the class, do a usebean then do st=tst2.GetValueFromWebServiceMethod(), I could not get it to work at all. This class does lots more tricky stuff then the first one though - it loads its properties from a .properties file via an instance of another class, and imports funky stuff like - import org.uddi4j.* and import java.util.Vector; and more.
    Ok, now the question! Is what I am trying to do stupid? If so, how should I do it? If its not stupid, how do I include all the extra import statements on the jsp page (there are about 10)
    Wow, sorry about the length of this post. I hope someone can understand my ramblings!
    Thanks,
    nmoog.

    Sorry, yeah...
    I am actually using the UDDI4J package, and it loads various settings with the
    config = Configurator.load(); (a seperate class to load stuff in with)
    The Configurator.Load method basically just does:
    config.load(new java.io.FileInputStream("samples.prop"));
    and then does System.setProperty() with the config.getProperty()
    values.
    I have a test class when I do "java Test" it runs and in the Main method just instantiates the MyWebService class and does the MyWebService.GetAWebServiceValue() which returns a string.
    As I said, this runs fine. But from the JSP code if I do the same thing it gets a NullPointerException.
    "java.lang.NullPointerException
    at java.util.Hashtable.put(Hashtable.java:389)
    at java.util.Properties.setProperty(Properties.java:102)
    at java.lang.System.setProperty(System.java:654)
    at Configurator.load(Configurator.java:43)"
    Why can it load okie-dokey from the test class, but not the jsp page? Any ideas?

  • How to convert a .jsp to a .java/.class for use in pplcode

    .

    At first , thanks for your help ,armalcolm
    But I don't understand how to convert java string array to c string(char)array.I have seen the doc. , but I don't understand still.
    Belown is my code
    <code>
    JNIEXPORT void JNICALL Java_init
    (JNIEnv *env, jobject jobj, jobjectArray jfilename, jint jlength)
         jobject obj = env->NewObject(env,mid,param);
         jobjectArray obj_java = (jobjectArray)env->CallObjectMethod(obj,mid,param);
         length = jlength;
         filename = (char**) malloc(length * sizeof(char*));
         for (i=0;i<length;i++)
              jstring jstr = env->(jstring) GetObjectArray(obj_java,i);
              filename[i] = (char*) malloc(strlen(jstr)+1);
              strcpy(filename,GetStringUTFChars(jstr,0));
    </code>
    I know this is a error codes.Can you help me??
    I don't know how to use NewObject() , CallObjectMethod() and GetObjectArray() method
    Thanks

  • Cannot convert ÿØÿà of type class java.lang.String to class BFileDomain.

    Hi All,
    I am using Jdeveloper 11.1.2.3.0.
    I have a scenario of making an ADF page where I have a IMAGE field to show on the page. So,I have a table called "PRODUCT" with fields called photo with BFILE type. Now when I the data i have inserted using the DML command and i can see the path at the backend.
    However,when i am runnig my ADF page in the Filed called "PHOTO" I can only see a junk character stating 'yoyo'.
    When I click on it, it says ERROR "Cannot convert ÿØÿà of type class java.lang.String to class oracle.jbo.domain.BFileDomain".
    Your help will be appreciated ASAP.
    Regards,
    Shahnawaz

    Hi,
    did you show the id-value in the user interface as a input-component, and did the input-component include a converter?
    If yes, show the id as output-text and remove any existing converter-components.
    Best Regards

  • XML file in the form of .config file how to convert it to class and store it in single object

    Hi,
    I have a config file in which i have to convert it to class and get an object.
    example:
    <?xml version="1.0" encoding="utf-8" ?>
    <xyz xmlns="">
      <Container name ="Basic">
        <Connectivity user="" server="" protocol="udp"/>
        <Connectivity user="" server="" protocol="udp"/>
      </Container>
      <Container name ="Cp">
        <settings version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.counterpath.com/cps">
          <domain name="audio">
            <section name="headset">
              <setting name="audio_in_agc_enabled " value="1"/>
            </section>
            <section name="incoming">
              <setting name="use_agc" value="1"/>
            </section>
            <section name="vad">
            </section>
          </domain>
          <domain name="system">
            <section name="qos">
              <setting name="audio" value="tos 46"/>
            </section>
            <section name="dtmf">
              <setting name="force_send_in_band" value="0"/>
              <setting name="minimum_rfc2833_play_time" value="40"/>
            </section>
            <section name="network">
              <setting name="dtx_enabled" value="0"/>
            </section>
            <section name="diagnostics">
              <setting name="enable_logging" value="1"/>
              <setting name="log_level" value="Error"/>
            </section>
            <section name="general">
              <setting name="add_OS_version_to_user_agent_header" value="1"/>
            </section>
            <section name="indialog_notify">
              <setting name="enable_indialognotify" value="1"/>
            </section>
          </domain>
          <domain name="rtp">
            <section name="2833">
              <setting name="enabled" value="1"/>
              <setting name="packet_time_in_ms" value="60"/>
              <setting name="payload_number" value="101"/>
            </section>
            <section name="inactivity">
              <setting name="timer_enabled" value="0"/>
            </section>
          </domain>
          <domain name="proxies">
            <section name="proxy0">
            </section>
            <section name="proxy1">
            </section>
          </domain>
          <domain name="ggg">
            <section name="device">
              <setting name="use_headset" value="1"/>
              <setting name="rrr" value="1"/>
              <setting name="eee" value="480"/>
              <setting name="eme" value="hhh"/>
              <setting name="headset_name" value="vvv"/>
              <setting name="manual_audio_devices_configure" value="0"/>
              <setting name="audio_in_device" value=""/>
              <setting name="audio_out_device" value=""/>
              <setting name="ringer_device" value=""/>
            </section>
            <section name="system">
              <setting name="export_settings" value="EndpointSettings.xml"/>
              <setting name="enable_export_settings" value="0"/>
              <setting name="log_level_AbstractPhone" value="0"/>
              <setting name="log_level_Audio" value="0"/>
              <setting name="log_level_Auto Configuration" value="0"/>
              <setting name="log_level_CCM" value="0"/>
              <setting name="log_level_Conferencing" value="0"/>
              <setting name="log_level_Contacts" value="0"/>
              <setting name="log_level_DNS" value="0"/>
              <setting name="log_level_GUI" value="0"/>
              <setting name="log_level_Jitter" value="0"/>
              <setting name="log_level_Licensing" value="0"/>
              <setting name="log_level_Media" value="0"/>
              <setting name="log_level_Privacy" value="0"/>
              <setting name="log_level_RTP" value="0"/>
              <setting name="log_level_STUN" value="0"/>
              <setting name="log_level_Security" value="0"/>
              <setting name="log_level_Storage" value="0"/>
              <setting name="log_level_Transport" value="0"/>
              <setting name="log_level_USB Devices" value="Info"/>
              <setting name="log_level_Utilities" value="0"/>
              <setting name="log_level_Video" value="0"/>
              <setting name="log_level_Voice Quality" value="0"/>
              <setting name="log_level_XMPP" value="0"/>
              <setting name="log_level_Endpoint" value="6"/>
            </section>
            <section name="beeptone">
              <setting name="play_locally" value="0"/>
              <setting name="enable_beeptone" value="1"/>
              <setting name="beeptone_file" value="beep.wav"/>
              <setting name="beeptone_timeout" value="30000"/>
            </section>
            <section name="dtmf">
              <setting name="play_locally" value="1"/>
              <setting name="pause_start_stop_dtmf" value="100"/>
            </section>
            <section name="control">
              <setting name="auto_answer" value="0"/>
            </section>
            <section name="ctrol">
              <setting name="auto_ans" value="0"/>
            </section>
          </domain>
        </settings>
      </Container>
    </xyz>
    Please help me out in creating an object from it.
    Thanks,
    Hiranmayee

    It's one of those things you usually start from the other end.
    IE with a class and then serialise / deserialize to xml.
    Because you have a namespace in there:
    <settings version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.counterpath.com/cps">
    I think you will find linq to xml will have issues with that.
    You could still use xpath to pick data out of there and there's been a thread on the c# forum recently which is relevent:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/2dc0581e-f2fd-4fd3-89ee-e59280c398e6/read-xml?forum=csharpgeneral
    Why do you want to turn that into an object?
    By the way.
    This isn't a wpf question and you should probably have posted it on the c# forum.
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • How to convert JSP Compiled class file back to JSP

    Is their any way to convert the JSP converted class file back into JSP file, I have few JSP files missing in my application but i do have class files deployed corresponding to the JSP file. Is their any way where i can convert my JSP class file back to JSP. I tried used decompliers but it conerts the class file into JAVA files, Is their any such decompiler that converts the JSP converted class file into Java files.
    Thanks in Advance.

    nope...its not et al possible...!!!
    You cant convert class file back to JSP....!!

  • Cannot drop the table because it does not exist in the system catalog. Transaction context in use by another session

    Hi Every one,
    An error has occurred during report processing. (rsProcessingAborted)
    Get Online Help
    Query execution failed for data set 'NonFinTran'. (rsErrorExecutingCommand)
    Get Online Help
    Cannot drop the table '#NonFinTran', because it does not exist in the system catalog. Cannot drop the table '#MultipleNonFinTran',
    because it does not exist in the system catalog. Transaction context in use by another session.
    NOTE: NonFinTran &
    MultipleNonFinTran are
    the Temp table in my storedPoc.
    Please any help me to solve this issue. 
    Thanks & Regards,
    Anil Kumar
    Anil Kumar

    Hi Harsh,
     Below is my Stored Proc
    SELECT @ServerName=datasource from master.dbo.sysservers WHERE catalog='Voyager'    
     SELECT @ServerName3=datasource from master.dbo.sysservers WHERE catalog='AuditLog'    
     SELECT @ServerName2=datasource from master.dbo.sysservers WHERE catalog='Portal'    
     IF @ServerName IS NOT NULL SET @ServerName='[' + @ServerName + '].' ELSE SET @ServerName=''    
     IF @ServerName3 IS NOT NULL SET @ServerName3='[' + @ServerName3 + '].' ELSE SET @ServerName3=''    
     IF @ServerName2 IS NOT NULL SET @ServerName2='[' + @ServerName2 + '].' ELSE SET @ServerName2=''    
     IF Exists(Select * From tempdb.dbo.SysObjects Where Name Like '#NonFinTran%')     
      DROP TABLE #NonFinTran    
     IF Exists(Select * From tempdb.dbo.SysObjects Where Name Like '#MultipleNonFinTran%')     
      DROP TABLE #MultipleNonFinTran    
     CREATE TABLE #NonFinTran (FirstName VARCHAR(40), TaxId VARCHAR(40), TrxID VARCHAR(40), Status VARCHAR(255), Field1 VARCHAR(255), Field2 VARCHAR(255),    
       Field3 VARCHAR(255), Field4 VARCHAR(255), Field5 VARCHAR(255), Field6 VARCHAR(255), DateTime DATETIME,     
       BranchID CHAR(3), BankID CHAR(1), FromAccountID VARCHAR(255), FromAccountType VARCHAR(255))    
     CREATE TABLE #MultipleNonFinTran (FirstName VARCHAR(40), TaxId VARCHAR(40), TrxID VARCHAR(40), Status VARCHAR(255), Field1 VARCHAR(255), Field2 VARCHAR(255),    
       Field3 VARCHAR(255), Field4 VARCHAR(255), Field5 VARCHAR(255), Field6 VARCHAR(255), DateTime DATETIME,     
       BranchID CHAR(3), BankID CHAR(1), FromAccountID VARCHAR(255), FromAccountType VARCHAR(255))     
    INSERT #NonFinTran    
     EXEC('SELECT FirstName, TaxID,     
      TrxID, Status, TrxField1, TrxField2, TrxField3, TrxField4, TrxField5, TrxField6, DateTime, '''', '''', '''', ''''    
     FROM ' + @ServerName3 + 'AuditLog.dbo.CCAuditLogEntryView AS Audit, ' + @ServerName + 'Voyager.dbo.CCUser AS CCUser    
     WHERE CCUser.UserID = Audit.UserID     
      AND Audit.Succeeded = 1     
      AND Audit.TrxID IN (''ChangeBillPayDefaultAccountEdit'',''ChangeExpiryUserPassword'',''ChangePasswordEdit'',    
       ''ChangeUserPassword'',''ManageAddressMaint'',''ManageContactMaint'',''ManageSecretQuestionAnswerEdit'',    
       ''ManageTransLimitMaint'',''OtherBankAccountMaintAdd'',''OtherBankAccountMaintDelete'',''OtherBankAccountMaintEdit'',    
       ''WithinAmBankAccountMaintAdd'',''WithinAmBankAccountMaintDelete'',''WithinAmBankAccountMaintEdit'',    
       ''SetAccountMaskPreferenceAudit'',''ChangeLoginIdAudit'')     
      AND DATEDIFF(DAY, CONVERT(DATETIME, CONVERT(VARCHAR(10), ''' + @StartDate + '''), 103), Audit.DateTime) >= 0     
      AND DATEDIFF(DAY, CONVERT(DATETIME, CONVERT(VARCHAR(10), ''' + @EndDate + '''), 103), Audit.DateTime) <= 0 ')    
     INSERT #MultipleNonFinTran    
     EXEC('SELECT DISTINCT FirstName, TaxID,     
      TrxID, Status, TrxField1, TrxField2, TrxField3, TrxField4, TrxField5, TrxField6, Audit.DateTime as AuditDateTime,    
    (SELECT DISTINCT SUBSTRING(A.BranchCode,3,3)  FROM ' + @ServerName + 'AuditLog.dbo.CCAuditLogEntryView X INNER JOIN ' + @ServerName + 'Voyager.dbo.CCuser U
    ON X.UserId = U.UserId INNER JOIN ' + @ServerName + 'Voyager.dbo.AMHZ_CustomerProfile P ON P.EnrolId = U.TAXID 
    INNER JOIN ' + @ServerName + 'Voyager.dbo.AMHZ_AccountListing A ON A.CIFNO = P.CIFNO
    WHERE X.UserId = Audit.UserId AND A.AccountNo = SUBSTRING(Audit.TrxField1,11,16) AND P.CIFNO = A.CIFNO
    AND (SUBSTRING(A.BranchCode,3,3) <> NULL OR SUBSTRING(A.BranchCode,3,3) <> '''')
    AND CHARINDEX(''AccountID='', Audit.TrxField1, 1) > 0),
      SUBSTRING(TrxField1,14,1), CASE WHEN CHARINDEX(''AccountID='', TrxField1, 1) > 0 THEN     
      SUBSTRING(TrxField1,11,16) ELSE '''' END, CASE WHEN CHARINDEX(''AccountType='', TrxField2, 1) > 0 THEN SUBSTRING(TrxField2,13,3) ELSE '''' END    
     FROM ' + @ServerName3 + 'AuditLog.dbo.CCAuditLogEntryView AS Audit, ' + @ServerName + 'Voyager.dbo.CCUser AS CCUser    
     WHERE CCUser.UserID = Audit.UserID     
      AND Audit.Succeeded = 1     
      AND Audit.TrxID IN (''SetAccountAttributesAudit'',''SetAccountFriendlyNameAudit'',    
      ''AccountProfileMaintULDelete'',''AccountProfileMaintLHAAdd'',''AccountProfileMaintLSCAdd'')
      AND DATEDIFF(DAY, CONVERT(DATETIME, CONVERT(VARCHAR(10), ''' + @StartDate + '''), 103), Audit.DateTime) >= 0     
      AND DATEDIFF(DAY, CONVERT(DATETIME, CONVERT(VARCHAR(10), ''' + @EndDate + '''), 103), Audit.DateTime) <= 0 ')  
      SET @stmt = '    
     SELECT * FROM    
     SELECT BranchName,
     CASE WHEN SUBSTRING(FromAccountID,1,6) IN (''519901'',''559409'')  THEN ''DC''  
    ELSE       
     CASE FromAccountType WHEN ''01'' THEN ''SA '' WHEN ''02'' THEN ''CA '' WHEN ''03'' THEN ''FD ''     
        WHEN ''SA'' THEN ''SA '' WHEN ''CA'' THEN ''CA '' WHEN ''FD'' THEN ''FD '' ELSE FromAccountType + '' ''    
     END 
     END +     
    case when Len(FromAccountID) =16 Then  
       CASE FromAccountType WHEN ''VC'' THEN   
       SUBSTRING(FromAccountID,1,6)+''******''+SUBSTRING(FromAccountID,13,4)      
    WHEN ''MC'' THEN SUBSTRING(FromAccountID,1,6)+''******''+SUBSTRING(FromAccountID,13,4)  END  
         when Len(FromAccountID) =15 Then 
    CASE FromAccountType WHEN ''VC'' THEN   
       SUBSTRING(FromAccountID,1,6)+''******''+SUBSTRING(FromAccountID,13,3)      
    WHEN ''MC'' THEN SUBSTRING(FromAccountID,1,6)+''******''+SUBSTRING(FromAccountID,13,3)  END  
         ELSE FromAccountID   
    ENd  
     AS FromAcctNo,    
     CASE TrxId  
     WHEN ''AccountProfileMaintLHAAdd'' THEN ''Link Account/Card''    
     WHEN ''AccountProfileMaintLSCAdd'' THEN ''Link Account/Card''    
     WHEN ''APMFamilyFirstAdd'' THEN ''Link Family First Account''    
     WHEN ''AccountProfileMaintULDelete'' THEN ''Unlink Account/Card''    
     WHEN ''BalInqFD'' THEN CASE  WHEN Field3 IN (''APMLink=SUCCESS'') THEN ''APMLink Success'' ELSE ''Fixed Deposit Balance Inquiry'' END  
     WHEN ''BalInqCASA'' THEN CASE  WHEN Field3 IN (''APMLink=SUCCESS'') THEN ''APMLink Success'' ELSE
         CASE WHEN FromAccountType IN (''SA'',''01'') THEN ''Savings Account Balance Inquiry'' 
        ELSE ''Current Account Balance Inquiry'' 
       END 
      END    
     WHEN ''StopCheck'' THEN ''Stop Cheque Request''    
     WHEN ''CheckReorder'' THEN ''Order Your Cheque''    
     WHEN ''CheckInquiry'' THEN ''Cheque Inquiry''    
     WHEN ''TransHistFD'' THEN ''Fixed Deposit Transaction History''    
     WHEN ''TransHistCASA'' THEN    
      CASE WHEN FromAccountType IN (''SA'',''01'') THEN ''Savings Account Transaction History'' ELSE ''Current Account Transaction History'' END    
     WHEN ''StmtInqCC'' THEN    
      CASE WHEN FromAccountType IN (''DR'',''03'') THEN ''Debit Card Statement Inquiry'' ELSE ''Credit Card Statement Inquiry'' END    
     WHEN ''StmtInqDA'' THEN    
      CASE WHEN FromAccountType IN (''SA'',''01'') THEN ''Savings Account Statement Inquiry'' ELSE ''Current Account Statement Inquiry'' END    
     WHEN ''StmtReq'' THEN ''Printed Statement Request''    
     WHEN ''StmtInqIAMSTAR'' THEN ''E-AMSTAR Statement Inquiry''    
     WHEN ''Repayment/Transfer Inquiry'' THEN ''Repayment/Transfer Inquiry''    
     WHEN ''Account Inquiry'' THEN ''Account Inquiry''    
     WHEN ''Payment Inquiry'' THEN ''Payment Inquiry''    
     END AS TransType,    
     FirstName AS CustomerName,    
     TaxId, CONVERT(VARCHAR, DateTime, 103) AS Date, CONVERT(VARCHAR, DateTime, 108) AS Time    
     FROM #NonFinTran, ' + @ServerName3 + 'Portal.dbo.TB_Branch AS TB_Branch    
     WHERE     
     BranchId = TB_Branch.BranchCode     
     AND (TB_Branch.InstCode IN (''00001'', ''00003'',''001'',''002''))    
     AND (FromAccountType IN (''SA'', ''CA'', ''FD'', ''01'', ''02'', ''03'')))'    
    EXEC (@stmt)
    IF Exists(Select * From tempdb.dbo.SysObjects Where Name Like '#NonFinTran%')     
     DROP TABLE #NonFinTran    
     IF Exists(Select * From tempdb.dbo.SysObjects Where Name Like '#MultipleNonFinTran%')     
      DROP TABLE #MultipleNonFinTran    
    Anil Kumar

  • Offline market basket email functionality yielding nicely-formatted emails

    I'm using htmlresources.zip contents in an InDesign folio to give some market basket functionality for customers working with sales reps. In the html/javascript/jquery code, I would like to allow the reps to send the basket info to the customers when they are ready, and I need the folio to work offline (so we’re not dependent on the internet for this app to function).  The problem I am having is that mailto: does not appear to work using html tags in all the popular email clients (so I’m not using html tags), and the columns in the body of my email only line up if the customers email display is using mono-spaced fonts (which is not always the case—btw, tabs do not appear to work very well with mailto either).  Hence, if our sales reps want the columns to line up nicely in the body of the email, I can only see a few options, namely: 1) stick with plain text mailto: issues, 2)write a separate XCode app to receive urls from the folio with all the email info included and then transmit those strings to a server-side mail server for transmission once internet connectivity is available, 3) somehow generate a pdf  (to make the basket pretty, line up columns, include nice pictures, etc.)  on the fly inside InDesign using Adobe api’s or using html5/javascript/jquery api’s and then include a link to that new pdf in the mailto: url or save the generated pdf off in the IPad somewhere.  In the latter case, reps can then use the IPad to manually email the pdf themselves when they are ready.  These are some things I’m working with and looking for some help in figuring out best methods.  Thank you.

    Moved to DPS forum.

  • Exception in transaction commit when using Web Service Atomic Transaction

    Hi all,
    I am following this tutorial from Oracle on how to use WS-AT
    http://docs.oracle.com/cd/E14571_01/web.1111/e13734/transaction.htm
    A brief description about my application, which is wrote in JDeveloper:
    Two applications, one for web service and one for client.
    The WS is backed by an stateless EJB, which use JPA entity to do operations on the Oracle XE DB. The EJB transaction is container-managed, and the Entity Manager is retrieved from the JTA Datasource by using @PersistenceContext
    I put this on the EJB implementation class:
    @WebService(...)
    @TransactionAttribute(value = TransactionAttributeType.MANDATORY)
    @Transactional(version = Transactional.Version.WSAT10,
    value = Transactional.TransactionFlowType.MANDATORY)
    On the client application, I use another EJB to call the WS. The proxy and all generated types are created properly by JDev. I put this on the @WebServiceReference point in the client EJB:
    @Transactional(version = Transactional.Version.WSAT10,
    value = Transactional.TransactionFlowType.MANDATORY)
    The client EJB is also annotated with:
    @TransactionAttribute(value = TransactionAttributeType.REQUIRED)
    Both applications are deployed successfully in the integrated weblogic server. But when I run the method in the client EJB that call the WS to do a persisting operation on the DB, the following exception is thrown:
    javax.ejb.EJBException: BEA1-00227DF3AF249E472B1E: javax.transaction.xa.XAException: Failed state during prepare of WS-AT XAResource ...
    which causes:
    Exception occurred during commit of transaction Name=[EJB +_the client EJB's calling method_+
    The weird thing is, if I call a method which does a simple System.out.println (no DB related operation) then no exception is thrown.
    Furthermore, if I switch both WS EJB and client EJB to use bean managed transaction, the transaction is not propagated properly, as I see that UserTransaction in the WS EJB does not have the same status as UserTransaction in the Client EJB.
    Hence I'm suspecting that there is some issue during step 4 described in the Oracle documentation:
    "Server B receives the request for Application B, detects that the header contains a transaction coordination context and determines whether it has already registered as a participant in this transaction. If it has, that transaction is resumed and if not, a new transaction is started.
    *Application B executes within the context of the imported transaction. All transactional resources with which the application interacts are enlisted with this imported transaction*."
    This is all I can find. Please help me on how to resolve the exception.
    Thanks.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hi r035198x,
    Thanks for your help. The problem indeed is in the non-XA datasource I used for the EntityManager. I created datasource what uses XA Thin Oracle driver and everything works fine now, commit and rollback both work nicely.
    Again thanks a lot.

  • No option to convert control to class

    Hi,
    I got fairly deep into a project here and realized that I really ought to make one of my controls into a class (I want to flatten it to an XML file to save it, and unflatten to load even if the control has been updated).
    I was under the impression that it should be fairly straightforward, according to the help file on the subject, but when I go to the project explorer and try to right-click the control, I get no such option.  Not even greyed out.  See attached picture... I censored some file names for company confidentiality but the right click menu and project explorer are visible.
    I am using LabVIEW 2011 SP1 on Windows 7 64-bit.
    I am using this control in 37 VIs according to the "find callers" option so I am really hoping to not have to manually replace it and all of the wires to it in every single one.
    Any ideas?
    Attachments:
    labview no convert control to class.png ‏35 KB

    Not a single one of my controls can be converted to a class.  Even if I create a new project and a new control with just a couple things in it.
    The control in question has a bunch of other controls in it (7 enums, 3 U8s, 2 booleans, and a string) as well as an array of strings and 3 arrays of other custom controls.  But seeing as how even the most primitive control doesn't work, I don't think this is the issue.
    The control and all sub-controls are currently strict typedefs, but like I said, any new control with just one numeric in it also has this same issue, so this is also probably not the issue.
    No x-controls.
    The control isn't part of an existing class, so it's not private.  It nor any control it contains is locked.
    I checked, and despite being a 64-bit version of Windows 7 the LabVIEW version I have is 32-bit.

Maybe you are looking for