PatternSyntaxException when calling String.replaceAll in multithreaded app

Dear,
Someone ever encountered or knows of problems when invoking String.replaceAll in a multithreaded application (JDK 1.4.2)?
I have an application that invokes replaceAll on a String and that runs just fine when only a single thread is active, but once multiple threads execute the same code, each on its own String instance, the following stack is produced (more often than not).
java.util.regex.PatternSyntaxException: Unknown character category {Digit} near index 9
^\p{Digit}
^
at java.util.regex.Pattern.error(Unknown Source)
at java.util.regex.Pattern.familyError(Unknown Source)
at java.util.regex.Pattern.retrieveCategoryNode(Unknown Source)
at java.util.regex.Pattern.family(Unknown Source)
at java.util.regex.Pattern.sequence(Unknown Source)
at java.util.regex.Pattern.expr(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.util.regex.Pattern.<init>(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.lang.String.replaceAll(Unknown Source)
The 1.4.2 source code seems to use a static HashMap (java.util.regex.Pattern#retrieveCategoryNode) to store some read only data, but it looks like the initialization of that HashMap in an multi threaded environment is not 'locked'. Could that be the/an issue? Anybody any thoughts?
Thanks,
Peter

I ran peter's program on a hyperthreaded Intel P4 box and XP Pro. XP reports that there are 2 processors.
I used 1.4.2_06 and 1.5.0_01, with both -client and -server options.
The program was run with numThreads 10 and loadPattern 0 and 1.
The program was run 50 times for each of the configurations. Only one resulted in failures, as follows:
Java version     cli/svr          Pgm Parms   # Failures      
1.5.0_01     -client          10, 0          0
                    10, 1          0
          -server          10, 0          0
                    10, 1          0
1.4.2_06     -client          10, 0          10
                    10, 1          0
          -server          10, 0          0
                    10, 1          0
Of the 10 failures, 1 reported 3 errors, 2 reported 2 errors, and 7 reported 1 error.
The triple-error report is below:
"C:\Program Files\Java\jdk1.4.2_06\bin\java.exe" -client PatternProblem 10 0
Thread-7:Unknown character category {Digit} near index 9
^\p{Digit}
         ^
Thread-5:Unknown character category {Digit} near index 9
^\p{Digit}
         ^
Thread-3:Unknown character category {Digit} near index 9
^\p{Digit}
         ^
Note that this wording is not the same as peter encountered. The thread number varied,
apparently randomly, from 0 to 8

Similar Messages

  • On my iPhone 4, people cant hear me when I make and / or receive normal (GSM) phone calls. But when on calls using internet based / native apps like viber or skype, people can hear me just fine. Voice memos work too and have already tried different SIMs

    On my iPhone 4, people cant hear me when I make and / or receive normal (GSM) phone calls. But when I make/receive calls using internet-based / native apps like viber or skype, people can hear me just fine. I have tried recording my voice using voice memos - this works. And have already tried different SIM cards but the problem persists.
    I have taken my phone to an authorized Apple service center, where they restored my phone to factory settings, but still facing the same issue. They service center directed me to Apple Customer Care Hotline, where I have now spent 3+ hours explaining my issue and yet no one can resolve it. The easy answer if to replace the phone - and since it is out of warranty, I am expected to pay for it.
    Additionally, the customer service has been so rude and confrontational that it has completely changed my view of Apple and its customer focus. I am a disappointed and angry customer today - people would be surprised to hear just how rude customer service was including making statements such as "Apple doesnt make infallible products, that's why warranty is needed for our products" and that "every product undergoes a problem at some stage, so do ours!" There goes whatever confidence I had...
    My concern is simple - if no one at Apple and / or its CS hotline is able to address my issue comprhensively and keep telling me that they have never encountered a precedent before, then with what right can they expect me to pay for a replacement?! I am NOT here to fund Apple's research into their product faults and manufacturing.
    And even though a customer is out of warranty, is it too much to expect an Apple product to work well for at least a 'reasonable' period of time. My phone is less than 18 months old and has been facing this issue for the past 2 months - surely the longevity of Apple products is more than 18 months!
    Just a sad sad day for an Apple customer, compounded by unjustifiably rude and aggressive staff. And still no resolution to my problem.

    I am having the same issue - with my last 2 iPhone 4's. My first handset each time I was on a call wether it was up to my ear or on loud speaker, the call would automatically mute even though the mute button wouldn't show up as highlighted. Pressing the mute button on and off during the call doesn't fix it either. I rang Apple and asked what some of their trouble shooting solutions were. I got told that it might be a software issue and to install the latest software update. This failed. I then got told to uninstall the software on the phone and do a complete restore. This also failed. After trying the troubleshooting suggestions, I took the phone into my provider and they sent me out a new phone within a week under warranty claiming it was a hardware issue and probably just a "glitch" with that particular phone. This was not the case....
    After receiving my second iPhone 4, I was hopeful that it would work. For the first couple of days, making/receiving calls was not an issue. Until after about a week, the same problem started again. In one instance I had to hang up and call back 4 times and the call would still automatically mute after about 5 seconds. Also on the second handset, the main camera located on the back of the phone has red and blue lines running through it and can't take a decent picture. So back to the store I go to get another replacement - Again.
    For a phone that is rated highly and as a keen Apple product purchaser, I am a bit disappointed with the experience I have had with the iPhone 4. Let's hope they find a fix sometime soon because this is becoming a bit beyond a joke.....!!

  • WDA app not launched with SSO when called from portal

    Hi,
    we have configured our systems so that our portal (NW Portal 7.0) is issuing logon tickets and ERP6.0 is receiving them in the backend for single sign-on.
    When launching a SAP GUI for Windows transaction (System admin->Support->SAP Application) to test if the SSO is set up correctly, all goes well and I'm able to call e.g. SU01 with logon tickets from the portal.
    My problem is that when calling a Web Dynpro for ABAP application in the same backend system from the same portal, I get an error "SSO logon not possible; logon tickets not activated on the server" and need to login manually when starting the application.
    When looking at the WDA app URL, I see http://<backend server>.<domain1>.com/... and the portal is sitting on http://<portal server>.<domain2>.com. Could it be a problem if the backend system is in another domain? And if yes, how come the SAP GUI for Windows launch then works (related to an http connection and domain relaxing?)? How to go forward and make it work all right?
    Best regards,
    Mikko

    Hi Navarro,
    Merry Xmas:)
    >>We did the same test with the demo app from you (MS)
    http://msdn.microsoft.com/en-us/library/windows/apps/hh202967(v=vs.105).aspxand it still don't work. (remember to setup
    fast app resume)
    Yes, I can reproduce your issue using the official sample.
    I think this issue is caused by the mechanism of Fast app resume, please refer to the following reference:
    #Fast app resume for Windows Phone 8
    http://msdn.microsoft.com/en-us/library/windows/apps/jj735579(v=vs.105).aspx
    Quote:
    With Fast Resume, when an app is resumed, the system creates a new page instance for the target of the launch point and this page is placed on top of the app’s existing backstack.
    This official sample can also help us to understand how it works:
    https://code.msdn.microsoft.com/windowsapps/Fast-app-resume-backstack-f16baaa6
    We could find that the Application.Launching event will not be triggered if we used Fast app resume, this will affect responding Toast's parameter(Deep Link).
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Show a different view when called from different app.

    Hi,
    I have the requirement of showing a different view in the same window when called from different apps (urls).
    I have created different start-up inbound plugs and assigned them to the different apps but I can't figure out how to code the view switch.
    Any idea?
    thanks in advance,
    David R.

    hi,
    It is possible.
    Click on the Properties tab of application.In that screen click on the seach help option against Interface view.It will show all views you have created. Select the desired view to which the application has to point.
    Don't forget to give the  plug name which is under that interface view
    Now the application invokes the new view which u have pointed.
    If you have doubts in this please inform me.
    Regards,
    Ramanan
    Edited by: Ramanan Panchabakesan on Sep 3, 2008 1:50 PM
    Edited by: Ramanan Panchabakesan on Sep 3, 2008 1:51 PM

  • LV 6.0.2: an App-built dll gives a runtime error when called by C

    I want to use Labview 6.0.2 VIs as DLL's in a Borland C++ Project.
    Starting with the simple I have made a VI that returns a constant int32 then built a dll with the Application Builder and put the dll and include file in a BC++ project directory. Compile and link seems to run well. But when excuting the call to the LV fuction gives Fatal Error: labview.lib was not called from a Labview process.
    It seems this question was posted before, but answer didn't help me, Sorry.
    7.1 -- 2013
    CLA

    Hi Gabriela -
    This question is answered in the KB article entitled : "LabVIEW.LIB Error When Calling a DLL Built with LabVIEW"
    The link for this document is -> http://ae.natinst.com/operations/ae/public.nsf/fca7838c4500dc10862567a100753500/a4c3aef93240280a86256931006fb66c?OpenDocument
    Or you can go directly to www.ni.com/support and search for this document and others to help.
    The reason for this is that the old labview.lib does not know how to correctly locate the LabVIEW Run-Time Engine when called.
    From the document I posted ->
    Your dll is most likely making a call If you want to call a Windows DLL or CIN built with a version of cintools before LabVIEW 6.0, you must relink the DLL with the labview.lib from 6.0. If you call an old DLL or CIN in your LabVIE
    W DLL, you receive the aforementioned error and the application terminates, because the old labview.lib does not know how to correctly locate the LabVIEW Run-Time Engine when called in this situation.
    Good luck-
    ben schulte
    national instruments

  • Error when calling a package function

    any insight why my object is erroring out when calling a function. the error is
    oracle.apps.fnd.framework.OAException: java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at line 1
    it errors out when the cs.execute() is . is it the placement ? thanks for the help....
    then pkg func is xxx.get_log
    Get_Log(rmode IN NUMBER , doc_type IN VARCHAR2 DEFAULT 'TEL', doc_id IN VARCHAR2 DEFAULT NULL,
    doc_num IN VARCHAR2 DEFAULT NULL -- , p_out out varchar2 --
    RETURN varchar2 IS....
    the co
    Serializable paramDocLocatorParamList [] = {paramRMODE, paramDOC_TYPE, paramDOC_ID, paramDOC_NUM, p_out };
    OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean);
    OADBTransaction dbtrans;
    OAViewObject docLocator = (OAViewObject)am.findViewObject("DocLocatorVO1");
    rtxt0.setValue(pageContext, "here it is" + am.invokeMethod("getHTMLString", paramDocLocatorParamList));
    docLocator.executeQuery();
    // am.invokeMethod("getHTMLString", paramDocLocatorParamList);
    the impl
    public String getHTMLString ( String paramRMODE, String paramDOC_TYPE, String paramDOC_ID, String paramDOC_NUM, String p_out )
    System.out.println("Entering The AM Impl");
    CallableStatement st = null;
    OADBTransaction txn = (OADBTransaction)getDBTransaction();
    Connection conn = txn.getJdbcConnection();
    String sql = " BEGIN :5 := test_proc.get_log(:1, :2, :3, :4 ); END; ";
    CallableStatement cs = txn.createCallableStatement(sql,1);
    String ErrorExist = "";
    String getHTML = "";
    try
    cs.setString(1, paramRMODE);
    cs.setString(2, paramDOC_TYPE);
    cs.setString(3, paramDOC_ID);
    cs.setString(4, paramDOC_NUM);
    cs.setString(5,p_out); // --param   
    /* cs.registerOutParameter(1,Types.CHAR);
    cs.registerOutParameter(2,Types.CHAR);
    cs.registerOutParameter(3,Types.CHAR);
    cs.registerOutParameter(4,Types.CHAR);*/
    cs.registerOutParameter(5,Types.CHAR);
    cs.execute();
    getHTML = cs.getString(5 ) ;
    /* System.out.println("getHTML is " + getHTML );
    cs.close();
    // if ( "E".equals(ErrorExist))
    /// throw new OAException ("Payment Request Is Already Cancelled" );
    catch (SQLException sqle)
    try { cs.close(); }
    catch (Exception e) {}
    throw OAException.wrapperException(sqle);
    String doctype = paramDOC_TYPE;
    String docnum = paramDOC_NUM;
    String html ;
    System.out.println( "paramDOC_TYPE in IMPL is " + doctype) ;
    System.out.println( "paramDOC_Numb in IMPL is " + docnum) ;
    return getHTML;

    resolved.....
    public String getHTMLString (String p_out , String rmode, String doc_type, String doc_id, String doc_num )
    System.out.println("");
    System.out.println("Entering The AM Impl");
    // System.out.println("Passing getDocAbbrForHTML in IMPL -------> " +getDocAbbrForHTML     );
    // System.out.println("Passing paramDOC_NUM in IMPL -------> " + paramDOC_NUM );
    System.out.println("Passing getDocAbbrForHTML in IMPL -------> " +doc_type     );
    System.out.println("Passing paramDOC_NUM in IMPL -------> " + doc_num );
    CallableStatement st = null;
    OADBTransaction txn = (OADBTransaction)getDBTransaction();
    Connection conn = txn.getJdbcConnection();
    String sql = " BEGIN :1 := test_proc.get_log(:2, :3, :43, :5 ); END; ";
    CallableStatement cs = txn.createCallableStatement(sql,1);
    String ErrorExist = "";
    String getHTML = "";
    try
    cs.setString(2, rmode);
    cs.setString(3, doc_type);
    cs.setString(4, doc_id);
    cs.setString(5, doc_num);
    cs.registerOutParameter(1,Types.VARCHAR);
    cs.execute();
    getHTML = cs.getString(1 ) ;

  • JNI_CreateJavaVM fails in Multithreaded app.

    Hello,
    when i call JNI_CreateJavaVM in a multithreaded application, I ll get the error:
    "ERROR: Could not find the pthread library (2). Are you running a supported Linux
    distribution?"
    So, given the following program, everyhing works okay:
    ----code---
    #include "jni.h"
    #include <stdio.h>
    #include <stdlib.h>
    #include <pthread.h>
    void jnicall()
    JNIEnv *env;
    JavaVM *jvm;
    jint res;
    jclass cls;
    jmethodID mid;
    jstring jstr;
    jclass stringClass;
    jobjectArray args;
    JavaVMInitArgs vm_args;
    JavaVMOption options[1];
    options[0].optionString = "-Djava.class.path=.";
    vm_args.version = 0x00010002;
    vm_args.options = options;
    vm_args.nOptions = 1;
    vm_args.ignoreUnrecognized = JNI_TRUE;
    res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
    if (res < 0) {
    fprintf(stderr, "Can't create Java VM\n");
    exit(1);
    cls = env->FindClass("Hello");
    if (cls == NULL) {
    goto destroy;
    mid = env->GetStaticMethodID(cls, "main", "([Ljava/lang/String;)V");
    if (mid == NULL) {
    goto destroy;
    jstr = env->NewStringUTF(" from C!");
    if (jstr == NULL) {
    goto destroy;
    stringClass = env->FindClass("java/lang/String");
    args = env->NewObjectArray(1, stringClass, jstr);
    if (args == NULL) {
    goto destroy;
    env->CallStaticVoidMethod(cls, mid, args);
    destroy:
    if (env->ExceptionOccurred()) {
    env->ExceptionDescribe();
    jvm->DestroyJavaVM();
    int main()
    jnicall();
    ---code---
    But when I replace main with something like
    ---code---
    int main()
    pthread_t thread;
    if (0 != pthread_create(&thread, NULL, (void*(*)(void*))jnicall, NULL))
    fprintf(stderr, "Cannot create thread");
    exit(1);
    ---code---
    Really strange is that is does not matter, how i use pthread functions: even if
    i call the jnicall function directly from main but start a different thread using
    pthread_create, i get this method too:
    ---code---
    int main()
    pthread_t thread;
    jnicall();
    if (0 != pthread_create(&thread, NULL, (void*(*)(void*))some_other_thread_without_jni,
    NULL))
    fprintf(stderr, "Cannot create thread");
    exit(1);
    ---code---
    My system is a Suse Linux Enterprise Server 8.0 (wth United Linux 1.0) (kernel
    2.4.19, glibc is 2.2.5); the Jrockit stuff is JRockit 8.1 SP 2
    Any ideas?
    TIA,
    Johannes

    Try checking that the environment variable LD_ASSUME_KERNEL=2.2.5 is not
    set.
    From the release notes at:
    http://edocs.bea.com/wljrockit/docs81/relnotes/relnotes.html#1041981
    Best Regards,
    Josefin Hallberg
    BEA WebLogic JRockit
    Customer Centric Engineering
    "Johannes Hampel" <[email protected]> wrote in message
    news:[email protected]...
    >
    Hello,
    when i call JNI_CreateJavaVM in a multithreaded application, I ll getthe error:
    "ERROR: Could not find the pthread library (2). Are you running asupported Linux
    distribution?"
    So, given the following program, everyhing works okay:
    ----code---
    #include "jni.h"
    #include <stdio.h>
    #include <stdlib.h>
    #include <pthread.h>
    void jnicall()
    JNIEnv *env;
    JavaVM *jvm;
    jint res;
    jclass cls;
    jmethodID mid;
    jstring jstr;
    jclass stringClass;
    jobjectArray args;
    JavaVMInitArgs vm_args;
    JavaVMOption options[1];
    options[0].optionString = "-Djava.class.path=.";
    vm_args.version = 0x00010002;
    vm_args.options = options;
    vm_args.nOptions = 1;
    vm_args.ignoreUnrecognized = JNI_TRUE;
    res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
    if (res < 0) {
    fprintf(stderr, "Can't create Java VM\n");
    exit(1);
    cls = env->FindClass("Hello");
    if (cls == NULL) {
    goto destroy;
    mid = env->GetStaticMethodID(cls, "main", "([Ljava/lang/String;)V");
    if (mid == NULL) {
    goto destroy;
    jstr = env->NewStringUTF(" from C!");
    if (jstr == NULL) {
    goto destroy;
    stringClass = env->FindClass("java/lang/String");
    args = env->NewObjectArray(1, stringClass, jstr);
    if (args == NULL) {
    goto destroy;
    env->CallStaticVoidMethod(cls, mid, args);
    destroy:
    if (env->ExceptionOccurred()) {
    env->ExceptionDescribe();
    jvm->DestroyJavaVM();
    int main()
    jnicall();
    ---code---
    But when I replace main with something like
    ---code---
    int main()
    pthread_t thread;
    if (0 != pthread_create(&thread, NULL, (void*(*)(void*))jnicall,NULL))
    fprintf(stderr, "Cannot create thread");
    exit(1);
    ---code---
    Really strange is that is does not matter, how i use pthread functions:even if
    i call the jnicall function directly from main but start a differentthread using
    pthread_create, i get this method too:
    ---code---
    int main()
    pthread_t thread;
    jnicall();
    if (0 != pthread_create(&thread, NULL,(void*(*)(void*))some_other_thread_without_jni,
    NULL))
    fprintf(stderr, "Cannot create thread");
    exit(1);
    ---code---
    My system is a Suse Linux Enterprise Server 8.0 (wth United Linux 1.0)(kernel
    2.4.19, glibc is 2.2.5); the Jrockit stuff is JRockit 8.1 SP 2
    Any ideas?
    TIA,
    Johannes

  • Array data sporadically lost when calling stored procedure

    We have weird problem with stored procedures for which I have not been able to find an explanation so far.
    Our app has a bunch of stored procedures which process arrays of integers or strings.
    From time to time (maybe 1 in a 1000) array data gets lost when calling stored procedures. From the logs we know that the data gets sent to the stored procedure, but on the DB side the procedure throws an exception because arrays are empty.
    We are using (modified) OracleConnectionCacheImp (thus PooledConnections, etc.). My latest guess is that maybe somehow ArrayDescriptors on the (pooled)connection used to call the stored procedure are somehow affected when another pooled connection from OracleConnectionCacheImp gets removed by parallel thread. Is that possible? Or are the PooledConnections internally (in pooled connection data source) completely isolated from each other ?

    We have weird problem with stored procedures for which I have not been able to find an explanation so far.
    Our app has a bunch of stored procedures which process arrays of integers or strings.
    From time to time (maybe 1 in a 1000) array data gets lost when calling stored procedures. From the logs we know that the data gets sent to the stored procedure, but on the DB side the procedure throws an exception because arrays are empty.
    We are using (modified) OracleConnectionCacheImp (thus PooledConnections, etc.). My latest guess is that maybe somehow ArrayDescriptors on the (pooled)connection used to call the stored procedure are somehow affected when another pooled connection from OracleConnectionCacheImp gets removed by parallel thread. Is that possible? Or are the PooledConnections internally (in pooled connection data source) completely isolated from each other ?

  • Problem when calling session bean from main.

    Hi everyone
    I get the following error when calling a session bean from main(String args[]).
    Sep 3, 2008 9:11:13 AM com.sun.enterprise.appclient.MainWithModuleSupport <init>
    WARNING: ACC003: Application threw an exception.
    java.lang.NullPointerException
    at databasetest.Main.main(Main.java:26)
    Here is my code beneath.
    I'm using netbeans and glassfish application server.
    Everything is in the same project, called DatabaseTest, I also have deployed the application before running the client.
    I'm running the client as follows, right click on the DatabaseTest-app-client and select run.
    The client:
    package databasetest;
    import com.test.UsersFacadeRemote;
    import javax.ejb.EJB;
    import com.test.Users;
    public class Main {
        @EJB
        private static UsersFacadeRemote usersFacade;
        public static void main(String[] args) {
            Users users = new Users(12, 34);
            usersFacade.create(users);
    }The remote facade I'm calling:
    package com.test;
    import java.util.List;
    import javax.ejb.Remote;
    @Remote
    public interface UsersFacadeRemote {
        void create(Users users);
        void edit(Users users);
        void remove(Users users);
        Users find(Object id);
        List<Users> findAll();
    }The stateless bean:
    package com.test;
    import java.util.List;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    @Stateless
    public class UsersFacade implements UsersFacadeRemote {
        @PersistenceContext
        private EntityManager em;
        public void create(Users users) {
            em.persist(users);
        public void edit(Users users) {
            em.merge(users);
        public void remove(Users users) {
            em.remove(em.merge(users));
        public Users find(Object id) {
            return em.find(com.test.Users.class, id);
        public List<Users> findAll() {
            return em.createQuery("select object(o) from Users as o").getResultList();
    }

    looks like you're banging your head against the same brick wall as [I have done|http://forums.sun.com/thread.jspa?forumID=13&threadID=5317110] and [others have in the past|http://forums.sun.com/thread.jspa?forumID=136&threadID=5259913] if that's any consolation.
    Funny thing is, mine did actually work in the debugger but not when running!
    Strange thing that.
    I did initially interest someone from the developers but they couldn't really help, ended up saying : try instantiating your beans the EJB 2.1 way and see where that gets you. Yes that works but they promised us "hey no more dopey xml deployment descriptors just some cool annotations" didn't they?
    I've got the feeling were' missing something really obvious!
    Edited by: sebthebike on 03-Sep-2008 12:21

  • LogOnException thrown when calling ExportToStream

    Hi there, <br>
    <br>
    I am having real problems when calling the ExportToStream method on the ReportDocument class.<br>
    <br>
    I am trying to load a CrystalReport that is held in a Database field, apply parameters to that report (the values for the parameters) are also held in another database table, and then export the report (complete with the parameterised values) back to another record in the DB.<br>
    <br>
    All goes swimmingly until I try to call ExportToStream to finally place the report (with params) back in DB. When I get to this call I get a LogOnException thrown (Message: "Logon failed.
    Details: 08004:[Sybase][ODBC Driver][SQL Anywhere]Parse error: Invalid or missing keyword near 'DATABASE'
    Error in File C:\DOCUME1\BARRY1.ROB\LOCALS~1\Temp\tmp16C {8CF0E4A7-E74C-41DC-BF7E-5871D40432E9}.rpt:
    Unable to connect: incorrect log on parameters.").<br>
    <br>
    The code causing the excpetion is the call to ExportToStream below:<br>
    public void ProcessQueuedReports(string connectionString, ProcessQueueMode processMode, string providerName)<br>
    { <br>
    <br>
        List<ReportQueueDetails> queuedReportList = ReportQueueDetails.GetAllQueuedByPriority(connectionString);<br>
    <br>
          if (queuedReportList.Count > 0)<br>
        {<br>
                int numberToProcess = ReturnNumberToProcess(processMode,
          queuedReportList.Count);<br>
              for (int count = 0; count < numberToProcess; count++)<br>
              {<br>
                    SetQueueItemAsProcessing(queuedReportList[count]);<br>
                    if (reportReader.LoadReport(connectionString,
            queuedReportList[count].ReportDetailsRef,
            queuedReportList[count].ReportQueueDetailsRef, providerName))<br>
                    {<br>
                          ExportFormatType outputFormat =
            ReturnExportFormatType(queuedReportList[count].ReportFormatTypeCode);<br>
                    Stream reportStream = new MemoryStream();<br>
                         reportReader.Report.ReportOptions.EnableSaveDataWithReport = false;<br>
                          reportStream = reportReader.Report.ExportToStream(outputFormat);<br>
                          byte[] reportData = new byte[(int)                reportStream.Length];<br>
                          int numBytesToRead = (int)reportStream.Length;<br>
                          int numBytesRead = 0;<br>
                          reportStream.Position = 0;<br>
                          while (numBytesToRead > 0)<br>
                          {<br>
                                int n = reportStream.Read(reportData, numBytesRead, numBytesToRead);<br>
                                if (n == 0)<br>
                                      break;<br>
                                numBytesRead += n;<br>
                                numBytesToRead -= n;<br>
                           }<br>
                          queuedReportList[count].ReportOutput = reportData;<br>
                          queuedReportList[count].Update(IyssDateTime.CurrentDatabaseDateTime);<br>
                          SetQueueItemAsSuccess(queuedReportList[count]);<br>
                    }<br>
                   else<br>
                   {<br>
                          SetQueueItemAsFailed(queuedReportList[count]);<br>
                   }<br>
              }<br>
         }<br>
    }<br>
    <br>
    This is the LoadReport method called above:<br>
    <br>
    public bool LoadReport(string connectionString, int reportDetailsRef, int reportQueueRef, string providerName)<br>
    {<br>
          bool LoadSuccess = false;<br>
          ReportDetails report = IyssReportDetails.GetByRef(reportDetailsRef,
        connectionString);<br>
          byte[] reportData = (byte[])report.ReportData;<br>
          int size = reportData.GetUpperBound(0);<br>
          string tempFilename = Path.GetTempFileName();<br>
          if (tempFilename != "")<br>
          {<br>
                FileStream fs = new FileStream(tempFilename, FileMode.OpenOrCreate,
          FileAccess.Write);<br>
                fs.Write(reportData, 0, size);<br>
                fs.Close();<br>
                try<br>
                {<br>
                      LoadSuccess = LoadReport(tempFilename, connectionString, providerName);<br>
                      ProcessReportParameters(connectionString, reportQueueRef);<br>
                }<br>
                finally<br>
                {<br>
                      //File.Delete(tempFilename);<br>
                }<br>
          }<br>
          return LoadSuccess;<br>
    }<br>
    <br>
    The LoadReport method referenced in the above method is as follows:<br>
    <br>
    public bool LoadReport(string fileName, string connectionString, string providerName)<br>
    {<br>
          bool LoadSuccess = false;<br>
          _report = new ReportDocument();<br>
          _report.Load(fileName);<br>
          LoadSuccess = _report.IsLoaded;<br>
          if (LoadSuccess)<br>
          {<br>
                if (_report.ParameterFields.Count > 0)<br>
                      ProcessReportParametersBasedOnReportInfo();<br>
                SetReportDataConnection(_report, connectionString, providerName);<br>
          }<br>
          return LoadSuccess;<br>
    }<br>
    <br>
    And, what I guess is the crucial code, here is the SetReportDataConnection code:<br>
    <br>
    public void SetReportDataConnection(ReportDocument report, string connectionString, string providerName)<br>
    {<br>
          string Locn;<br>
          if ((report != null) && (report.DataSourceConnections.Count > 0))<br>
          {<br>
                for (int count = 0; count < report.DataSourceConnections.Count; count++)<br>
                {<br>
                      string dsnName = GetDSNName(connectionString, providerName);<br>
                      ConnectionInfo connectionInfo = RetrieveConnectionInfoFromRegistry(dsnName);<br>
                      Tables tables = report.Database.Tables;<br>
                      foreach(Table table in tables)<br>
                      {<br>
                            TableLogOnInfo tableLogonInfo = null;<br>
                            tableLogonInfo = table.LogOnInfo;<br>
                            tableLogonInfo.ConnectionInfo.ServerName = connectionInfo.ServerName;<br>
                              tableLogonInfo.ConnectionInfo.DatabaseName = "";<br>
                            tableLogonInfo.ConnectionInfo.UserID = connectionInfo.UserID;<br>
                            tableLogonInfo.ConnectionInfo.Password = connectionInfo.Password;<br>
                            table.ApplyLogOnInfo(tableLogonInfo);<br>
                            if (connectionInfo.UserID.ToUpper().CompareTo("DBA".ToUpper()) != 0)<br>
                            {<br>
                                  Locn = table.Location;<br>
                                  if (!Locn.StartsWith("Proc(", StringComparison.OrdinalIgnoreCase))<br>
                                  {<br>
                                        if ((!Locn.StartsWith("DBA", StringComparison.OrdinalIgnoreCase))
                 && (!Locn.StartsWith("SYS", StringComparison.OrdinalIgnoreCase)))<br>
                                              table.Location = "DBA." + Locn;<br>
                                      }<br>
                                }<br>
                          }<br>
                          report.DataSourceConnections[count].SetConnection
           (connectionInfo.ServerName, "", connectionInfo.UserID,
            connectionInfo.Password);<br>
                     }<br>
               }<br>
               if (!report.IsSubreport)<br>
               {<br>
                    if (report.Subreports.Count > 0)<br>
                    {<br>
                         for (int count = 0; count < report.Subreports.Count; count++)<br>
                         {<br>
                               SetReportDataConnection(report.Subreports[count], connectionString,
             providerName);<br>
                         }<br>
                    }<br>
               }<br>
          }<br>
    If anyone has any idea why the ExportToStream call in the first causes the Exception, or can point me in the direction of where I am going wrong in setting the report's data connection, I'd really appreciate it.<br>
    <br>
    Thanks In Advance<br>
    <br>
    <br>p.s. - tried to format this as best I could, apologies if it is not all that clear
    <br>
    <br> Development language is C# Using Visual Studio .NET 2008
    <br> Reports written in version 11 of Crystal Report.
    Edited by: silentbazz on Jun 3, 2009 6:07 PM

    You mention:
    "Development language is C# Using Visual Studio .NET 2008
    Reports written in version 11 of Crystal Report."
    But what version is the CR runtime used in your .NET 2008 app? (e.g.; what is the version of the CR assemblies referenced in your app - say crystalDecisions.Crystalreports.engine.dll?)
    Next, assuming you are using a version of CR supported with .NET 2008, I suppose the 1st question to ask is; is it export to stream, or is it incorrect db logon parameters that is causing the issue.
    I'd recommend starting with the basics:
    Simple app; viewer, load the report, let it do all the prompting. Does that work?
    If yes, add the logon code to the above app, let it prompt for any parameter it needs. Does that work?
    If yes, add the parameter code, does that work?
    If all of the above works, try to export the report from the above app using the viewer export button. Does that work?
    If that works, we're finally at the stage where we can point our finger at export to stream(?).
    Ludek

  • CallerPrincipal when calling one sessionbean from another

    Hi all,
    I have a little problem when calling one sessionbean from another sessionbean. The problem is, that in the method, which is called, is used SessionContext's getCallerPrincipal().getName(). This works great from client, but from other sessionbeans getCallerPrincipal() retuns an "ANONYMOUS" principal. How can I set the correct principal (the principal from the first sessionbean)?
    Thank you
    My env: Glassfish 2.1.1, Netbeans 6.8, Eclipselink 2.0.0, Java 1.6.0.18
    My code:
    @Stateless
    public class ABean implements ASessionRemote{
    @Resource
    SessionContext ctx;
    @Override
    public void aMethod(){
    String name = ctx.getCallerPrincipal().getName(); // the name is ANONYMOUS, when the call is done from other sessionbean
    @Stateless
    public class BBean implements BSessionRemote{
    @Resource
    SessionContext ctx;
    @EJB
    private ASessionRemote aSessionBean;
    @Override
    public void bMethod(){
    aSessionBean.aMethod();
    }

    "This works great from client"
    What do you mean by this, i.e what sort of client are you using (stand alone app, servlet) ?
    what shows up if you printout the caller principal in the calling bean ?
    are the two ejbs in the same ear ?
    what security meta-information are you using in ejb-jar.xml and sun-ejb-jar.xml, if any ?

  • Application breaks when called as Component

    So, I have this UI5 Application which works perfectly fine when called thru index.html, however it breaks (resources not found, failed to load,404 error etc) when I try to call it as Component. Both the applications (Caller & Callee) are on Gateway
    Here is the application folder structure.
    all the views are under zui5_trip_confirmation -> views folder..The images and models are in the respective folders.
    The component.js is under the folder Component and is defined as
    // define a new UIComponent
    jQuery.sap.declare("components.Component");
    jQuery.sap.require("sap.ui.core.UIComponent");
    jQuery.sap.require("sap.ui.commons.Button");
    jQuery.sap.require("sap.ui.table.Table");
    //new Component
    sap.ui.core.UIComponent.extend("components.Component", {
        metadata : {
            properties : {
                text: "string"
    components.Component.prototype.createContent = function(){
    /* trying to register the path zui5_trip_confirmation where all the views are stored */
    sap.ui.localResources("zui5_trip_confirmation");
    // jQuery.sap.registerModulePath('zui5_trip_confirmation','/sap/bc/ui5_ui5/sap/zui5_trip_conf/zui5_trip_confirmation');
        this.oView = sap.ui.jsview("idHome", "zui5_trip_confirmation.views.Home");
         return this.oView;
    The caller application calls it as
    jQuery.sap.registerModulePath('components','/sap/bc/ui5_ui5/sap/zui5_trip_conf/components');
    var oComp1 = sap.ui.getCore().createComponent({
            name: "components",
            id: "Comp1",
            settings: {text: "Hello World"}
        var oCompCont1 = new sap.ui.core.ComponentContainer("CompCont1", {
            component: oComp1
        oCompCont1.placeAt("content");
    When I run the caller application, I get resource not found errors on the console. Basically the Component is not able to resolve the path to the views/models/images.
    What could be wrong here?
    Regards
    Sandip

    Hi Sandip,
    I had the same issue when I tried to create the Component based applications. From the index file I had the call to the component but was not able to call any of the Views from the Component.js directly even though I register the module path and define local resources for the view and controllers.
    Eventually, I solved the issue by having an app.js file which is called from the index and then the app.js would call the Component.js similar to the approach followed in the UI5 Boilerplate applications written by HP Seitz
    UI5 Boilerplate explained (Part 1)
    I would like to see / confirm if this is an issue in the framework when application are built out of eclipse.
    BR,
    Nagarajan.

  • String.replaceAll bottleneck

    Hi All,
    I have written a method to make a string "safe" for xml, by encoding characters that need to be replaced.
    It works just fine using String.replaceAll as below, but when i profile the app i see that it is a performance bottleneck.
    I can see that it is creating a lot of Strings so this is part of the problem.
    From reading through the forum I can see regexs used frequently for this type of problem, but it seems that they will not be more efficient than my existing approach.
    I see that StringBuffer has a replace method but i'm not sure that it is a good fit for my problem?
    Can anybody suggest a more efficient solution?
    Your help is much appreciated!
    emhart
    Here's my existing method:
    public static String makeSafeForXML(String str)
    String result = str;
    result = result.replaceAll("&", "&");
    result = result .replaceAll(">", ">");
    result = result .replaceAll("<", "<");
    result = result .replaceAll("'", "&apos;");
    result = result .replaceAll("\"", """);
    return result ;
    }

    That method doesn't make any sense to me:
    replacing strings with the same exact string?
    also the last one isn't correct, maybe missing a \ ?
    Also, you do realize that the replaceAll method uses the first argument as a regex to match patterns in the string?
    My apologies if I'm missing something.
    But if this really is what you want, then maybe this is faster (I haven't measured any times though):public static String makeSafeForXML2(String str)
        StringBuilder sb = new StringBuilder(str);
        for (int i = 0; i < sb.length(); i++) {
            switch (sb.charAt(i)) {
                case '&':
                    sb.replace(i, i + 1, "&");
                    break;
                case '>':
                    sb.replace(i, i + 1, ">");
                    break;
                case '<':
                    sb.replace(i, i + 1, "<");
                    break;
                case '\'':
                    sb.replace(i, i + 1, "'");
                    break;
                case '"':
                    sb.replace(i, i + 1, "\"");
                    break;
        return sb.toString();
    }

  • ORA-03115 error when calling a Stored Procedure

    Hi All,
    I'm in the process of porting a Pro/C app from NT to Linux. I've installed 8.1.5 on our Linux box and patched it up to 8.1.5.02.
    It all kind of works ok, except that I'm sometimes getting ORA-03115 errors when the app calls a stored procedure. The call in question looks like this:
    EXEC SQL BEGIN DECLARE SECTION;
    VARCHAR resprows[50][3998];
    int numret = 0;
    int numrows= 50;
    int done= 0;
    unsigned long resp_id = 0;
    EXEC SQL END DECLARE SECTION;
    EXEC SQL AT DB_NAME EXECUTE
    BEGIN pkg_something.getdata(
    :resp_id, /* IN */
    :numrows, /* IN */
    :done, /* OUT */
    :resprows, /* OUT */
    :numret /* OUT */
    END;
    END-EXEC;
    The stored procedure basically uses the resp_id value to select rows from a table;
    in each row there is a VARCHAR2(4000) column which it copies into the hostarray resprows.
    There may be anything from 1 to numrows returned from the SP.
    Initially, the resprows rows were defined to be size [4000]. Unfortunately, this caused ORA-02005 errors - I then changed the size to [3998], which seemed to fix the 02005's (although I'm unclear as to the reasons why).
    Now I'm getting the 03115 errors when calling the SP. The oracle manual is not very helpful on what this error means.
    This all works chipper on NT.
    Any ideas?
    Thanks in advance,
    Nigel.
    PS: The database the app is talking to is still hosted on NT.
    null

    Histon FTM wrote:
    ORA-04063: package body "LAZARUS.LAZARUS" has errors Above, obviously conflicts with the statement that follows:
    >
    The procedure and package have both compiled without errors and the statement on its own works fine in SQL*Plus.I suggest you take a look in the USER_ERRORS view to see, what the errors are.
    And just checking:
    You have schema called LAZARUS, which holds a package named LAZARUS, which holds a procedure called POPULATEGRIDPOSITIONS?
    Edited by: Toon Koppelaars on Oct 1, 2009 5:55 PM

  • ERROR: -Type conflict when calling a function module

    hi to all,
    when iam executing the program in browser   Type conflict when calling a function module  error is showing, i have bind all the attribute correctly still iam getting error, WHEN I  CLICK ON THE SEARCH BUTTON DATA IS NOT COMING  TO MY TABLE ITAB1 plz help me....
      DATA:
          NODE_IP_SELECTION                   TYPE REF TO IF_WD_CONTEXT_NODE,
          ELEM_IP_SELECTION                   TYPE REF TO IF_WD_CONTEXT_ELEMENT,
          STRU_IP_SELECTION                   TYPE IF_PLANNING_HISTORY=>ELEMENT_IP_SELECTION ,
          ITAB TYPE TABLE OF ZSL_PL_UPDATE1,
          WA TYPE ZSL_PL_UPDATE1.
      navigate from <CONTEXT> to <IP_SELECTION> via lead selection
        NODE_IP_SELECTION = WD_CONTEXT->GET_CHILD_NODE( NAME = `IP_SELECTION` ).
      get element via lead selection
        ELEM_IP_SELECTION = NODE_IP_SELECTION->GET_ELEMENT(  ).
      get all declared attributes
        ELEM_IP_SELECTION->GET_STATIC_ATTRIBUTES(
          IMPORTING
            STATIC_ATTRIBUTES = STRU_IP_SELECTION ).
    CALL FUNCTION 'ZBAPI_PL_UPDATE'
            EXPORTING
              GV_LIFNR           =  STRU_IP_SELECTION-LIFNR
              GV_MATNR           = STRU_IP_SELECTION-LIFNR
              GV_GJAHR           = ' '
            GV_WEEK_LOW        =   STRU_IP_SELECTION-FROM_WEEK
             GV_WEEK_HIGH       =  STRU_IP_SELECTION-TO_WEEK
          IMPORTING
            RETURN             =
            TABLES
              GT_PL_UPDATE       = ITAB
             DATA:
               NODE_PLANN_NODE                     TYPE REF TO IF_WD_CONTEXT_NODE,
               ELEM_PLANN_NODE                     TYPE REF TO IF_WD_CONTEXT_ELEMENT,
               STRU_PLANN_NODE                     TYPE IF_PLANNING_HISTORY=>ELEMENT_PLANN_NODE,
               WA1 TYPE IF_PLANNING_HISTORY=>ELEMENT_PLANN_NODE,
               ITAB1 TYPE TABLE OF IF_PLANNING_HISTORY=>ELEMENT_PLANN_NODE.
              LOOP AT ITAB INTO WA.
               MOVE-CORRESPONDING WA TO WA1.
               APPEND WA1 TO ITAB1.
              ENDLOOP.
           navigate from <CONTEXT> to <PLANN_NODE> via lead selection
             NODE_PLANN_NODE = WD_CONTEXT->GET_CHILD_NODE( NAME = `PLANN_NODE` ).
             CALL METHOD NODE_PLANN_NODE->BIND_TABLE
               EXPORTING
                 NEW_ITEMS            = ITAB1
                SET_INITIAL_ELEMENTS = ABAP_TRUE
                INDEX                =
    ENDMETHOD.

    CALL FUNCTION 'ZBAPI_PL_UPDATE'
    EXPORTING
    GV_LIFNR = STRU_IP_SELECTION-LIFNR
    GV_MATNR = STRU_IP_SELECTION-LIFNR
    GV_GJAHR = ' '
    GV_WEEK_LOW = STRU_IP_SELECTION-FROM_WEEK
    GV_WEEK_HIGH = STRU_IP_SELECTION-TO_WEEK
    IMPORTING
    RETURN =
    TABLES
    GT_PL_UPDATE = ITAB
    Problem is here
    check out the type GV_GJAHR whether it accepts string type.
    thanks
    sarbjeet singh

Maybe you are looking for

  • HT2265 sync photos to apple tv

    im trying to Sync photos via iTunes to my apple tv (1st generation), but i dont have the option  "Sync photos from: ...", the only thing that appears is "share photos...." please help!!

  • HP 7227sa SSD Compatibility

    So I've decided to get a SSD for my HP DV6 7227sa.Although I'm not sure which one would be compatible... I heard something about having to have AHCI, and SATA III for using SSD's. I'd like to make use of the whole SSD's features (as I know some peopl

  • LCD for G4 AGP

    What's a good LCD monitor to use with the stock ATI Rage 128 Pro video card in a G4 AGP? I would like at least 20" to replace a dead Apple 21" studio crt. It has DVI-D? and vga ports on the card. Would like to keep the cost around $300 ea since I hav

  • Transaction Attibutes in EJB

    How can we set the Isolation levels for Transaction in Session Beans. and as well as Entity Beans i.e. CMP

  • Have just upgraded (?) to Lion in order to save photos on the iCloud but iPhoto cannot find my 25,000  pictures! Are they lost forever?

    Have just installed Lion OS in order to save my many thousands of photos on to the icloud BUT they seem to have nearly ALL disappeared! PLEASE tell me that they're still there somewhere! iPhoto simply asks for a library and lists none as existing. Pi