Acess Violation on IHTMLDocument2::write() in a thread

Hello,
I have a working code, but it crashes with "Access Violation"  on IHTMLDocument2::write() asa I put it in a thread.
(tested on Windows 7 SP1)
What could be the reason ?
Thanks.
Test sample  (just set a text in a HTML window created with ATL) with a simple win32 app =>
#include <windows.h>
#include <tchar.h>
#include <exdisp.h> // IWebBrowser2
#include <Mshtml.h> // IHTMLDocument2
#include <process.h> /* _beginthread, _endthread */
HINSTANCE hATLDLL;
typedef BOOL(__stdcall *PAAWI)(void);
PAAWI pAtlAxWinInit;
typedef HRESULT(__stdcall *PAAGC) (HWND hWnd, IUnknown** pUnknown);
PAAGC pAtlAxGetControl;
static HWND hHTMLWindow;
HANDLE g_hThread = NULL;
HANDLE g_hEvent = NULL;
static UINT WINAPI ChildThreadProc(LPDWORD lpData);
BOOL g_bContinue = 1;
// At the beginning of program :
hATLDLL = LoadLibrary(_T("atl.dll"));
pAtlAxWinInit = (PAAWI)GetProcAddress(hATLDLL, "AtlAxWinInit");
if (pAtlAxWinInit)
pAtlAxWinInit();
pAtlAxGetControl = (PAAGC)GetProcAddress(hATLDLL, "AtlAxGetControl");
// in WM_CREATE of main window :
case WM_CREATE:
hHTMLWindow = CreateWindow(_T("AtlAxWin"), _T("about:blank"), WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_HSCROLL,
100, 100, 500, 300, hWnd, (HMENU)100, hInst, 0);
g_hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
if (g_hEvent)
g_bContinue = TRUE;
SetEvent(g_hEvent);
UINT idItemInfo;
g_hThread = (HANDLE)_beginthreadex(NULL, 0, (unsigned int (WINAPI *)(void *))ChildThreadProc, (HANDLE)NULL, 0, &idItemInfo);
break;
// Thread
static UINT WINAPI ChildThreadProc(LPDWORD lpdwData)
DWORD dwWait;
while (g_bContinue)
dwWait = WaitForSingleObject(g_hEvent, 1000);
if (dwWait == WAIT_OBJECT_0 || dwWait == WAIT_TIMEOUT)
if (!g_bContinue)
break;
// Block of code working if not in a thread
IUnknown* pUnknown;
IWebBrowser2 *pWebBrowser;
WCHAR wsHTMLText[255] = L"Test";
HRESULT hr;
//HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
CoInitialize(NULL);
//if (SUCCEEDED(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE)))
hr = pAtlAxGetControl(hHTMLWindow, &pUnknown);
if (SUCCEEDED(hr))
hr = pUnknown->QueryInterface(__uuidof(IWebBrowser2), (void**)&pWebBrowser);
if (SUCCEEDED(hr))
IDispatch* pDispatch = NULL;
IHTMLDocument2* pDocument = NULL;
hr = pWebBrowser->get_Document(&pDispatch);
// S_FALSE
if (SUCCEEDED(hr) && pDispatch != NULL)
hr = pDispatch->QueryInterface(IID_IHTMLDocument2, (void**)&pDocument);
if (SUCCEEDED(hr))
VARIANT *param;
SAFEARRAY *sfArray = NULL;
BSTR bstr = SysAllocString(wsHTMLText);
sfArray = SafeArrayCreateVector(VT_VARIANT, 0, 1);
if (sfArray)
SafeArrayAccessData(sfArray, (LPVOID*)&param);
param->vt = VT_BSTR;
param->bstrVal = bstr;
SafeArrayUnaccessData(sfArray);
HWND hWndFocus = GetFocus();
// Crashes here, only if the block of code is in a thread !
pDocument->write(sfArray);
pDocument->close();
SetFocus(hWndFocus);
SafeArrayDestroy(sfArray);
pDocument->Release();
//if (bstr)
// SysFreeString(bstr);
pDispatch->Release();
pWebBrowser->Release();
pUnknown->Release();
CoUninitialize();
g_bContinue = FALSE;
//ResetEvent(g_hEvent);
CloseHandle(g_hEvent);
return 0;

On 4/3/2015 3:14 PM, Jeff666 wrote:
I have a working code, but it crashes with "Access Violation"  on IHTMLDocument2::write() asa I put it in a thread.
What could be the reason ?
You are effectively passing a COM pointer between threads, with no marshaling. Don't do that. It's in violation of COM threading model rules.
WebBrowser and MSHTML are single-threaded. It's pointless to try to use them from a worker thread, even if you do marshal the pointer and it doesn't crash. Every call would be marshaled to the main thread, executed there, and results marshaled back.
Your worker thread won't actually be doing any work, it'll just spend most of its time waiting for the cross-apartment calls to complete.
Igor Tandetnik

Similar Messages

  • I sent a matrix,its row and column to a child window. However "Acess violation" & 'Memory cannot be reference" error occurs when I try to plot the data in the child dialogue. Why?

    My OS is Win200 professional.
    I'm running a data acquisition program. I'd got this main dialog which the user selects the input channel.
    The child dialog should show the graph.
    I'd initialise all the NI_DAQ configuration in the main dialog class. After acquiring the data, I send the matrix to the child window for it to plot. There is no compilation error.
    However when I try to plot the data, Windows complained about Acess violation and Memory cannot be accessed error.
    I'd attached my program below.
    Attachments:
    DataAcqDlg.cpp ‏10 KB
    Ch1Dlg.cpp ‏7 KB

    Wynn:
    I believe this problem is occurring because you are using the index operator (brackets "[","]") instead of the functional call operator (parentheses "(",")") in your code to access the matrix.
    SigCh1Vect[i] = SigCh1Max[1,i];
    The index operator is not defined for the matrix, because the C++ language does not allow a two-argument overload of this operator. Instead you have to use the function call operator for matrices and remember to use the index operator for vectors.
    I believe that what is happening is that the compiler is using one of the defined cast operators on the matrix (operator DataType) to convert the symbol "SigCh1Max" into a double pointer. It then interprets the bracket as it would any array index operation. So the compile
    r effectively sees:
    SigCh1Vect[i] = *(((Real64*)SigCh1Max) + (1,i));
    In this case, I believe the comma operator is defined to return the rightmost operand, or "i". Changing your code to
    SigCh1Vect[i] = SigCh1Max(1,i);
    should fix the problem. Please let me know if any issues exist after this fix.
    In the next release of Measurement Studio, I will recommend that the index operator be defined on the matrix classes, even if it simply throws an exception. The existence of this operator will prevent problems like this from showing up.
    Hope this helps,
    -- Chris W.
    Measurement Studio R&D
    National Instruments

  • How to post a comment on facebook on ipad - i couldnt find any "ok" or "send" button after i write something after threads of comment on my wall

    i couldnt find any "ok" or"send" button after i write something after threads of comments on my wall

    Like others say, it is a bug with the Facebook app.  They do not manage the bluetooth keyboard right and if there is on on-screen keyboard, they remove the "send" button.  The solution that works for me is the following:
      1. Write my comment with the bluetooth keyboard until I am ready to send.
      2. Push the "Eject' button to turn off the bluetooth keyboard.
      3. Wait a second for the Send button to appear
      4. Press Send to post the comment
      5. Press "Eject" to turn bluetooth keyboard back on.
    This has worked for me just fine and although it is slightly frustrating, it is not impossible to remember.  After all, with the Bluetooth keyboard turned on, there is no "Send" button.

  • Elementsautoanalyzer.exe crash, unhandled exception at 0x004099BA in photoshop server.exe 0xc000005: acess violation writing location 0x000000

    Elementsautoanalyzer.exe crash, unhandled exception at 0x004099BA in photoshop server.exe 0xc000005: acess violation writing location 0x000000
    This the output of visual studio debugger when it crashes.  It crashes on startup and also when the organizer is running

    The call stack is below. I know that's not likely of much interest to the "users" reading this, but if there's a Safari engineer who happens by, maybe it means something to them.
    Good catch, Bubba!
    If you've got the time, could you put through a bug report to Apple for that one?
    If you want to track the bug, the best way to do that is to register (free) as an Apple Developer:
    [Register as an Apple Developer|https://swdlp.apple.com/cgi-bin/WebObjects/SoftwareDownloadApp.woa/18 32/wo/ghc5q6Ft5BfSvqaLsj00wg/2.5]
    ... and then you can use the Apple Bug Reporter to submit the bug:
    [Apple Bug Reporter|https://swdlp.apple.com/cgi-bin/WebObjects/SoftwareDownloadApp.woa/183 2/wo/ghc5q6Ft5BfSvqaLsj00wg/2.5]

  • How to write a multi threaded Cache Event Listener

    I have a distributed data cache called tokenCache for my application. I have also added a mapListener to this cache to listen to a particular kind of events.
    tokenCache.addMapListener((MapListener) new TokenCacheListenerBean(), new MapEventFilter(tokenFilter), false);
    So bascially everytime a token (The domain object of this cache) is updated the entryUpdated() method in my EJB TokenCacheListenerBean is invoked.
    The issue I have though is that, from what I observe on running my code is that the Cache Listener is single threaded. So if two Token Objects on my tokenCache are updated,
    lets say Token Object A and Token Object B one after the other,  the entryUpdated() method in my EJB is invoked for Token Object A and  once the invocation is complete
    then the entryUpdated() method is invoked again for Token Object B(). At a given point of time there is only one instance of TokenCacheListenerBean EJB.  Is there a way to
    make this happen in multi-threaded manner ?
    Is there a configuration setting somewhere which allows multiple CacheListeners to be instantiated at a given point of time ?
    TokenCacheListenerBean  EJB_
    package oracle.communications.activation.asap.ace;
    import java.util.Iterator;
    import java.util.Set;
    import java.util.logging.Logger;
    import javax.ejb.Stateless;
    import com.tangosol.net.NamedCache;
    import com.tangosol.util.MapEvent;
    import com.tangosol.util.MapListener;
    import com.tangosol.util.ValueUpdater;
    import com.tangosol.util.extractor.PofExtractor;
    import com.tangosol.util.extractor.PofUpdater;
    import com.tangosol.util.filter.EqualsFilter;
    import com.tangosol.util.filter.LikeFilter;
    import com.tangosol.util.filter.LimitFilter;
    import com.tangosol.util.processor.UpdaterProcessor;
    * Session Bean implementation class TokenCacheListenerBean
    @Stateless
    public class TokenCacheListenerBean implements TokenCacheListenerBeanRemote, TokenCacheListenerBeanLocal, MapListener {
    NamedCache asdlCache;
    NamedCache tokenCache;
    private final int PAGE_SIZE = 1;
    private static Logger logger = Logger.getLogger(ConnectionManager.class.getName());;
    * An instance of the JCAModeler EJB, represents the JCA-JNEP
    JCAModeler jcaBean;
    * Default constructor.
    public TokenCacheListenerBean() {
    // TODO Auto-generated constructor stub
    public void entryDeleted(MapEvent Event) {
    public void entryInserted(MapEvent Event) {
    public void entryUpdated(MapEvent Event) {
    Token newToken = (Token) Event.getNewValue();
    Token oldToken = (Token) Event.getOldValue();
    if ((oldToken.getState() == Token.TOKEN_RESERVED)
    && (newToken.getState()== Token.TOKEN_AVAILABLE)) {
    String networkID = newToken.getNeID();
    asdlCache = AceCacheFactory.getCache("asdlCache");
    tokenCache = AceCacheFactory.getCache("tokenCache");
    EqualsFilter filterNE = new EqualsFilter(new PofExtractor(String.class,Asdl.NETWORKID), networkID);
    LimitFilter limitFilter = new LimitFilter(filterNE, PAGE_SIZE);
    Set removeASDL = asdlCache.keySet(limitFilter);
    Iterator asdlIterator = removeASDL.iterator();
    if (asdlIterator.hasNext()) {
    logger.info(printASDLCache());
    ValueUpdater updater = new PofUpdater(Token.STATE);
    System.out.println("Token ID:" + newToken.getTokenID());
    UpdaterProcessor updaterProcessor = new UpdaterProcessor(updater, Integer.toString(Token.TOKEN_RESERVED));
    tokenCache.invoke(newToken.getTokenID(), updaterProcessor);
    jcaBean = new JCAModeler(tokenCache);
    Object asdlID = asdlIterator.next();
    Asdl provisionAsdl = (Asdl) asdlCache.get(asdlID);
    asdlCache.remove(asdlID);
    jcaBean.provision(provisionAsdl, newToken.getTokenID());
    logger.info(ConnectionManager.printTokenCache());
    logger.info(printASDLCache());
    }

    Here is what I am asking!
    I have added 2 listeners (Listener A and Listener B) which each listen on for changes made to 2 different token Cache Objects (Token A and Token B).
    for (i = 0; i < 2 ; i++) {
    Token tokenAdded = new Token(UUID.randomUUID().toString(),TOKEN_AVAILABLE, networkID);
    tokenCache.put(tokenAdded.getTokenID(), tokenAdded);
         tokenCache.addMapListener((MapListener) new TokenCacheListener(), tokenAdded.getTokenID(), false);
    Now assume that updates are made to Token A and Token B simuntaneosly.
    Why do i observe in my diagnostic messages that only one Listener is invoked at a given point of time.
    Which means I see Listener A getting invoked and then once invocation of Listener A is complete I see Listener B bieng invoked.
    Ideally I would want both listeners to be invoked simultaneously rather than in a one off fashion.
    Here is the code for my token cache Listener
    package oracle.communications.activation.asap.ace;
    import java.util.Iterator;
    import java.util.Map;
    import java.util.Set;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import com.tangosol.net.CacheFactory;
    import com.tangosol.net.NamedCache;
    import com.tangosol.util.AbstractMapListener;
    import com.tangosol.util.Filter;
    import com.tangosol.util.MapEvent;
    import com.tangosol.util.MapListener;
    import com.tangosol.util.ObservableMap;
    import com.tangosol.util.ValueUpdater;
    import com.tangosol.util.extractor.PofExtractor;
    import com.tangosol.util.extractor.PofUpdater;
    import com.tangosol.util.filter.AndFilter;
    import com.tangosol.util.filter.EqualsFilter;
    import com.tangosol.util.filter.LikeFilter;
    import com.tangosol.util.filter.LimitFilter;
    import com.tangosol.util.processor.UpdaterProcessor;
    public class TokenCacheListener extends AbstractMapListener {
         NamedCache asdlCache;
         NamedCache tokenCache;
         AceCacheFactory cacheFactoryBean = new AceCacheFactory();
         private final int PAGE_SIZE = 1;
         private static Logger logger = Logger.getLogger(ConnectionManager.class
                   .getName());;
         * An instance of the JCAModeler EJB, represents the JCA-JNEP
         JCAModeler jcaBean;
         * This is a utility method and prints the tokens cache.
         public String printTokenCache() {
              NamedCache tokenCache = cacheFactoryBean.getCache("tokenCache");
              LikeFilter tokenList = new LikeFilter(new PofExtractor(String.class,
                        Token.STATE), "%", (char) 0, false);
              Set keySet = tokenCache.keySet(tokenList);
              StringBuffer cachedTokenList = new StringBuffer("\n################################## Token(s) Cache ##################################");
              int counter = 1;
              for (Object tokenInCache: keySet) {
                   Token tokenObject = (Token) tokenCache.get(tokenInCache.toString());
                   cachedTokenList.append("\nS.NO:" + (counter++)
                             + "\t ID:" + tokenInCache.toString()
                             + "\t State:" + Token.tokenToString(tokenObject.getState()));
              cachedTokenList.append("\n####################################################################################");
              return cachedTokenList.toString();     
         * This method is a utility method and it prints all the ASDL(s) currently present on the
         * asdlCache.
         private String printASDLCache() {
              NamedCache asdlCache = cacheFactoryBean.getCache("asdlCache");
              LikeFilter asdlList = new LikeFilter(new PofExtractor(String.class,
                                  Asdl.NETWORKID), "%", (char) 0, false);
              Set keySet = asdlCache.keySet(asdlList);
              StringBuffer cachedASDLList = new StringBuffer("\n################ ASDL Cache ######## ########");
              int counter = 1;
              for (Object asdlInCache: keySet) {
                   cachedASDLList.append("\nS.NO:" + (counter++) + "\t ID:" + asdlInCache.toString());
              cachedASDLList.append("\n################ ASDL Cache ######## ########\n");
              return cachedASDLList.toString();     
         public TokenCacheListener() {
         public void checkASDLCache(MapEvent Event) {
         // Not currently used
         public void entryUpdated(MapEvent Event) {
              Token newToken = (Token) Event.getNewValue();
              Token oldToken = (Token) Event.getOldValue();
              logger.info("\n=============================================================================================="
                        + "\nTOKEN CACHE LISTENER"
                        + "\n=============================================================================================="
                        + printTokenCache()
                        + "\n==============================================================================================");
              if ((oldToken.getState() == Token.TOKEN_RESERVED)
                        && (newToken.getState()== Token.TOKEN_AVAILABLE)) {
              String networkID = newToken.getNeID();
              asdlCache = cacheFactoryBean.getCache("asdlCache");
              tokenCache = cacheFactoryBean.getCache("tokenCache");
              EqualsFilter filterNE = new EqualsFilter(new PofExtractor(String.class,Asdl.NETWORKID), networkID);
              LimitFilter limitFilter = new LimitFilter(filterNE, PAGE_SIZE);
              Set removeASDL = asdlCache.keySet(limitFilter);
              Iterator asdlIterator = removeASDL.iterator();
              if (asdlIterator.hasNext()) {
              logger.info(printASDLCache());
              ValueUpdater updater = new PofUpdater(Token.STATE);
              System.out.println("Token ID:" + newToken.getTokenID());
              UpdaterProcessor updaterProcessor = new UpdaterProcessor(updater, Integer.toString(Token.TOKEN_RESERVED));
              tokenCache.invoke(newToken.getTokenID(), updaterProcessor);
              jcaBean = new JCAModeler(tokenCache);
              Object asdlID = asdlIterator.next();
              Asdl provisionAsdl = (Asdl) asdlCache.get(asdlID);
              asdlCache.remove(asdlID);
              jcaBean.provision(provisionAsdl, newToken.getTokenID());
              logger.info(printTokenCache());
              logger.info(printASDLCache());
    I only see one instance of this listener alive at any given point of time.
    Edited by: 807103 on Nov 3, 2011 1:00 PM
    Edited by: 807103 on Nov 3, 2011 1:12 PM

  • File read/write in separate threads

    If I have a file in process of being written out, and another thread comes along to read it, will it block until the first thread closes the file, or do I have to handle that programatically?

    I believe it will work if all the threads don't care about the content of the file, it would be rare though.
    So if you code these threads and want to make sure reading after writing or something similar, you got to take care of that using wait(), notify(), etc.
    PC

  • ACCESS VIOLATION calling SQLPEX - SQLLIBSHRA.EXE

    This is a problem for OpenVMS / Oracle Experts
    I have quit an old large legacy system to integrate - actually migrating away from a CORBA based communication backbone to a webservice AXIS2/Java based backbone using HP's WSIT e all, and yes - this legacy uses an old Oracle 7.3
    The OS is HP OpenVMS / Alpha V 7.3-n,
    When I link all my native code together the process launched through Java JNI is a "NETWORK" detached process which should do a DB_Connect via SQLPEX (ctx, sqlstm );
    The layers involved are like that; AXIS2/J webservice -> WSIT-javaBean ->
    JVM -> JNI -> SPg-Server.c (an wsit outer-wrapper) -> SPg-Legacy.c(my inner wrapper) -> SPS_WRAPPER.PAS (the inner-most wrapper / dispatcher) -> Business-logic-*.PAS -> DataBaseAccess.PAS
    (the database access code was generated by LNPROPAS from statements like EXEC SQL CONNECT .... etc.)
    When I exchange my SPS_WRAPPER.PAS WRAP() by a TestWrapper.PAS WRAP() which bypasses all business logic, SQLPEX(ctx, sqlstm); works perfectly and the database opens, in fact, a new detached second process is launched as ORA_nnnnn and my detached integrated web service process communicates nicely via MailBox Devices.
    However when I link in my original legacy code, LINK is fine, and all my business code runs fine when it gets called from the WRAP(), BUT I get an ACCESS VIOLATION as soon as SQLPEX() is called to connect to the Database.
    I can not debug because the code which does the access violation, for what ever reason, is in SQLLIBSHRA.EXE, and invoked when I call sqlpex( ctx, sqlstm )
    Maybe there is ONLY a resource problem, but why then an ACCESS VIOLAITION and yes, which resource to we have to make bigger. SYSGEN Parameters, autogen feedback did not help.
    I am not an Oracle Expert, so I do not know what and how I can make ORACLE tracing and logging and show me why I get this acess violation in a pice of code which runs nicely since 10 years in a CORBA environment, also runs nicely when my business logic is bypassed.
    And yes: ORA_ROOT:[000000.NETWORK.ADMIN]ORASRV_BEQ_A.COM
    is not hit / called when it comes to the access violation.
    Any hints are welcome before I have to jump into machine code debugging without a source listing.
    [email protected]

    This problem was caused by a user-stack-heap-code-collision
    PTHREAD applications may not do aoutomatic stack size expansions on a per thread basis and hence an access violation deep in long-time-running code is very likely to occure. (code which does not belong to YOU, for which you know it runs basically since 10 years, which migth not be supported any longer by the vendor)
    solution: WSIT (webservice integration toolkit) by default assignes 30000 bytes for each threads user-stack-size, can be adjusted in the .WSI deployment descriptor file; Now running at 60'000. WSIT V3.0 will allow for single threaded legacy server integration and have a automatic stack size expansion supported when running in this mode. (as per HP)
    [email protected]

  • Oracle 9i installation problem with RedHat 7.2 (segmentation violation)

    I have try to installation 9i with RedHat 7.2 by x windows.
    when i use xwin to run the "./runInstaller, i got the error
    (segmentation) as below:
    i have already try to follow the installation procedure in
    http://staff.in2.hr/denis/oracle/901install_rh72_en.html#1 but
    still got this error.
    Can anyone help me??
    Regards
    Chris Sung
    =================================================================
    ===============
    oracle install
    Connecting 192.168.1.3 via TELNET
    Thursday, December 13, 2001 1:04:06
    Red Hat Linux release 7.2 (Enigma)
    Kernel 2.4.7-10 on an i686
    login: oracle
    Password:
    Last login: Thu Dec 13 00:46:39 from apple
    [oracle@orange oracle]$ (/home/oracle/Disk1/runInstaller -
    display 192.168.1.2:0
    -name "oracle install" &)
    [oracle@orange oracle]$ Initializing Java Virtual Machine
    from /tmp/OraInstall/jre/bin/jre. Please wait...
    SIGSEGV 11* segmentation violation
         stackbase=0xbffff298, stackpointer=0xbffff160
    Full thread dump:
    "Finalizer thread" (TID:0x4276d210, sys_thread_t:0x4d0bfe0c,
    state:R) prio=1
    "Async Garbage Collector" (TID:0x4276d258,
    sys_thread_t:0x4d09ee0c, state:R) prio=1
    "Idle thread" (TID:0x4276d2a0, sys_thread_t:0x4d07de0c,
    state:R) prio=0
    "Clock" (TID:0x4276d088, sys_thread_t:0x4d05ce0c, state:CW)
    prio=12
    "main" (TID:0x4276d0b0, sys_thread_t:0x80d6fe8, state:R)
    prio=5 *current thread*
         java.lang.System.initializeSystemClass(System.java)
    Monitor Cache Dump:
    Registered Monitor Dump:
    Thread queue lock: <unowned>
    Name and type hash table lock: <unowned>
    String intern lock: <unowned>
    JNI pinning lock: <unowned>
    JNI global reference lock: <unowned>
    BinClass lock: <unowned>
    Class loading lock: <unowned>
    Java stack lock: <unowned>
    Code rewrite lock: <unowned>
    Heap lock: <unowned>
    Has finalization queue lock: <unowned>
    Finalize me queue lock: <unowned>
    Dynamic loading lock: <unowned>
    Monitor IO lock: <unowned>
    Child death monitor: <unowned>
    Event monitor: <unowned>
    I/O monitor: <unowned>
    Alarm monitor: <unowned>
         Waiting to be notified:
         "Clock" (0x4d05ce0c)
    Monitor registry: owner "main" (0x80d6fe8, 1 entry)
    Thread Alarm Q:

    Strange, but yesterday I nter in Oracle9i install, open
    gnome-terminal window as oracle user and simply type
    /tmp/Disk1/runInstaler
    the DISPLAY enviroment variable was set,
    using RedHat 7.2 , kernel 2.4.16-0.9, glibc-2.2.4-19
    Segmentation violation 11 may mean RAM problem, sometimes
    incorrect program pointer.So I think it must work (runIstaler)

  • CW++ and Threads (Follow up to David Rohacek)

    Thanks for the info David. I sure would like to call my CNiGraph:lotY method from inside any thread and I would appreciate some example code. Don't spend to much time on it because I know you are working hard to get the new version of Measurement Studio released. I'd hate to think that I slowed down the process. Well, slowed it down too much anyway.
    I keep thinking that there should be some kind of a simple solution because everthing seems to work fine until I try and automate a button press. My message thread is polling an A/D over a can bus and feeding back the data continuously to an edit box. I have a button that uses the DDX communication function UpdateData(TRUE); to load the member variable w
    ith the value of the edit box and then add that value to my chart. This works fine if I press the button myself. If I try and just call the function that the button calls each A/D conversion though I get a Run Time error "abnormal program termination". Do you think I could write my own thread to just press the button? That's still in a thread though isn't it. Would I still have to do the marshaling?
    Right now I'm just anxious to get something working. For sure the next release of Measurement Studio will solve this problem but in the meantime I would really appreciate just some way to work around this. I've already spent a good deal of time on it and am not afraid to spend a great deal more. If you could make some example code that would be great but maybe the number of people interested in this issue doesn't warrent the time spent. Thanks again for your help and the cool software.
    Grant
    Grant M. Johnson
    Project Engineer
    LECO Corporation

    Being a little too close to the implementation, I overlooked the easier solution, for which we actually already have an example program. Check out
    http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?openagent&24C350515009D6A1862569AC0073ACC6&cat=61B119A9F74ADC07862568C50070CE22
    This example shows you how to create and use a user-defined windows message to pass a value to the main thread, which then accesses the Measurement Studio ActiveX control. This should provide similar performance to that which you would get by marshaling the interface manually.
    David Rohacek
    National Instruments

  • Write to serial port asyncronously

    I am trying to write a commands to a serial port but my problem is that the operation is tedious so it is freezing up my UI. What makes it more complicated is that I must call this procedure when the form loads I want to ask if anyone can provide an alternative
    way to get the same or better result I was thinking of running it asynchronously but I don't know how to?
    This is the code I am calling on load
    If lblConnected.Text = "" Then
    MsgBox("Please connect to port.", MsgBoxStyle.OkOnly, "Validation")
    Exit Sub
    End If
    RichTextBox1.Text = ""
    Try
    With SerialPort1
    rcvdata = ""
    .Write("AT" & vbCrLf)
    Threading.Thread.Sleep(1)
    .Write("AT+CMGF=1" & vbCrLf)
    Threading.Thread.Sleep(1)
    .Write("AT+CPMS=""SM""" & vbCrLf)
    Threading.Thread.Sleep(1)
    .Write("AT+CMGL=""ALL""" & vbCrLf)
    Threading.Thread.Sleep(1)
    .Write("AT+CNUM" & vbCrLf)
    Threading.Thread.Sleep(2000)
    Dim lineoftext As String
    Dim arytextfile() As String
    Dim myString As String
    lineoftext = rcvdata.ToString
    arytextfile = Split(lineoftext, "Your number is", CompareMethod.Text)
    myString = "Your number is"
    lineoftext = lineoftext.Substring(lineoftext.IndexOf("Your number is"), 40)
    lineoftext = lineoftext.Replace("Your number is", "")
    lineoftext = lineoftext.Substring(0, 13)
    txtDonglePhoneNumber.Text = LTrim(lineoftext)
    End With
    Catch ex As Exception
    MsgBox(ex.Message)
    End Try
    I am trying to extract the phone number from this whole routine  and it works but its freezing up my UI. How can I run from another thread.
    If you think it you can achieve it

    Imports System.IO.Ports
    Imports System.Threading
    Public Class Form1
    Private comport As SerialPort
    Private sending As Boolean
    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    sending = False
    End Sub
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    comport = CreateComport(comport)
    If sending = False AndAlso OpenComport(comport) = True Then
    Dim t As Threading.Thread = New Threading.Thread(AddressOf SendData)
    t.IsBackground = True
    t.Start(comport)
    End If
    End Sub
    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
    CloseComport(comport)
    End Sub
    Private Function CreateComport(ByVal port As SerialPort) As SerialPort
    If port Is Nothing Then
    port = New SerialPort("COM4", 9600, Parity.None, 8, StopBits.One)
    End If
    Return port
    End Function
    Private Function OpenComport(ByVal port As SerialPort) As Boolean
    Try
    If (Not port Is Nothing) AndAlso (port.IsOpen = False) Then
    port.Open()
    End If
    Return True
    Catch ex As Exception
    MessageBox.Show(String.Format("Exception :{0}", ex.ToString()))
    Return False
    End Try
    End Function
    Private Sub CloseComport(ByVal port As SerialPort)
    Try
    If (sending = False) AndAlso (Not port Is Nothing) AndAlso (port.IsOpen) Then
    port.Close()
    MessageBox.Show("Port closed")
    End If
    Catch ex As Exception
    MessageBox.Show(String.Format("Exception :{0}", ex.ToString()))
    End Try
    End Sub
    Private Sub SendData(ByVal port As Object)
    Dim buffer(1023) As Byte
    For i As Int32 = 0 To buffer.Length - 1
    buffer(i) = i Mod 256
    Next
    sending = True
    Try
    DirectCast(port, SerialPort).Write(buffer, 0, buffer.Length)
    Catch ex As Exception
    CloseComport(DirectCast(port, SerialPort))
    MessageBox.Show(String.Format("Exception :{0}", ex.ToString()))
    Finally
    sending = False
    End Try
    End Sub
    End Class
    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

  • Installing Oracle 8.1.7 on RHEL 3 (SIGSEGV   11*  segmentation violation)

    Hi
    I have instaled a Oracle 8.1.7 on a Red Hat 3. and apply the 8.1.7 Mandatory OUI/JRE/GLIC Patch. All is fine until this point.
    But when i must re-run the install and run the netasst& i get an segmentation violation.
    I have checked all again, i have have uninstall all, and made a clean install, but i stil get the same error.
    This is the full error. Can any one help please?
    ./netasst&
    [1] 1726
    [oracle@lisoms1 bin]$ SIGSEGV 11* segmentation violation
    stackbase=0x41836000, stackpointer=0x41835a6c
    Full thread dump:
    "Image Fetcher 0" (TID:0x405ca908, sys_thread_t:0x3ffbde0c, state:R) prio=5
    "TaskScheduler timer" (TID:0x405ca668, sys_thread_t:0x3ffdee0c, state:R) prio=5
    "Thread-4" (TID:0x405c9200, sys_thread_t:0x3ffffe0c, state:R) prio=1
    "AWT-Motif" (TID:0x405b2860, sys_thread_t:0x41890e0c, state:R) prio=5
    java.lang.Thread.run(Thread.java)
    "AWT-Input" (TID:0x405b2880, sys_thread_t:0x4186fe0c, state:CW) prio=5
    "AWT-EventQueue-0" (TID:0x405b25e0, sys_thread_t:0x41835e0c, state:R) prio=5 current thread
    java.lang.Object.wait(Object.java)
    java.awt.EventQueue.getNextEvent(EventQueue.java:126)
    java.awt.EventDispatchThread.run(EventDispatchThread.java:70)
    "Finalizer thread" (TID:0x405ab210, sys_thread_t:0x412fde0c, state:CW) prio=1
    "Async Garbage Collector" (TID:0x405ab258, sys_thread_t:0x412dce0c, state:CW) prio=1
    "Idle thread" (TID:0x405ab2a0, sys_thread_t:0x412bbe0c, state:R) prio=0
    "Clock" (TID:0x405ab088, sys_thread_t:0x4129ae0c, state:CW) prio=12
    "main" (TID:0x405ab0b0, sys_thread_t:0x80eb190, state:CW) prio=5
    java.lang.Object.wait(Object.java)
    oracle.ewt.graphics.ImageLoader.waitFor(Unknown Source)
    oracle.ewt.graphics.ImageUtils.loadImage(Unknown Source)
    oracle.ewt.graphics.ImageUtils._getImageResource(Unknown Source)
    oracle.ewt.graphics.ImageUtils.getImageResource(Unknown Source)
    oracle.ewt.laf.oracle.OracleUIUtils.getImage(Unknown Source)
    oracle.ewt.laf.oracle.OracleUIUtils.getColorizedImage(Unknown Source)
    oracle.ewt.laf.oracle.OracleUIUtils.cImageInst(Unknown Source)
    oracle.ewt.laf.basic.StringInstantiator.createValue(Unknown Source)
    oracle.ewt.HashTableDefaults.getValue(Unknown Source)
    oracle.ewt.MultiUIDefaults.getValue(Unknown Source)
    oracle.ewt.UIDefaults.get(Unknown Source)
    oracle.ewt.UIDefaults.get(Unknown Source)
    oracle.ewt.UIDefaults.getImage(Unknown Source)
    oracle.ewt.laf.oracle.OracleChoiceUI._createButtonPainter(Unknown Source)
    oracle.ewt.laf.oracle.OracleChoiceUI.getButtonPainter(Unknown Source) oracle.ewt.lwAWT.LWDataSourceChoice$ChoiceButton.getPainter(Unknown Source)
    oracle.ewt.lwAWT.AbstractPainterComponent.getInvalidateFlags(Unknown Source)
    oracle.ewt.lwAWT.LWComponent.invalidateAndRepaintIfNecessary(Unknown Source)
    oracle.ewt.lwAWT.LWComponent.enable(Unknown Source)
    Monitor Cache Dump:
    oracle.ewt.graphics.ImageLoader@1079814480/1080606192: <unowned>
    Waiting to be notified:
    "main" (0x80eb190)
    <unknown key> (0x0x412dce0c): <unowned>
    Waiting to be notified:
    "Async Garbage Collector" (0x412dce0c)
    oracle.ewt.lwAWT.LWChoice@1079812040/1080591384: owner "main" (0x80eb190, 2 entries)
    sun.awt.motif.MToolkit@1079715432/1080130112: owner "AWT-Motif" (0x41890e0c, 0 entries)
    Waiting to be notified:
    "AWT-Input" (0x4186fe0c)
    java.awt.EventQueue@1079715376/1080130376: owner "AWT-EventQueue-0" (0x41835e0c, 1 entry)
    oracle.ewt.MultiUIDefaults@1079748416/1080283560: owner "main" (0x80eb190, 1 entry)
    oracle.ewt.HashTableDefaults@1079745008/1080268568: owner "main" (0x80eb190, 1 entry)
    Registered Monitor Dump:
    Thread queue lock: <unowned>
    Name and type hash table lock: <unowned>
    String intern lock: <unowned>
    JNI pinning lock: <unowned>
    JNI global reference lock: <unowned>
    BinClass lock: <unowned>
    Class loading lock: <unowned>
    Java stack lock: <unowned>
    Code rewrite lock: <unowned>
    Heap lock: <unowned>
    Has finalization queue lock: <unowned>
    Finalize me queue lock: <unowned>
    Waiting to be notified:
    "Finalizer thread" (0x412fde0c)
    Dynamic loading lock: <unowned>
    Monitor IO lock: <unowned>
    Child death monitor: <unowned>
    Event monitor: <unowned>
    I/O monitor: <unowned>
    Alarm monitor: <unowned>
    Waiting to be notified:
    "Clock" (0x4129ae0c)
    Monitor registry: owner "AWT-EventQueue-0" (0x41835e0c, 1 entry)
    Thread Alarm Q:
    sys_thread_t 0x412dce0c [Timeout in 831 ms]
    ./netasst: line 110: 1728 Killed $JRE -classpath $CLASSPATH oracle.net.asst.container.NetApplication oracle.net.asst.container.NetApplication
    [1]+ Exit 137 ./netasst
    Thank You
    JailBreak

    A have installed Oracle 8.1.5 on HP_UX 11.00 - 32 bit environment
    I want to install/upgrade to Oracle 8.1.7 (64-bit)
    1. Is there any problem with this aspect ? (Oracle 8.1.7. 64-bit on HP_UX 32 bit)
    2. I need an advice regarding <new install> vs. <upgrading> ! I'm not sure if all operating system requirements are met (patch releases)
    3. What are the risk of upgrading ?

  • Need help with threads?.. please check my approach!!

    Hello frnds,
    I am trying to write a program.. who monitors my external tool.. please check my way of doing it.. as whenever i write programs having thread.. i end up goosy.. :(
    first let me tell.. what I want from program.. I have to start an external tool.. on separate thread.. (as it takes some time).. then it takes some arguments(3 arguments).. from file.. so i read the file.. and have to run tool.. continously.. until there are arguments left.. in file.. or.. user has stopped it by pressing STOP button..
    I have to put a marker in file too.. so that.. if program started again.. file is read from marker postion.. !!
    Hope I make clear.. what am trying to do!!
    My approach is like..
    1. Have two buttons.. START and STOP on Frame..
    START--> pressed
    2. check marker("$" sign.. placed in beginning of file during start).. on file..
         read File from marker.. got 3 arg.. pass it to tool.. and run it.. (on separate thread).. put marker.. (for next reading)
         Step 2.. continously..
    3. STOP--> pressed
         until last thread.. stops.. keep running the tool.. and when last thread stops.. stop reading any more arguments..
    Question is:
    1. Should i read file again and again.. ?.. or read it once after "$" sign.. store data in array.. and once stopped pressed.. read file again.. and put marker ("$" sign) at last read line..
    2. how should i know when my thread has stopped.. so I start tool again??.. am totally confused.. !!
    please modify my approach.. if u find anything odd..
    Thanks a lot in advance
    gervini

    Hello,
    I have no experience with threads or with having more than run "program" in a single java file. All my java files have the same structure. This master.java looks something like this:
    ---master.java---------------------------------------------------
    import java.sql.*;
    import...
    public class Master {
    public static void main(String args []) throws SQLException, IOException {
    //create connection pool here
    while (true) { // start loop here (each loop takes about five minutes)
    // set values of variables
    // select a slave process to run (from a list of slave programs)
    execute selected slave program
    // check for loop exit value
    } // end while loop
    System.out.println("Program Complete");
    } catch (Exception e) {
    System.out.println("Error: " + e);
    } finally {
    if (rSet1 != null)
    try { rSet1.close(); } catch( SQLException ignore ) { /* ignored */ }
    connection.close();
    -------end master.java--------------------------------------------------------
    This master.java program will run continuously for days or weeks, each time through the loop starting another slave process which runs for five minutes to up to an hour, which means there may be ten to twenty of these slave processes running simultaneously.
    I believe threads is the best way to do this, but I don't know where to locate these slave programs: either inside the master.java program or separate slave.java files? I will need help with either method.
    Your help is greatly appreciated. Thank you.
    Logan

  • Photoshop CS6  mac OS X 10.9.5 - cannot update 13.0.6  - error "Update failed - unable to write at location." Tried manual update also failed. Tried to change permissions also failed.

    Photoshop CS6  mac OS X 10.9.5 - cannot update 13.0.6  - error "Update failed - unable to write at location." Tried manual update also failed. Tried to change permissions also failed.
    Follow write permission on thread below - same error message
    Re: CS6 updates and Mac write permissions
    Need Adobe help to solve this. My own searches in Forums and Google all have failed.

    It is not an Adobe problem. You have a OS permissions problem. You can try to correct this by using Disk Utility to Repair Permissions. It is in the First Aid area of Disk Utility.

  • Help on stuck thread

    Hi, From my server log I noticed that there are some stuck threads. After looked at the thread dump thread 18 is blocking. MainPortalServlet.java is extends PortalServlet and line 96 is super.service(request,response); Please help me to analyse why it is blocking. Thanks.
    "ExecuteThread: '20' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x0090e6b0 nid=0x3b waiting for monitor entry [0x600fd000..0x600ffc28]
         at com.bea.wlw.netui.script.el.util.ParseUtils.parse(ParseUtils.java:100)
         - waiting to lock <0x8d3a3f18> (a com.bea.wlw.netui.script.el.util.ParseUtils$Cache)
         at com.bea.wlw.netui.script.el.ExpressionEvaluatorImpl.containsExpression(ExpressionEvaluatorImpl.java:239)
         at com.bea.wlw.netui.pageflow.ProcessPopulate.populate(ProcessPopulate.java:295)
         at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.processPopulate(PageFlowRequestProcessor.java:402)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
         at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:691)
         at com.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:527)
         at com.bea.wlw.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:152)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
         at com.bea.wlw.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1786)
         at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.executeAction(ScopedContentCommonSupport.java:561)
         at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.processActionInternal(ScopedContentCommonSupport.java:121)
         at com.bea.portlet.adapter.scopedcontent.PageFlowStubImpl.processAction(PageFlowStubImpl.java:98)
         at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:154)
         at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:113)
         at com.bea.netuix.servlets.controls.content.NetuiContent.handlePostbackData(NetuiContent.java:228)
         at com.bea.netuix.nf.ControlLifecycle$3.visit(ControlLifecycle.java:171)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:356)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:126)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:105)
         at com.bea.netuix.nf.Lifecycle.runInbound(Lifecycle.java:173)
         at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:137)
         at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:324)
         at com.bea.netuix.servlets.manager.UIServlet.processControlTree(UIServlet.java:220)
         at com.bea.netuix.servlets.manager.PortalServlet.doPost(PortalServlet.java:820)
         at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:150)
         at com.cd.servlets.portal.MainPortalServlet.service(MainPortalServlet.java:96)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
         at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:293)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7053)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    "ExecuteThread: '19' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x0090dab8 nid=0x3a runnable [0x601fb000..0x601ffc28]
         at java.util.HashMap.getEntry(HashMap.java:361)
         at java.util.LinkedHashMap.get(LinkedHashMap.java:266)
         at com.bea.wlw.netui.script.el.util.ParseUtils.parse(ParseUtils.java:84)
         at com.bea.wlw.netui.script.el.util.ParseUtils.evaluate(ParseUtils.java:123)
         at com.bea.wlw.netui.script.el.ExpressionEvaluatorImpl.evaluateStrict(ExpressionEvaluatorImpl.java:87)
         at com.bea.wlw.netui.tags.AbstractBaseTag.evaluateExpressionInternal(AbstractBaseTag.java:573)
         at com.bea.wlw.netui.tags.AbstractBaseTag.evaluateExpression(AbstractBaseTag.java:362)
         at com.bea.wlw.netui.tags.databinding.script.GetData.doEndTag(GetData.java:249)
         at jsp_servlet._portlets.___portlet1._jspService(_portlet1.jsp:27)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
         at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:293)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
         at com.bea.wlw.netui.pageflow.PageFlowJspFilter.doFilter(PageFlowJspFilter.java:250)
         - locked <0x78ccf6c8> (a portlets.Portlet1Controller)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
         at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:652)
         at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:431)
         at com.bea.wlw.netui.pageflow.scoping.internal.ScopedRequestDispatcher.include(ScopedRequestDispatcher.java:120)
         at com.bea.netuix.servlets.controls.content.JspContent.beginRender(JspContent.java:534)
         at com.bea.netuix.servlets.controls.content.NetuiContent.beginRender(NetuiContent.java:425)
         at com.bea.netuix.nf.ControlLifecycle$1.visit(ControlLifecycle.java:495)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:543)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:247)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:105)
         at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:356)
         at com.bea.netuix.nf.UIControl.render(UIControl.java:536)
         at com.bea.netuix.servlets.controls.PresentationContext.render(PresentationContext.java:405)
         at com.bea.netuix.servlets.util.RenderToolkit.renderChild(RenderToolkit.java:123)
         at com.bea.netuix.servlets.jsp.taglib.RenderChild.doStartTag(RenderChild.java:58)
         at jsp_servlet._framework._skeletons._cd.__flowlayout._jspService(flowlayout.jsp:30)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
         at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:646)
         at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:431)
         at com.bea.netuix.servlets.controls.JspRenderer.renderAlt(JspRenderer.java:194)
         at com.bea.netuix.servlets.controls.JspRenderer.beginRender(JspRenderer.java:96)
         at com.bea.netuix.nf.ControlLifecycle$1.visit(ControlLifecycle.java:491)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:543)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:247)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:105)
         at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:356)
         at com.bea.netuix.nf.UIControl.render(UIControl.java:536)
         at com.bea.netuix.servlets.controls.PresentationContext.render(PresentationContext.java:405)
         at com.bea.netuix.servlets.util.RenderToolkit.renderChild(RenderToolkit.java:123)
         at com.bea.netuix.servlets.jsp.taglib.RenderChild.doStartTag(RenderChild.java:58)
         at jsp_servlet._framework._skeletons._cd.__flowlayout._jspService(flowlayout.jsp:30)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
         at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:646)
         at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:431)
         at com.bea.netuix.servlets.controls.JspRenderer.renderAlt(JspRenderer.java:194)
         at com.bea.netuix.servlets.controls.JspRenderer.beginRender(JspRenderer.java:96)
         at com.bea.netuix.nf.ControlLifecycle$1.visit(ControlLifecycle.java:491)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:543)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:247)
         at com.bea.netuix.nf.Lifecycle.runOutbound(Lifecycle.java:204)
         at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:153)
         at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:324)
         at com.bea.netuix.servlets.manager.UIServlet.processControlTree(UIServlet.java:220)
         at com.bea.netuix.servlets.manager.PortalServlet.doPost(PortalServlet.java:820)
         at com.bea.netuix.servlets.manager.PortalServlet.doGet(PortalServlet.java:671)
         at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:147)
         at com.cd.servlets.portal.MainPortalServlet.service(MainPortalServlet.java:116)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
         at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:293)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7053)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    "ExecuteThread: '18' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x0090cec0 nid=0x39 runnable [0x602fd000..0x602ffc28]
         at java.util.LinkedHashMap.transfer(LinkedHashMap.java:224)
         at java.util.HashMap.resize(HashMap.java:452)
         at java.util.LinkedHashMap.addEntry(LinkedHashMap.java:399)
         at java.util.HashMap.put(HashMap.java:392)
         at com.bea.wlw.netui.script.el.util.ParseUtils.parse(ParseUtils.java:100)
         - locked <0x8d3a3f18> (a com.bea.wlw.netui.script.el.util.ParseUtils$Cache)
         at com.bea.wlw.netui.script.el.ExpressionEvaluatorImpl.containsExpression(ExpressionEvaluatorImpl.java:239)
         at com.bea.wlw.netui.pageflow.ProcessPopulate.populate(ProcessPopulate.java:295)
         at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.processPopulate(PageFlowRequestProcessor.java:402)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
         at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:691)
         at com.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:527)
         at com.bea.wlw.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:152)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
         at com.bea.wlw.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1786)
         at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.executeAction(ScopedContentCommonSupport.java:561)
         at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.processActionInternal(ScopedContentCommonSupport.java:121)
         at com.bea.portlet.adapter.scopedcontent.PageFlowStubImpl.processAction(PageFlowStubImpl.java:98)
         at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:154)
         at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:113)
         at com.bea.netuix.servlets.controls.content.NetuiContent.handlePostbackData(NetuiContent.java:228)
         at com.bea.netuix.nf.ControlLifecycle$3.visit(ControlLifecycle.java:171)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:356)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:126)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:105)
         at com.bea.netuix.nf.Lifecycle.runInbound(Lifecycle.java:173)
         at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:137)
         at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:324)
         at com.bea.netuix.servlets.manager.UIServlet.processControlTree(UIServlet.java:220)
         at com.bea.netuix.servlets.manager.PortalServlet.doPost(PortalServlet.java:820)
         at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:150)
         at com.cd.servlets.portal.MainPortalServlet.service(MainPortalServlet.java:96)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
         at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:293)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7053)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)

    Hi user9503787,
    Can you please confirm if the Weblogic instance / java process you took the Thread Dump from was showing high CPU utilization?
    Your Thread Dump data is quite interesting and a perfect example of a non Thread safe HashMap combined with a read/write race condition:
    Thread #23 (hanging for 600 seconds+) is showing a potential infinite looping condition in at java.util.HashMap.getEntry(HashMap.java:361)
    Thread #22 (hanging for 600 seconds+) is showing a potential infinite looping condition while performing a resize() following a put() operation
    Weblogic Portal has some known issues which regards to usage of non Thread safe HashHap data structures; which under load can cause infinite looping and sharp surge of CPU (due to corruption of the internal HashMap index preventing exiting the internal loop); ultimately hanging the whole JVM.
    We had the same issue for one of our Weblogic Portal 10.0 production environment and Oracle provided a patch (via Collections.synchronizedMap() ).
    Please open a SR and Oracle, share these 2 Threads and discuss with the engineer about a patch / know issues regarding non Thread safe HashMap and infinite looping.
    Regards,
    P-H
    http://javaeesupportpatterns.blogspot.com/

  • Jpcap does not work in threads

    Hello there!
    The problem is next:
    I'm using jpcap lib for packet sniffer. As ordinary user has more than one device, I'm trying to use it as threads. But it doesn't work at all :(
    Single process runs well, but this stops at the very beginning with no error at all. Just stops.
      public DeviceSniffer(int device) {
        System.out.println("Start of initialization device number "+device);
        this.requestCount = 0;
        this.responseCount = 0;
        this.deviceNumber = device;
        this.requestMessages = new ArrayList<RequestMessage>(REQUEST_LIMIT);
        this.incompleteRequestMessages = new ArrayList<RequestMessage>(
            REQUEST_LIMIT);
        this.responseMessages = new ArrayList<ResponseMessage>(REQUEST_LIMIT);
      public void run() {
        System.out.println("Sniffer started!");
        snifferStart();
      public void snifferStart() {
        try {
          NetworkInterface[] devices = JpcapCaptor.getDeviceList();
          System.out.println("Device: " + devices[deviceNumber].description);
          jpcap = JpcapCaptor.openDevice(devices[deviceNumber], 2000, false, 20);
          jpcap.setFilter("tcp", true);
          jpcap.loopPacket(-1, new DeviceSniffer(deviceNumber));
        catch (IOException e) {
          System.out.println("[E] ---");
      }and calling is like ordinary thread:
        NetworkInterface[] devices = JpcapCaptor.getDeviceList();
        for ( int i = 0; i < devices.length; i++ ){
          Thread t = new DeviceSniffer(i);
          t.start();
        }Does anybody have any solution? Or I should use any other lib/framework?
    Kirill

    Ok, if I re-write a bit thread calling:
        NetworkInterface[] devices = JpcapCaptor.getDeviceList();
        for ( int i = 0; i < devices.length; i++ ){
          Thread t = new DeviceSniffer(devices);
    t.start();
    }and DeviceSniffer: private NetworkInterface device;
    public DeviceSniffer(NetworkInterface device){
    this.device = device;
    this.requestCount = 0;
    this.responseCount = 0;
    this.requestMessages = new ArrayList<RequestMessage>(REQUEST_LIMIT);
    this.incompleteRequestMessages = new ArrayList<RequestMessage>(
    REQUEST_LIMIT);
    this.responseMessages = new ArrayList<ResponseMessage>(REQUEST_LIMIT);
    private void startSniffer() throws Throwable {
    System.out.println("Device: " + device.description);
    jpcap = JpcapCaptor.openDevice(device, 2000, false, 20);
    jpcap.setFilter("tcp", true);
    jpcap.loopPacket(-1, new DeviceSniffer(device));
    public void run() {
    System.out.println("Sniffer started!");
    try {
    startSniffer();
    catch (Throwable e) {
    e.printStackTrace();
    }it even starts caputiring, but...Sniffer started!
    Device: Adapter for generic dialup and VPN capture
    Sniffer started!
    Device: TAP-Win32 Adapter V8 (Microsoft's Packet Scheduler)
    Sniffer started!
    Device: VMware Virtual Ethernet Adapter
    Sniffer started!
    Device: Intel(R) Wireless WiFi Link 4965AGN (Microsoft's Packet Scheduler)
    Sniffer started!
    Device: Broadcom NetXtreme Gigabit Ethernet Driver (Microsoft's Packet Scheduler)
    Sniffer started!
    Device: VMware Virtual Ethernet Adapter
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0b163b87, pid=5992, tid=5788
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode)
    # Problematic frame:
    # C [wpcap.dll+0x13b87]
    .....some lines are missing...
    [error occurred during error reporting, step 120, id 0xc0000005]
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j jpcap.JpcapCaptor.setFilter(Ljava/lang/String;Z)V+0
    j DeviceSniffer.startSniffer()V+52
    j DeviceSniffer.run()V+9
    v ~StubRoutines::call_stubDoes this mean that I can't access wpcap.dll in threads or, in other words, is it impossible to capture all devices at one time anisochronously?
    Edited by: kirillica on Jan 30, 2008 4:27 AM
    more info added                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • How do I create a 2nd iTunes account on the same computer?

    I have an iPhone tied to one computer.  I have a second iPhone that I need to use the same computer to be able to back it's data up.  Do I need to create a 2nd iTunes account on the same computer?  If so, how do i do this?  Thanks.    

  • DNG codec doesn't support descriptive tags in Windows 7

    I installed the Adobe DNG codec yesterday which does indeed make it possible for Windows Explorer, Windows Media Player, Windows Live Photo Gallery and Windows Media Center to display DNG files (as thumbnails and as full sized images).  I discovered

  • 7.1 & my iPod *spontaneously combusts*

    I've had a good couple of days of complete and utter BS with the new iTunes update and am still left with a major problem! Initially, instead of syncing my iPod with three new albums and podcasts it decided to deleted everything on the iPod, as if my

  • Its very urgent

    DECLARE e_invalid_department EXCEPTION; cursor c1 is select sal,deptno from emp FOR UPDATE OF sal NOWAIT; BEGIN for emp_rec in c1 loop UPDATE emp SET sal = sal + (sal * DECODE(mgr,NULL,100, DECODE(emp_rec.deptno,10,10, 20,10, 30,15, 40,15, 20)) / 100

  • Why does our apple id appear as disabled on apple tv after it worked, fine and has money from a gift card?

    Why does our apple id appear as disabled on apple tv after it worked, fine and has money from a gift card?