Class merging - breaking Concurrency?

Hello there,
I use a class-merging tool for my applet development because applet-size does really a lot for what I am creating.
The class-merger does "nothing" more than to copy two classes into one and to add an int-field clalled "classTypeField". If two methods are named equal and may not renamed (e.g. because both classes implement Runnable) it does:
public void run() {
  if(classTypeField == -1)
  run_class1();
}else
if(classTyoeField == 0)
   run_class2();
}The class-type field is initialized in a modified constructor and which looks like this (copied from decompiled code):
public int classTypeField;
    public DecrypterInputStream(InputStream is,
                    EncrypterOutputStream decrypter, int i) {
     decrypter$1e835275 = decrypter;
     this.is = is;
        this.classTypeField = -1;
    }Am I right when assuming that this code is broken?
I am not completly sure, but if e.g. the run() method is executed on another thread than the thread the object was created it could be that the if(classTypeField==-1)-check would see a wrong value, right?
For Java-5+ its enough to add a "final"-keyword, for java<5.0 the classTypeField has to volatile, right?
Or am I missing some guarantees made by the JVM?
Thank you in advance, lg Clemens

Thanks a lot for your detailed answer.
The issue is then how the object is published such that other threads can use it. I have some problems to identify use-cases which could be problematic. Are there typical use-cases where such problems could be visible? My classes are mostly "manager-classes" instatiated on the EDT and used by some threads.
Should I recommend the tool-writers to make the classTypeField final? I guess they'll hate it because it means they would have to initialize it in any case and for now they relied on beeing 0 if not set ;)
Thanks a lot for your helpful and detailed answers all the time, lg Clemens

Similar Messages

  • Issue with class loading -  Java concurrent Program

    Hi ,
    We are facing a strange issue for one of our customer.
    Scenario :
    We have a Java Concurrent Program (A.java ) which refers another Java class (B.java) , we modified the file B.java for a fix and created a patch. after applying the patch and bouncing the apache ,we found that B.java is loaded the old version of the class file.
    We asked them to restart the concurrent manager and related services, still we see that old version of B.java is loaded. (confirmed by adding code throwing exception - throw new Exception from a specific line and found that its not getting thrown at run-time)
    Any clue on this?.
    Thanks
    Joseph George

    Deployed this file both tier - Database server tier and Application server tier.
    I have face same issue, Concurrent program not picking file application server tier. its picking file from database server tier.
    Thanks, Avaneesh

  • Error Involving EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap

    The JVM is crashing and I am getting the following error. I am having a hard time getting started figuring out why this is happening. I am not using this method directly and am having a hard time figuring out what is leading to this. In Eclipse when I use open type the ConcurrentReaderHashMap class does not show up. Does this mean the class is coming from the JVM jar files? I am using java.util.concurrent.ConcurrentHashMap. I am wondering if it is being called from ConcurrentHashMap? When I use the Eclipse open type with ConcurrentHashMap I get two classes java.util.concurrent.ConcurrentHashMap and edu.emory.mathcs.backport.java.util.concurrent from the jar apache-activemq-4.1.1.jar. If I am correct and ConcurrentReaderHashMap is being called from ConcurrentHashMap. How can I figure out which one? I am using activemq, so if it is being called from activemq, there is little I can do from my code without taking on looking at the source from activemq. If it is from java.util.concurrent.ConcurrentHashMap, I may have more direct control. The strange thing about this is from the java doc from ConcurrentHashMap, I get the impression that thread safe iterators is one of the benefits of using ConcurrentHashMap over HashTable or Collections.synchronizedMap. Is this wrong? Any ideas you can provide me would be greatly appreciated. Thanks in Advance! The contents of the hs_err_pid file appears below:
    # An unexpected error has been detected by Java Runtime Environment:
    # SIGSEGV (0xb) at pc=0xb642e40e, pid=10152, tid=2990115744
    # Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode, sharing)
    # Problematic frame:
    # J EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap$HashIterator.hasNext()Z
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    --------------- T H R E A D ---------------
    Current thread (0x0813a800): JavaThread "DeployerRunnable Thread for dai-core" [_thread_in_Java, id=17757]
    siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0xc99afacf
    Registers:
    EAX=0x499afad0, EBX=0x86e6f328, ECX=0x443b6620, EDX=0x86e6f928
    ESP=0xb23972a0, EBP=0xb23972b8, ESI=0x499afad0, EDI=0x00000019
    EIP=0xb642e40e, CR2=0xc99afacf, EFLAGS=0x00210212
    Top of Stack: (sp=0xb23972a0)
    0xb23972a0: 443b6620 443b6620 b23972a8 86e6e4dc
    0xb23972b0: b23972d0 86e6ea28 b23972fc b5f2718d
    0xb23972c0: 00000000 b23972d0 86e6f910 b5f2718d
    0xb23972d0: 443b6620 00000009 498c47e0 b23972d4
    0xb23972e0: 8583aadb b239731c 858acf40 00000000
    0xb23972f0: 8583ade8 b23972d0 b239731c b2397348
    0xb2397300: b5f26edd 00000000 00000000 00000000
    0xb2397310: 00000000 443b6620 498c47e0 498c1010
    Instructions: (pc=0xb642e40e)
    0xb642e3fe: 66 90 8b 71 0c 83 fe 00 0f 84 67 00 00 00 3b 06
    0xb642e40e: 8b be ff ff ff 7f 83 ff 00 0f 85 a0 00 00 00 3b
    Stack: [0xb2348000,0xb2399000), sp=0xb23972a0, free space=316k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    J EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap$HashIterator.hasNext()Z
    j com.evermind.server.http.HttpApplication.destroyServlets()V+23
    j com.evermind.server.http.HttpApplication.destroy()V+182
    j com.evermind.server.http.HttpApplication.stopCleanUp(Ljava/util/List;)V+10
    j com.evermind.server.http.HttpApplication.componentStop(Ljava/util/List;)V+26
    j com.evermind.server.Application.doStop()V+208
    j com.evermind.server.Application.stop()V+8
    j oracle.oc4j.admin.management.mbeans.J2EEStateManageableObjectBase.stop()V+108
    j oracle.oc4j.admin.management.mbeans.J2EEApplication.stop()V+323
    v ~StubRoutines::call_stub
    V [libjvm.so+0x20bc6d]
    V [libjvm.so+0x30a828]
    V [libjvm.so+0x20bb00]
    V [libjvm.so+0x33156f]
    V [libjvm.so+0x333f6c]
    V [libjvm.so+0x277c28]
    C [libjava.so+0x15224] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x34
    J sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    J sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    J sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    J java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    j sun.reflect.misc.Trampoline.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+3
    j sun.reflect.GeneratedMethodAccessor40.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+40
    J sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    J java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    j sun.reflect.misc.MethodUtil.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+63
    j javax.management.modelmbean.RequiredModelMBean.invokeMethod(Ljava/lang/String;Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+11
    j javax.management.modelmbean.RequiredModelMBean.invoke(Ljava/lang/String;[Ljava/lang/Object;[Ljava/lang/String;)Ljava/lang/Object;+657
    j oracle.oc4j.admin.jmx.server.mbeans.model.DefaultModelMBeanImpl.invoke(Ljava/lang/String;[Ljava/lang/Object;[Ljava/lang/String;)Ljava/lang/Object;+65
    j com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Ljavax/management/ObjectName;Ljava/lang/String;[Ljava/lang/Object;[Ljava/lang/String;)Ljava/lang/Object;+28
    j com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Ljavax/management/ObjectName;Ljava/lang/String;[Ljava/lang/Object;[Ljava/lang/String;)Ljava/lang/Object;+13
    j oracle.oc4j.admin.jmx.server.state.ApplicationStateFilterMBeanServer.invoke(Ljavax/management/ObjectName;Ljava/lang/String;[Ljava/lang/Object;[Ljava/lang/String;)Ljava/lang/Object;+14
    j oracle.oc4j.admin.internal.ApplicationDeployer.stopApplication()V+45
    j oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(Z)Z+93
    j oracle.oc4j.admin.internal.DeployerBase.execute(Z)Ljava/util/Map;+58
    j oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun()V+47
    j oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run()V+53
    J com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run()V
    j java.lang.Thread.run()V+11
    v ~StubRoutines::call_stub
    V [libjvm.so+0x20bc6d]
    V [libjvm.so+0x30a828]
    V [libjvm.so+0x20b580]
    V [libjvm.so+0x20b60d]
    V [libjvm.so+0x27b845]
    V [libjvm.so+0x384190]
    V [libjvm.so+0x30b719]
    C [libpthread.so.0+0x53cc]
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    =>0x0813a800 JavaThread "DeployerRunnable Thread for dai-core" [_thread_in_Java, id=17757]
    0x08137c00 JavaThread "EventManager::oc4j-128.115.222.7-23943-default" daemon [_thread_blocked, id=17756]
    0x08137000 JavaThread "Thread-102039" [_thread_blocked, id=17754]
    0xb1101400 JavaThread "ActiveMQ Session Task" daemon [_thread_blocked, id=17740]
    0x082d7400 JavaThread "MetricCollector:METRICCOLL50:5" daemon [_thread_blocked, id=17725]
    0x081c8800 JavaThread "RMICallHandler-12" [_thread_blocked, id=17716]
    0x081c8400 JavaThread "RMICallHandler-11" [_thread_blocked, id=17715]
    0x08191400 JavaThread "RMICallHandler-10" [_thread_blocked, id=17701]
    0xb359a800 JavaThread "RMIConnectionThread" [_thread_in_native, id=10419]
    0x080dd800 JavaThread "TimerThread300000" daemon [_thread_blocked, id=10399]
    0x08288400 JavaThread "CacheManager" daemon [_thread_blocked, id=10398]
    0x08268000 JavaThread "RMIConnectionThread" [_thread_in_native, id=10387]
    0xb355e000 JavaThread "EmChartCacheWorker" daemon [_thread_blocked, id=10386]
    0x0811c800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10328]
    0x0811b800 JavaThread "Thread-93" daemon [_thread_in_native, id=10327]
    0x0810f400 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10326]
    0x08100c00 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10324]
    0xb50bc000 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10322]
    0xb5267400 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10320]
    0x081b6800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10318]
    0xb5224800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10314]
    0x081a7c00 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10313]
    0xb35fec00 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10310]
    0x08198c00 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10308]
    0xb4cec800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10306]
    0xb522e400 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10304]
    0x08188800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10302]
    0xb4d2e800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10301]
    0x0816e000 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10298]
    0xb4b4e400 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10297]
    0xb52f8c00 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10294]
    0xb50aa000 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10292]
    0xb4b46800 JavaThread "DestroyJavaVM" [_thread_blocked, id=10153]
    0xb35ffc00 JavaThread "TaskManager" [_thread_blocked, id=10291]
    0x081ce400 JavaThread "Timer-18" [_thread_blocked, id=10288]
    0xb35fd000 JavaThread "Timer-17" [_thread_blocked, id=10287]
    0xb35f1800 JavaThread "Timer-16" [_thread_blocked, id=10286]
    0xb3539400 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10285]
    0xb35acc00 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10282]
    0xb35ba400 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10280]
    0xb3cb7c00 JavaThread "Timer-15" [_thread_blocked, id=10278]
    0xb35cac00 JavaThread "Timer-14" [_thread_blocked, id=10275]
    0xb35ce000 JavaThread "Timer-13" [_thread_blocked, id=10274]
    0xb35b5c00 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10273]
    0xb35bc400 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10271]
    0xb35be800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10269]
    0xb3997800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10266]
    0xb359bc00 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10264]
    0xb353d800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10262]
    0xb39a1400 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10260]
    0xb3996c00 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10258]
    0xb359d400 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10256]
    0xb358c000 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10254]
    0xb3542800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10252]
    0xb355ec00 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10250]
    0xb359e000 JavaThread "Timer-12" [_thread_blocked, id=10247]
    0xb35a5000 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10246]
    0xb35a0800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10244]
    0xb35a2000 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10242]
    0xb3596c00 JavaThread "Timer-11" [_thread_blocked, id=10239]
    0xb3596000 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10238]
    0xb359c400 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10236]
    0xb3595800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10234]
    0xb357fc00 JavaThread "Timer-10" [_thread_blocked, id=10231]
    0xb357f800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10230]
    0xb357d400 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10228]
    0xb3579000 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10226]
    0xb353f800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10223]
    0xb3543400 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10221]
    0xb353ec00 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10219]
    0xb3552400 JavaThread "Timer-9" [_thread_blocked, id=10217]
    0xb3550800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10215]
    0xb355c800 JavaThread "Thread-30" daemon [_thread_in_native, id=10214]
    0xb3544800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10212]
    0xb3548400 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10209]
    0xb3547800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10207]
    0xb354f800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10205]
    0xb354e800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10203]
    0xb399fc00 JavaThread "Thread-23" daemon [_thread_in_native, id=10200]
    0xb3920000 JavaThread "Timer-8" [_thread_blocked, id=10197]
    0xb391e400 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10196]
    0xb3916000 JavaThread "Thread-19" daemon [_thread_in_native, id=10195]
    0xb3915400 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10194]
    0xb49f1800 JavaThread "ActiveMQ Transport: tcp://dai3/128.115.222.163:61616" [_thread_in_native, id=10192]
    0xb4036800 JavaThread "Timer-7" [_thread_blocked, id=10189]
    0xb5225800 JavaThread "Timer-6" [_thread_blocked, id=10188]
    0xb4d23800 JavaThread "SystemThreadGroup-6" [_thread_in_native, id=10187]
    0xb4014800 JavaThread "SystemThreadGroup-5" [_thread_in_native, id=10186]
    0xb49f8400 JavaThread "SystemThreadGroup-4" [_thread_blocked, id=10185]
    0xb4d27c00 JavaThread "Timer-5" [_thread_blocked, id=10184]
    0xb49ff400 JavaThread "Timer-4" [_thread_blocked, id=10183]
    0xb50e2800 JavaThread "Timer-3" [_thread_blocked, id=10182]
    0xb49ea000 JavaThread "Timer-1" daemon [_thread_blocked, id=10180]
    0xb49a4c00 JavaThread "WorkExecutorWorkerThread-1" daemon [_thread_blocked, id=10179]
    0xb499ec00 JavaThread "Thread-8" daemon [_thread_blocked, id=10178]
    0xb496a400 JavaThread "Timer-0" [_thread_blocked, id=10176]
    0xb4d32c00 JavaThread "AWT-XAWT" daemon [_thread_in_native, id=10175]
    0xb501cc00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=10174]
    0xb4941c00 JavaThread "RMIServer [0.0.0.0:23943] count:1" [_thread_in_native, id=10173]
    0xb4b4d800 JavaThread "RMIServer [0.0.0.0:23791] count:1" [_thread_in_native, id=10172]
    0xb501ac00 JavaThread "JMSServer[salsa:9127]" [_thread_in_native, id=10171]
    0x0837d800 JavaThread "WsMgmtWorkScheduler" daemon [_thread_blocked, id=10170]
    0x08360400 JavaThread "WsMgmtWorkScheduler" daemon [_thread_blocked, id=10169]
    0x08324400 JavaThread "Timer ServiceThread" [_thread_blocked, id=10168]
    0x08368c00 JavaThread "Scheduler ServiceThread" [_thread_blocked, id=10167]
    0x0835b000 JavaThread "Event ServiceThread" [_thread_blocked, id=10166]
    0x0830a800 JavaThread "LogFlusher" daemon [_thread_blocked, id=10164]
    0x0830dc00 JavaThread "LogFlusher" daemon [_thread_blocked, id=10163]
    0x0830f400 JavaThread "LogFlusher" daemon [_thread_blocked, id=10162]
    0x0808c800 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=10159]
    0x0808b000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=10158]
    0x08089c00 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=10157]
    0x08081800 JavaThread "Finalizer" daemon [_thread_blocked, id=10156]
    0x08080400 JavaThread "Reference Handler" daemon [_thread_blocked, id=10155]
    Other Threads:
    0x0807f000 VMThread [id=10154]
    0x0808e400 WatcherThread [id=10160]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 3648K, used 1498K [0x442a0000, 0x44690000, 0x49160000)
    eden space 3264K, 34% used [0x442a0000, 0x443b6b80, 0x445d0000)
    from space 384K, 100% used [0x445d0000, 0x44630000, 0x44630000)
    to space 384K, 0% used [0x44630000, 0x44630000, 0x44690000)
    tenured generation total 43488K, used 19246K [0x49160000, 0x4bbd8000, 0x842a0000)
    the space 43488K, 44% used [0x49160000, 0x4a42b9d8, 0x4a42ba00, 0x4bbd8000)
    compacting perm gen total 48640K, used 48465K [0x842a0000, 0x87220000, 0x942a0000)
    the space 48640K, 99% used [0x842a0000, 0x871f4458, 0x871f4600, 0x87220000)
    ro space 8192K, 73% used [0x942a0000, 0x94882560, 0x94882600, 0x94aa0000)
    rw space 12288K, 58% used [0x94aa0000, 0x95197448, 0x95197600, 0x956a0000)
    Dynamic libraries:
    0014e000-00156000 r-xp 00000000 08:01 91357260 /lib/tls/librt-2.3.4.so
    00156000-00157000 r-xp 00007000 08:01 91357260 /lib/tls/librt-2.3.4.so
    00157000-00158000 rwxp 00008000 08:01 91357260 /lib/tls/librt-2.3.4.so
    00158000-00162000 rwxp 00158000 00:00 0
    0028b000-002a1000 r-xp 00000000 08:01 91357186 /lib/ld-2.3.4.so
    002a1000-002a2000 r-xp 00015000 08:01 91357186 /lib/ld-2.3.4.so
    002a2000-002a3000 rwxp 00016000 08:01 91357186 /lib/ld-2.3.4.so
    002a5000-003cb000 r-xp 00000000 08:01 91357199 /lib/tls/libc-2.3.4.so
    003cb000-003cd000 r-xp 00125000 08:01 91357199 /lib/tls/libc-2.3.4.so
    003cd000-003cf000 rwxp 00127000 08:01 91357199 /lib/tls/libc-2.3.4.so
    003cf000-003d1000 rwxp 003cf000 00:00 0
    003d3000-003f4000 r-xp 00000000 08:01 91357212 /lib/tls/libm-2.3.4.so
    003f4000-003f5000 r-xp 00020000 08:01 91357212 /lib/tls/libm-2.3.4.so
    003f5000-003f6000 rwxp 00021000 08:01 91357212 /lib/tls/libm-2.3.4.so
    003f8000-003fa000 r-xp 00000000 08:01 91357214 /lib/libdl-2.3.4.so
    003fa000-003fb000 r-xp 00001000 08:01 91357214 /lib/libdl-2.3.4.so
    003fb000-003fc000 rwxp 00002000 08:01 91357214 /lib/libdl-2.3.4.so
    00501000-0050f000 r-xp 00000000 08:01 91357218 /lib/tls/libpthread-2.3.4.so
    0050f000-00510000 r-xp 0000d000 08:01 91357218 /lib/tls/libpthread-2.3.4.so
    00510000-00511000 rwxp 0000e000 08:01 91357218 /lib/tls/libpthread-2.3.4.so
    00511000-00513000 rwxp 00511000 00:00 0
    00623000-00632000 r-xp 00000000 08:01 91357234 /lib/libresolv-2.3.4.so
    00632000-00633000 r-xp 0000f000 08:01 91357234 /lib/libresolv-2.3.4.so
    00633000-00634000 rwxp 00010000 08:01 91357234 /lib/libresolv-2.3.4.so
    00634000-00636000 rwxp 00634000 00:00 0
    00820000-00827000 r-xp 00000000 08:01 68757852 /usr/X11R6/lib/libXi.so.6.0
    00827000-00828000 rwxp 00006000 08:01 68757852 /usr/X11R6/lib/libXi.so.6.0
    0083b000-00848000 r-xp 00000000 08:01 68759646 /usr/X11R6/lib/libXext.so.6.4
    00848000-00849000 rwxp 0000c000 08:01 68759646 /usr/X11R6/lib/libXext.so.6.4
    00870000-00877000 r-xp 00000000 08:01 68763552 /usr/X11R6/lib/libXrender.so.1.2.2
    00877000-00878000 rwxp 00006000 08:01 68763552 /usr/X11R6/lib/libXrender.so.1.2.2
    008b6000-008be000 r-xp 00000000 08:01 68763554 /usr/X11R6/lib/libXcursor.so.1.0.2
    008be000-008bf000 rwxp 00007000 08:01 68763554 /usr/X11R6/lib/libXcursor.so.1.0.2
    008e3000-009be000 r-xp 00000000 08:01 68758178 /usr/X11R6/lib/libX11.so.6.2
    009be000-009c2000 rwxp 000db000 08:01 68758178 /usr/X11R6/lib/libX11.so.6.2
    00b0a000-00b0e000 r-xp 00000000 08:01 68756642 /usr/X11R6/lib/libXtst.so.6.1
    00b0e000-00b0f000 rwxp 00003000 08:01 68756642 /usr/X11R6/lib/libXtst.so.6.1
    00c3e000-00c50000 r-xp 00000000 08:01 91357258 /lib/libnsl-2.3.4.so
    00c50000-00c51000 r-xp 00011000 08:01 91357258 /lib/libnsl-2.3.4.so
    00c51000-00c52000 rwxp 00012000 08:01 91357258 /lib/libnsl-2.3.4.so
    00c52000-00c54000 rwxp 00c52000 00:00 0
    06000000-06417000 r-xp 00000000 08:01 98304002 /u01/app/java/jdk1.6.0_03/jre/lib/i386/client/libjvm.so
    06417000-06430000 rwxp 00417000 08:01 98304002 /u01/app/java/jdk1.6.0_03/jre/lib/i386/client/libjvm.so
    06430000-0684f000 rwxp 06430000 00:00 0
    08048000-08052000 r-xp 00000000 08:01 98320386 /u01/app/java/jdk1.6.0_03/bin/java
    08052000-08053000 rwxp 00009000 08:01 98320386 /u01/app/java/jdk1.6.0_03/bin/java
    08053000-0877f000 rwxp 08053000 00:00 0
    442a0000-44690000 rwxp 442a0000 00:00 0
    44690000-49160000 rwxp 44690000 00:00 0
    49160000-4bbd8000 rwxp 49160000 00:00 0
    4bbd8000-842a0000 rwxp 4bbd8000 00:00 0
    842a0000-87220000 rwxp 842a0000 00:00 0
    87220000-942a0000 rwxp 87220000 00:00 0
    942a0000-94883000 r-xs 00001000 08:01 98304677 /u01/app/java/jdk1.6.0_03/jre/lib/i386/client/classes.jsa
    94883000-94aa0000 rwxp 94883000 00:00 0
    94aa0000-95198000 rwxp 005e4000 08:01 98304677 /u01/app/java/jdk1.6.0_03/jre/lib/i386/client/classes.jsa
    95198000-956a0000 rwxp 95198000 00:00 0
    956a0000-95779000 rwxp 00cdc000 08:01 98304677 /u01/app/java/jdk1.6.0_03/jre/lib/i386/client/classes.jsa
    95779000-95aa0000 rwxp 95779000 00:00 0
    95aa0000-95aa4000 r-xs 00db5000 08:01 98304677 /u01/app/java/jdk1.6.0_03/jre/lib/i386/client/classes.jsa
    95aa4000-95ea0000 rwxp 95aa4000 00:00 0
    b0b49000-b0b5e000 r-xp 00000000 08:01 98287757 /u01/app/java/jdk1.6.0_03/jre/lib/i386/libdcpr.so
    b0b5e000-b0b71000 rwxp 00014000 08:01 98287757 /u01/app/java/jdk1.6.0_03/jre/lib/i386/libdcpr.so
    b0f00000-b0f50000 rwxp b0f00000 00:00 0
    b0f50000-b1000000 ---p b0f50000 00:00 0
    b1100000-b11fd000 rwxp b1100000 00:00 0
    b11fd000-b1200000 ---p b11fd000 00:00 0
    b1226000-b122b000 r-xs 0002f000 08:01 98533404 /u01/app/oc4j/oc4j-10.1.3.3.0/j2ee/home/applications/dai-core/dai-core-pre1.1/WEB-INF/lib/dai-core-pre1.1.jar
    b122b000-b122d000 r-xs 0001a000 08:01 98533399 /u01/app/oc4j/oc4j-10.1.3.3.0/j2ee/home/applications/dai-core/dai-core-pre1.1/WEB-INF/lib/commons-modeler-2.0.1.jar
    b122d000-b122f000 r-xs 0000a000 08:01 98533396 /u01/app/oc4j/oc4j-10.1.3.3.0/j2ee/home/applications/dai-core/dai-core-pre1.1/WEB-INF/lib/commons-codec-1.3.jar
    b122f000-b1233000 r-xs 00031000 08:01 98533394 /u01/app/oc4j/oc4j-10.1.3.3.0/j2ee/home/applications/dai-core/dai-core-pre1.1/WEB-INF/lib/ciacCommmon-1.1.jar
    b1233000-b1234000 r-xs 00000000 08:01 98533393 /u01/app/oc4j/oc4j-10.1.3.3.0/j2ee/home/applications/dai-core/dai-core-pre1.1/WEB-INF/lib/ciac-bloomdex.jar
    b1234000-b1236000 r-xs 00001000 08:01 98533414 /u01/app/oc4j/oc4j-10.1.3.3.0/j2ee/home/applications/dai-core/dai-core-pre1.1/WEB-INF/lib/slf4j-api-1.1.0.jar
    b1236000-b1241000 r-xs 00073000 08:01 98533409 /u01/app/oc4j/oc4j-10.1.3.3.0/j2ee/home/applications/dai-core/dai-core-pre1.1/WEB-INF/lib/jsp-api-2.1.jar
    b1241000-b1242000 r-xs 00001000 08:01 98533415 /u01/app/oc4j/oc4j-10.1.3.3.0/j2ee/home/applications/dai-core/dai-core-pre1.1/WEB-INF/lib/slf4j-log4j12-1.1.0.jar
    b1242000-b1249000 r-xs 00053000 08:01 98533410 /u01/app/oc4j/oc4j-10.1.3.3.0/j2ee/home/applications/dai-core/dai-core-pre1.1/WEB-INF/lib/log4j-1.2.14.jar
    b1249000-b124e000 r-xs 00040000 08:01 98533397 /u01/app/oc4j/oc4j-10.1.3.3.0/j2ee/home/applications/dai-core/dai-core-pre1.1/WEB-INF/lib/commons-httpclient-3.0.1.jar
    b124e000-b1265000 r-xs 00112000 08:01 98533418 /u01/app/oc4j/oc4j-10.1.3.3.0/j2ee/home/applications/dai-core/dai-core-pre1.1/WEB-INF/lib/xercesImpl-2.8.1.jar
    b1265000-b1268000 rwxp b1265000 00:00 0
    b1268000-b12b6000 rwxp b1268000 00:00 0
    b12b6000-b12b9000 rwxp b12b6000 00:00 0
    b12b9000-b1307000 rwxp b12b9000 00:00 0
    b1307000-b130a000 ---p b1307000 00:00 0
    b130a000-b1358000 rwxp b130a000 00:00 0
    b1358000-b135b000 rwxp b1358000 00:00 0
    b135b000-b13a9000 rwxp b135b000 00:00 0
    b13a9000-b13ac000 rwxp b13a9000 00:00 0
    b13ac000-b13fa000 rwxp b13ac000 00:00 0
    b13fa000-b13fd000 rwxp b13fa000 00:00 0
    b13fd000-b144b000 rwxp b13fd000 00:00 0
    b144b000-b144e000 rwxp b144b000 00:00 0
    b144e000-b149c000 rwxp b144e000 00:00 0
    b149c000-b149f000 rwxp b149c000 00:00 0
    b149f000-b14ed000 rwxp b149f000 00:00 0
    b14ed000-b14f0000 ---p b14ed000 00:00 0
    b14f0000-b153e000 rwxp b14f0000 00:00 0
    b153e000-b1541000 ---p b153e000 00:00 0
    b1541000-b158f000 rwxp b1541000 00:00 0
    b158f000-b1592000 ---p b158f000 00:00 0
    b1592000-b15e0000 rwxp b1592000 00:00 0
    b15e0000-b15e3000 rwxp b15e0000 00:00 0
    b15e3000-b1631000 rwxp b15e3000 00:00 0
    b1631000-b1634000 ---p b1631000 00:00 0
    b1634000-b1682000 rwxp b1634000 00:00 0
    b1682000-b1685000 rwxp b1682000 00:00 0
    b1685000-b16d3000 rwxp b1685000 00:00 0
    b16d3000-b16d6000 ---p b16d3000 00:00 0
    b16d6000-b1724000 rwxp b16d6000 00:00 0
    b1724000-b1727000 rwxp b1724000 00:00 0
    b1727000-b1775000 rwxp b1727000 00:00 0
    b1775000-b1778000 ---p b1775000 00:00 0
    b1778000-b17c6000 rwxp b1778000 00:00 0
    b17c6000-b17c9000 ---p b17c6000 00:00 0
    b17c9000-b1817000 rwxp b17c9000 00:00 0
    b1817000-b181a000 rwxp b1817000 00:00 0
    b181a000-b1868000 rwxp b181a000 00:00 0
    b1868000-b186b000 rwxp b1868000 00:00 0
    b186b000-b18b9000 rwxp b186b000 00:00 0
    b18b9000-b18bc000 ---p b18b9000 00:00 0
    b18bc000-b190a000 rwxp b18bc000 00:00 0
    b190a000-b190d000 ---p b190a000 00:00 0
    b190d000-b195b000 rwxp b190d000 00:00 0
    b195b000-b195e000 rwxp b195b000 00:00 0
    b195e000-b19ac000 rwxp b195e000 00:00 0
    b19ac000-b19af000 rwxp b19ac000 00:00 0
    b19af000-b19fd000 rwxp b19af000 00:00 0
    b19fd000-b1a00000 ---p b19fd000 00:00 0
    b1a00000-b1a4e000 rwxp b1a00000 00:00 0
    b1a4e000-b1a51000 rwxp b1a4e000 00:00 0
    b1a51000-b1a9f000 rwxp b1a51000 00:00 0
    b1a9f000-b1aa2000 ---p b1a9f000 00:00 0
    b1aa2000-b1af0000 rwxp b1aa2000 00:00 0
    b1af0000-b1af3000 rwxp b1af0000 00:00 0
    b1af3000-b1b41000 rwxp b1af3000 00:00 0
    b1b41000-b1b44000 ---p b1b41000 00:00 0
    b1b44000-b1b92000 rwxp b1b44000 00:00 0
    b1b92000-b1b95000 rwxp b1b92000 00:00 0
    b1b95000-b1be3000 rwxp b1b95000 00:00 0
    b1be3000-b1be6000 ---p b1be3000 00:00 0
    b1be6000-b1c34000 rwxp b1be6000 00:00 0
    b1c34000-b1c37000 rwxp b1c34000 00:00 0
    b1c37000-b1c85000 rwxp b1c37000 00:00 0
    b1c85000-b1c88000 ---p b1c85000 00:00 0
    b1c88000-b1cd6000 rwxp b1c88000 00:00 0
    b1cd6000-b1cd9000 ---p b1cd6000 00:00 0
    b1cd9000-b1d27000 rwxp b1cd9000 00:00 0
    b1d27000-b1d2a000 rwxp b1d27000 00:00 0
    b1d2a000-b1d78000 rwxp b1d2a000 00:00 0
    b1d78000-b1d7b000 rwxp b1d78000 00:00 0
    b1d7b000-b1dc9000 rwxp b1d7b000 00:00 0
    b1dc9000-b1dcc000 ---p b1dc9000 00:00 0
    b1dcc000-b1e1a000 rwxp b1dcc000 00:00 0
    b1e1a000-b1e1d000 ---p b1e1a000 00:00 0
    b1e1d000-b1e6b000 rwxp b1e1d000 00:00 0
    b1e6b000-b1e6e000 rwxp b1e6b000 00:00 0
    b1e6e000-b1ebc000 rwxp b1e6e000 00:00 0
    b1ebc000-b1ebf000 ---p b1ebc000 00:00 0
    b1ebf000-b1f0d000 rwxp b1ebf000 00:00 0
    b1f0d000-b1f10000 rwxp b1f0d000 00:00 0
    b1f10000-b1f5e000 rwxp b1f10000 00:00 0
    b1f5e000-b1f61000 rwxp b1f5e000 00:00 0
    b1f61000-b1faf000 rwxp b1f61000 00:00 0
    b1faf000-b1fb2000 ---p b1faf000 00:00 0
    b1fb2000-b2022000 rwxp b1fb2000 00:00 0
    b2022000-b2100000 ---p b2022000 00:00 0
    b2111000-b2114000 ---p b2111000 00:00 0
    b2114000-b2162000 rwxp b2114000 00:00 0
    b2162000-b2165000 ---p b2162000 00:00 0
    b2165000-b21b3000 rwxp b2165000 00:00 0
    b21b3000-b21b6000 ---p b21b3000 00:00 0
    b21b6000-b2204000 rwxp b21b6000 00:00 0
    b2204000-b2207000 rwxp b2204000 00:00 0
    b2207000-b2255000 rwxp b2207000 00:00 0
    b2255000-b2258000 ---p b2255000 00:00 0
    b2258000-b22a6000 rwxp b2258000 00:00 0
    b22a6000-b22a9000 rwxp b22a6000 00:00 0
    b22a9000-b22f7000 rwxp b22a9000 00:00 0
    b22f7000-b22fa000 ---p b22f7000 00:00 0
    b22fa000-b2348000 rwxp b22fa000 00:00 0
    b2348000-b234b000 ---p b2348000 00:00 0
    b234b000-b2399000 rwxp b234b000 00:00 0
    b2399000-b239c000 ---p b2399000 00:00 0
    b239c000-b23ea000 rwxp b239c000 00:00 0
    b23ea000-b23ed000 rwxp b23ea000 00:00 0
    b23ed000-b243b000 rwxp b23ed000 00:00 0
    b243b000-b243e000 ---p b243b000 00:00 0
    b243e000-b248c000 rwxp b243e000 00:00 0
    b248c000-b248f000 ---p b248c000 00:00 0
    b248f000-b24dd000 rwxp b248f000 00:00 0
    b24dd000-b24e0000 ---p b24dd000 00:00 0
    b24e0000-b252e000 rwxp b24e0000 00:00 0
    b252e000-b2531000 ---p b252e000 00:00 0
    b2531000-b257f000 rwxp b2531000 00:00 0
    b257f000-b2582000 ---p b257f000 00:00 0
    b2582000-b25d0000 rwxp b2582000 00:00 0
    b25d0000-b25d3000 ---p b25d0000 00:00 0
    b25d3000-b2621000 rwxp b25d3000 00:00 0
    b2621000-b2624000 ---p b2621000 00:00 0
    b2624000-b2672000 rwxp b2624000 00:00 0
    b2672000-b2675000 ---p b2672000 00:00 0
    b2675000-b26c3000 rwxp b2675000 00:00 0
    b26c3000-b26c6000 rwxp b26c3000 00:00 0
    b26c6000-b2714000 rwxp b26c6000 00:00 0
    b2714000-b2717000 ---p b2714000 00:00 0
    b2717000-b2765000 rwxp b2717000 00:00 0
    b2765000-b2768000 ---p b2765000 00:00 0
    b2768000-b27b6000 rwxp b2768000 00:00 0
    b27b6000-b27b9000 ---p b27b6000 00:00 0
    b27b9000-b2807000 rwxp b27b9000 00:00 0
    b2807000-b280a000 ---p b2807000 00:00 0
    b280a000-b2858000 rwxp b280a000 00:00 0
    b2858000-b285b000 ---p b2858000 00:00 0
    b285b000-b28a9000 rwxp b285b000 00:00 0
    b28a9000-b28ac000 ---p b28a9000 00:00 0
    b28ac000-b28fa000 rwxp b28ac000 00:00 0
    b28fa000-b28fd000 ---p b28fa000 00:00 0
    b28fd000-b294b000 rwxp b28fd000 00:00 0
    b294b000-b294e000 ---p b294b000 00:00 0
    b294e000-b299c000 rwxp b294e000 00:00 0
    b299c000-b299f000 ---p b299c000 00:00 0
    b299f000-b29ed000 r

    I found ConcurrentReaderHashMap in one of the jar files included with oc4j, j2ee/home/lib/concurrent.jar. So, it looks like it comes from one of the jars for Oracle's oc4j implementation. This is an error that occurs intermittently when stopping oc4j or when reinstalling an application. So, it looks like it is an error that I should report to Oracle. Correct? Or is there something in my code that is likely causing this error? I am running this under the 1.6.0_03 JVM. Is there an incompatibility in the oswego package with 1.6?

  • InDesign data merge isn't pulling in all fields, seems to be confusing some fields

    Hi there - I'm trying to do a data merge in CS6 for about 450 address labels. The labels are 10-up so I made a .csv file with 10 equal sets of colums (named Firstname1, Firstname2, Firstname3, etc.) and merged those into my label document. I've done this before plenty of times with no problem, but for some reason this time the merge seems to be getting thrown off by something. I can see multiple places in which the merge will stop after a certain field - usually the address - then there will be a bunch of blank labels, then on the next page the address from the last label will start up again. I've attached a screen shot of what it looks like when the address breaks like this. In the top image, Troy Christian's merge breaks after the street again. Then a few blank labels follow, then Troy's city, state, and zip appear at the beginning of the next page. Then it continues on with the next address block (inserting commas along the way for some reason), then it breaks again.
    I've scoured both the merge fields and the Excel file - nothing seems out of the ordinary - resaved the Excel over and over as both .csv's and .txt's, and can't get it to fix. Any ideas here?? Please let me know if there's any further info I can provide.
    Thank you!

    We didn't end up even looking at it in a text editor, although that probably would have been easier - we just saw where the errors were occurring in the merge and looked carefully at those cells in the .csv file, and then deleted line breaks, commas, and weird characters. Worked like a dream.
    Thank you so much for your help on this!
    e

  • Java.util.concurrent.ExecutorService inside J2EE Container

    I want to use the JDK 1.5 concurrency class ExecutorService for concurrent execution of data-access logic inside my oc4j web-application.
    I'm using the Factory Executors.newFixedThreadPool(6) for creating a thread-pool.
    I know that it's not a good practice to create new threads inside a j2ee container.
    Is there anything I have to think of or beware of??
    Perhaps anybody here has experience using the java.util.concurrent.Executor inside OC4J or an other j2ee container.
    Thanks, Harald

    Yes, I have used java.util.concurrent.Executor in weblogic 10 server.
    You can really improve the performance of the EJB application if you use the thread pool carefully with limited size say 100 threads, by creating a single instance of thread pool for the whole J2EE application.
    You have to control the life cycle of thread pool using the container's life cycle methods, create the thread pool only once and destroy every time you recycle your app.
    Good luck with the implementation :)

  • Java.util.concurrent.ExecutorService inside OC4J

    I want to use the JDK 1.5 concurrency class ExecutorService for concurrent execution of data-access logic inside my oc4j web-application. I'm using the Factory Executors.newFixedThreadPool(6) for creating a thread-pool.
    I know that it's not a good practice to create new threads inside a j2ee container.
    Is there anything I have to think of or beware of??
    Perhaps anybody here has experience using the java.util.concurrent.Executor inside OC4J.
    Thanks, Harald

    Yes, I have used java.util.concurrent.Executor in weblogic 10 server.
    You can really improve the performance of the EJB application if you use the thread pool carefully with limited size say 100 threads, by creating a single instance of thread pool for the whole J2EE application.
    You have to control the life cycle of thread pool using the container's life cycle methods, create the thread pool only once and destroy every time you recycle your app.
    Good luck with the implementation :)

  • Unchecked Exception using 1.5 Concurrent Libraries

    Sorry to post this here, but it IS related to generics. I'm either doing something wrong, or the concurrent libraries are missing some methods in the ThreadPoolExecutor class.
    I'll try and be brief. When I compile my multi-threaded application with lint on, I get the following error:
    "TransactionsByStore.java:309: warning: [unchecked] unchecked conversion
    found : java.util.concurrent.LinkedBlockingQueue
    required: java.util.concurrent.BlockingQueue<java.lang.Runnable>
    threadPool = new ThreadPoolExecutor(threadCount, threadCount, threadTimeout, TimeUnit.SECONDS, threadQueue);"
    The problem is my "threadQueue" class. It is of type LinkedBlockingQueue<java.util.concurrent.Callable> since Callable allows the class to return something from the "call" method. It appears that most classes in the concurrent libraries prefers Callable classes over Runnable, but the constructor for a ThreadPoolExecutor appears to only accept a thread queue that holds Runnables. That doesn't seem correct.
    Does anyone know if there is something that I am doing wrong here, or is this just a current limitation of the ThreadPoolExecutor class?
    Thanks.

    The problem is my "threadQueue" class. It is of type
    LinkedBlockingQueue<java.util.concurrent.Callable>
    since Callable allows the class to return something
    from the "call" method. It appears that most classes
    in the concurrent libraries prefers Callable classes
    over Runnable, but the constructor for a
    ThreadPoolExecutor appears to only accept a thread
    queue that holds Runnables. That doesn't seem
    correct.
    Does anyone know if there is something that I am
    doing wrong here, or is this just a current
    limitation of the ThreadPoolExecutor class?OK, so I just did some reading and I now better understand the context of your question:
    * ThreadPoolExecutor is an ExecutorService, not just an Executor, so it handles Callables in addition to Runnables
    * You're taking the slightly unusual step of constructing your own instance, presumably because you've determined none of the predefined ExecutorServices that the Executors factory class creates are suitable for your task?
    * As you wish to use the ThreadPoolExecutor to execute Callables, you want to know why the constructor takes BlockingQueue<Runnable> rather than BlockingQueue<Callable>
    So firstly, this question really has nothing to do with generics. Callable isn't a Runnable and as such there's no way you're ever going to be able to pass a BlockingQueue<Callable> into this method. Therefore it's a question about the design of the concurrency libraries. As such you'll probably get much better quality answers in a forum dedicated to that subject.
    Having said that:
    From what I see the ExecutorService.submit() methods that support Callables are all implemented in the AbstractExecutorService class that is the superclass for ThreadPoolExecutor.
    So I read the source code for that class. Turns out every Callable passed to submit() is wrapped in a FutureTask, which is a class that imlements Future<V> and Runnable. This makes perfect sense if you think about it - given that this ExecutorService executes things asynchronously, clearly a Future<V> is required if you want to be able to actually get at the result.
    Thus since Callables are wrapped in a class that's Runnable inside the ExecutorService, that's how it is able to handle Callables using a BlockingQueue<Runnable>.
    So... is it important to you that the queue you pass in is a BlockingQueue<Callable> or can you simply make it a BlockingQueue<Runnable>?
    You're never going to be able to constrain the type of the BlockingQueue to be anything stricter than Runnable, BTW. This is because the ThreadPoolExecutor executes Runnables as well as Callables, so if you were allowed to pass in a BlockingQueue<FutureResult> (for example) then it wouldn't work because the execute(Runnable) method wouldn't be able to add the Runnable to the queue without wrapping it in a spurious FutureResult.

  • Merging Projects / Activity Renumbering

    I am using P6. In P3 there was an easy way to merge
    projects and renumber activities. How do you merge in P6.?
    Any ideas for renumbering activities?

    Hallo Tony,
    to develop large-scale Web Dynpro applications in team you can utilize the SAP NetWeaver Development Infrastrucutre. In this case Web Dynpro projects are represented as Web Dynpro Development Components. The great advantage of this approach is based on the fact, that you can design component-based Web Dynpro applications with a clear separation of concerns. Within one single Web Dynpro component (not Development Component) only one single developer should work so that no merging of concurrent versions have to be done.
    Have a look at this SAP NetWeaver Online Help Document on <a href="http://help.sap.com/saphelp_nw04/helpdata/en/ae/1ae58540ea454db1aa14fd635bc10d/frameset.htm">Development in a Team</a>.
    I'm currently working on new documents and resources describing the component-based Web Dynpro application design. They will be published soon on SDN ... here they are: <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/bd0e0401-0801-0010-aaab-d0e">Learn How to Design Component Based Web Dynpro Applications</a>
    Regards, Bertram
    Message was edited by: Bertram Ganz
    Added link to sample description page on "Designing Component-based Web Dynpro Applications (38)"

  • Help needed regarding Scanner class

    hello
    i'm really desperate for help, i'll mention that this is homework,but i need a small guidance.
    i need to code a calculator,we need to use the Scanner class to break the expression to tokens(we CANNOT use other classes).
    my main problem is about getting those tokens from the input string.
    i tried breaking a string to tokens for hours but just couldnt do it.
    a legal expression is something like:
    xyzavbx1111+log(abc11*(2+5))+sin(4.5)
    iilegal is : xx333aaaa111+2 or log()+2
    where the alphanumerics are variables(sequence of letters followed by numbers)
    i managed to get the tokens out of a string that looks like that:
    String expression = "ax11111+32/3+4*2^2"
    by doing:
    _token = new Scanner(expression);
    while(hasNext(_token)) getNextToken(_token,"\\d+(\\.\\d+)?|(\\+)|(\\-)|(\\*)|(\\/)|(\\^)|([a-zA-Z]+(\\d+));
    public static boolean hasNext(Scanner s) {
    return s.hasNext();
    public static String getNextToken(Scanner s,String str) {
    return s.findInLine(str);
    but i can't get the tokens when i have sin ,cos or log in the expression
    either it just ignores it or i'm looping infinitely.
    my question is how can i make the regular expression include the sin log and cos?
    I also know that when i'll use the "matches" method ,i'll be able to spot illegal arguments like 5//2+ because it doesnt match the pattern.
    so any help conecrning the regular expression would be great thanks alot.

    thx , but i already got it,after trying tons of combinations
    i'll post the format i used in case someone will find this thread in the future ,while looking for something similar
    the format is:
    "(\\s)|(log)|(sin)|(cos)|(\\d+(\\.\\d+)?)|(\\+)"+
    "|(\\-)|(\\*)|(\\/)|(\\^)|([a-zA-Z]+(\\d+))|(\\()|(\\))|(\\s)";
    which includes white spaces between arguments and operators

  • Understanding class "fingerprints" with SWC files

    I'm sorry for a very poorly structured question. I just run out of English... I hope one of you guess what's the problem and can provide better words to describe it!
    I'm having hard time understanding how classes from SWC files are handled when the app is complied with Flash Builder. We have about 50 SWC files, all compiled from corresponding FLA files. Their libraries contain elements that have AS3 linkages and in the end, there are plenty of classes involved. The classes are packaged in SWC files and Flash Builder finds them just fine. Some AS3 linkages have the same name, which is OK, because they are essentially the same library elements and we don't want to have duplicates in the app. Also plenty of AS3 linkages have same base classes, which means plenty of SWC files carry those base class definitions too, but only one is really needed.
    Sometimes everything works, sometimes something breaks. It almost seems like the moon phase affects whether the end result works or not... Sometimes recompiling SWC files helps with one problem, but breaks something else. This leads me to guess, that Flash Builder selects the available classes based on the date of the SWC files? If more than one SWC files have the same class definition, Flash Builder selects the newest?
    The error we encounter, is "AS3 Error #1034: Type Coercion failed:", which is related to having one of these shared AS3 linkages (let's say SharedClass) on the timeline of a MovieClip. This means it is *not* created with the new keyword! So if SharedClass is defined in SWC1 and SWC2, maybe Flash Builder decides to use the one from SWC1. This means that elements from SWC2 that use SharedClass will use SWC1's definition of it. But for some reason this doesn't always work as it should. It helped, when I changed how AS3 references the instances declared on the timeline: "var mySharedClassObject:SharedClass" --> "var mySharedClassObject:*" but I don't understand why...
    This leads me to believe, that the SharedClass in SWC1 and SWC2 have different "fingerprints" which makes the class casting break in some situations. When I use "new" keyword, everything works, because it doesn't matter which definition will be used. But when the class is created on the timeline, it may require exact fingerprint of that class?
    Most of those cases are easily cleaned, but I'm also running into problems with some classes that have only one definition! If the AS3 linkage of SWC1 has the same base class, than AS3 linkage of SWC2, we run into the same problem. This is because both SWC1 and SWC2 contain the definition of the base class and maybe they have different fingerprints, even though our base classes are just AS3 files (no linkages).
    Does this make any sense?
    Anyone know a way to see the class name collisions and potential problems?

    If different SWC are using exactly the same class, there’s no problem. If more than one is using the same named class, and the two or more copies are different, they it’s down to the order they get compiled, and that can vary.
    Make sure that everywhere that a class has the same name, it’s identical to the other ones. Remember that MovieClips become classes too, so if you have a shared library item named “title”, and it’s different for each SWC because the graphic instead the MovieClip is different, then you’ll get big problems.
    One easy solution is to put the classes into a dedicated folder, like:
    src/com/yourname/game1/Title.as
    and:
    src/com/yourname/game2/Title.as
    instead of:
    src/com/yourname/games/Title.as
    You will end up with a lot of identical things in memory, but they have a different path, and won’t clash with each other.
    Another thing to know, if you use GetDefinitionByName(“class1”), the main document class needs to know about those classes. This will solve that problem:
    public var namedClasses:Array = [class1,class2,class3];
    Then when the compiler is doing its thing, it doesn’t go into shock when an embedded SWC is creating an instance of a class from the shared name.
    So, make sure things are truly identical, or make sure they have a different path.

  • Can you invoke a protected method in a different class

    I want to tell my method that if a certain event occurs, to invoke a method thats located in a different class but in the same package. But neither inherit each other.
    I also want the original method to pass parameters to the remote method so it can perform actions on them.
    Is this possible somehow, or am I barking up the wrong tree?
    I've included an example to illustate.
    edu.example;
    public class one extends bank{
    protected void count (){
    If i>100{
    spend(5); // method thats in the two class
    else break;
    edu.example;
    public class two extends bank{
    protected void spend (int x){
    i = i - x;

    Yes, protected will work in this case. A protected method is available to all classes in the same package, just like default access.

  • Can i invoke a method of a different class?

    I want to tell my method that if a certain event occurs, to invoke a method thats located in a different class but in the same package. But neither inherit each other.
    I also want the original method to pass parameters to the remote method so it can perform actions on them.
    Is this possible somehow, or am I barking up the wrong tree?
    I've included an example to illustate.
    edu.example;
    public class one extends bank{
    protected void count (){
    If i>100{
    spend(5); // method thats in the two class
    else break;
    edu.example;
    public class two extends bank{
    protected void spend (int x){
    i = i - x;

    either the method you want to invoke will have to be static, or you will need an instance of the class that contains the method you want to invoke.
    If your not in school, its probably best you buy a Java book. It will speed things along considerably.
    I have always bought books by Ivor Horton. "Beginning Java" is a good one. Wrox publisher I think. Once you pass that book you will not need any other books unless you go deep into a particular subject such as encryption.

  • Merge Audio And Video [Help]

    Dear, Guys ...
    I need some help..... my problems, when i m trying merge the video and audio, just the audio can show out......
    this is the code :
    private boolean mergeAudioVideo() {
         try {
    String tempTotal = myGrabber.tempFile + myGrabber.cntMovies + myGrabber.extension;
    String audioFile = "";
    System.out.println(myGrabber.movPath + tempTotal);
    audioFile = mySampler.audioFile.toURL().toString();
    String mergeArguments[] = {"-o", myGrabber.movFile,     myGrabber.movPath + tempTotal, audioFile};
    if (!myProgressBar.cancelled) {
    new Merge(mergeArguments, myProgressBar);
    return true;
    } else {
    return false;
         } catch (Exception e) {
    outWindow.out("Gagal menggabungkan file - file");
    outWindow.out("" + e);
    } catch (OutOfMemoryError o) {
    outWindow.out("Gagal menggabungkan file - file");
    outWindow.out("" + o);
    return true;
    merge.java
    package camcap.Recording;
    * @author Shinlei
    import java.io.File;
    import javax.media.*;
    import javax.media.format.*;
    import javax.media.protocol.*;
    import javax.media.protocol.DataSource;
    import javax.media.datasink.*;
    import java.util.Vector;
    * Menggabungkan jalur - jalur dari input yang berbeda dan menghasilkan sebuah file QuickTime
    * dengan jalur - jalur yang sudah digabung
    public class Merge implements ControllerListener, DataSinkListener {
    Vector sourcesURLs = new Vector(1);
    Processor [] processors = null;
    String outputFile = null;
    String videoEncoding = "JPEG";
    String audioEncoding = "LINEAR";
    String outputType = FileTypeDescriptor.QUICKTIME;
    DataSource [] dataOutputs = null;
    DataSource merger = null;
    DataSource outputDataSource;
    Processor outputProcessor;
    ProcessorModel outputPM;
    DataSink outputDataSink;
    MediaLocator outputLocator;
    boolean done = false;
    VideoFormat videoFormat = null;
    AudioFormat audioFormat = null;
    public camcap.UserInterface.EncodingProgressBar myProgressBar;
    public Merge(String [] args) {
         parseArgs(args);
         if (sourcesURLs.size() < 2) {
         System.err.println("Need at least two source URLs");
         showUsage();
         } else {
         doMerge();
    public Merge(String [] args, camcap.UserInterface.EncodingProgressBar p) {
    myProgressBar = p;
         parseArgs(args);
         if (sourcesURLs.size() < 2) {
         System.err.println("Need at least two source URLs");
         showUsage();
         } else {
         doMerge();
    private void doMerge() {
         int i = 0;
         processors = new Processor[sourcesURLs.size()];
         dataOutputs = new DataSource[sourcesURLs.size()];
         for (i = 0; i < sourcesURLs.size(); i++) {
         String source = (String) sourcesURLs.elementAt(i);
         MediaLocator ml = new MediaLocator(source);
         ProcessorModel pm = new MyPM(ml);
         try {
              processors[i] = Manager.createRealizedProcessor(pm);
              dataOutputs[i] = processors.getDataOutput();
              processors[i].start();
         } catch (Exception e) {
              System.err.println("Failed to create a processor: " + e);
              System.exit(-1);
         try {
         merger = Manager.createMergingDataSource(dataOutputs);
         merger.connect();
         merger.start();
         } catch (Exception ex) {
         System.err.println("Failed to merge data sources: " + ex);
         System.exit(-1);
         if (merger == null) {
         System.err.println("Failed to merge data sources");
         System.exit(-1);
         try {
         Player p = Manager.createPlayer(merger);
         new com.sun.media.ui.PlayerWindow(p);
         } catch (Exception e) {
         System.err.println("Failed to create player " + e);
         // Membuat output dari processor
         ProcessorModel outputPM = new MyPMOut(merger);
         try {
         outputProcessor = Manager.createRealizedProcessor(outputPM);
         outputDataSource = outputProcessor.getDataOutput();
         } catch (Exception exc) {
         System.err.println("Failed to create output processor: " + exc);
         System.exit(-1);
         try {
         outputLocator = new MediaLocator(outputFile);
         outputDataSink = Manager.createDataSink(outputDataSource, outputLocator);
         outputDataSink.open();
         } catch (Exception exce) {
         System.err.println("Failed to create output DataSink: " + exce);
         System.exit(-1);
         outputProcessor.addControllerListener(this);
         outputDataSink.addDataSinkListener(this);
         System.err.println("Merging...");
         try {
         outputDataSink.start();
         outputProcessor.start();
         } catch (Exception excep) {
         System.err.println("Failed to start file writing: " + excep);
         System.exit(-1);
         int count = 0;
         while (!done) {
         try {
              Thread.currentThread().sleep(100);
         } catch (InterruptedException ie) {
    try {
    if (myProgressBar.cancelled) {
    try {
    outputDataSink.stop();
    outputProcessor.stop();
    done = true;
    System.out.println("Stopped merge datasink");
    } catch (Exception e) {
    System.out.println("Couldn't stop merge datasink");
    System.out.println(e);
    } catch (Exception e) {}
         if (outputProcessor != null &&
              (int)(outputProcessor.getMediaTime().getSeconds()) > count) {
              System.err.print(".");
              count = (int)(outputProcessor.getMediaTime().getSeconds());
         if (outputDataSink != null) {
         outputDataSink.close();
         synchronized (this) {
         if (outputProcessor != null) {
              outputProcessor.close();
         System.err.println("Done!");
    public void controllerUpdate(ControllerEvent ce) {
         if (ce instanceof EndOfMediaEvent) {
         synchronized (this) {
              outputProcessor.close();
              outputProcessor = null;
    public void dataSinkUpdate(DataSinkEvent dse) {
         if (dse instanceof EndOfStreamEvent) {
         done = true;
         } else if (dse instanceof DataSinkErrorEvent) {
         done = true;
    class MyPM extends ProcessorModel {
         MediaLocator inputLocator;
         public MyPM(MediaLocator inputLocator) {
         this.inputLocator = inputLocator;
         public ContentDescriptor getContentDescriptor() {
         return new ContentDescriptor(ContentDescriptor.RAW);
         public DataSource getInputDataSource() {
         return null;
         public MediaLocator getInputLocator() {
         return inputLocator;
         public Format getOutputTrackFormat(int index) {
         return null;
         public int getTrackCount(int n) {
         return n;
         public boolean isFormatAcceptable(int index, Format format) {
         if (videoFormat == null) {
              videoFormat = new VideoFormat(videoEncoding);
         if (audioFormat == null) {
              audioFormat = new AudioFormat(audioEncoding);
         if (format.matches(videoFormat) || format.matches(audioFormat))
              return true;
         else
              return false;
    class MyPMOut extends ProcessorModel {
         DataSource inputDataSource;
         public MyPMOut(DataSource inputDataSource) {
         this.inputDataSource = inputDataSource;
         public ContentDescriptor getContentDescriptor() {
         return new FileTypeDescriptor(outputType);
         public DataSource getInputDataSource() {
         return inputDataSource;
         public MediaLocator getInputLocator() {
         return null;
         public Format getOutputTrackFormat(int index) {
         return null;
         public int getTrackCount(int n) {
         return n;
         public boolean isFormatAcceptable(int index, Format format) {
         if (videoFormat == null) {
              videoFormat = new VideoFormat(videoEncoding);
         if (audioFormat == null) {
              audioFormat = new AudioFormat(audioEncoding);
         if (format.matches(videoFormat) || format.matches(audioFormat))
              return true;
         else
              return false;
    private void showUsage() {
         System.err.println("Usage: Merge <url1> <url2> [<url3> ... ] [-o <out URL>] [-v <video_encoding>] [-a <audio_encoding>] [-t <content_type>]");
    private void parseArgs(String [] args) {
         int i = 0;
         while (i < args.length) {
         if (args[i].equals("-h")) {
              showUsage();
         } else if (args[i].equals("-o")) {
              i++;
              outputFile = args[i];
         } else if (args[i].equals("-t")) {
              i++;
              outputType = args[i];
         } else if (args[i].equals("-v")) {
              i++;
              videoEncoding = args[i];
         } else if (args[i].equals("-a")) {
              i++;
              audioEncoding = args[i];
         } else {
              sourcesURLs.addElement(args[i]);
         i++;
         if (outputFile == null) {
         outputFile = "file:" + System.getProperty("user.dir") + File.separator + "merged.avi";
    public static void main(String [] args) {
         new Merge(args);
         System.exit(0);
    ii can't find the problems, can anyone help me?
    Thanks,
    Shin

    Even manually I configured & realized the processors for input files.
    My application is getting blocked in following mentioned snippet of code.
    while (!done)
             if (outputProcessor != null
                  && (int) (outputProcessor.getMediaTime().getSeconds()) > count)
              count = (int) (outputProcessor.getMediaTime().getSeconds());
              logger.debug("Merging is in progress...");
         }This is happening when I try merge large video , audio files only. Is this limitation of JMF or any mistake in app.
    Please suggest any idea or link by which I get some solution.

  • Merge array help..

    i made a simple program to merge arrays..it doesnt work for some reason..i post the code..can anyone help me fix it..thanks!
    public class Merging {
      public static void main (String [] args) {
        int [] list = {2, 6, 8, 4, 5, 9, 7, 6, 3, 1, 0};
        int [] list2 = {5, 6, 9, 8, 5, 1, 2, 3, 4, 9, 5, 6};
        int [] list3 = new int[list.length + list2.length];
        for (int i = 0; i < list3.length; i++) {
          list3[i] = list[i] + list2;
    System.out.print(list3[i]);
    Message was edited by:
    antonio_montana

    for (int i = 0; i < list1.length; i++) {
          list3[i] = list1;
    for (int i = 0; i < list2.length; i++) {
    list3[i + list1.length] = list2[i];
    Definately not the cleanest way, but...

  • Highlighting text in TextArea

    How do I highlight selected text in TextArea? (awt)
    For example, I am using the StringTokenizer class to break up the text into words and wish to highlight any mis-spelt words.
    Thanks again,
    Sean

    TextArea inherits the method select() from TextComponent. This allows a single selection within the TextArea by specifying the start and end positions. There isn't a way to have multiple selections in a TextArea.

Maybe you are looking for

  • Windows Server 2012 - Hyper-V - Cluster Sharded Storage - VHDX unexpectedly gets copied to System Volume Information by "System", Virtual Machines stops respondig

    We have a problem with one of our deployments of Windows Server 2012 Hyper-V with a 2 node cluster connected to a iSCSI SAN. Our setup: Hosts - Both run Windows Server 2012 Standard and are clustered. HP ProLiant G7, 24 GB RAM. This is the primary ho

  • File adaptor Debugging?

    HI @, I am using a file adaptor which is reading the file and then archiving it after successfull reading .Now what happened that In my scenarion the file got picked up by adaptor and archived also but there is no trace available in the SXMB_MONI I n

  • Clean OS Install.. help?

    I want to do a clean install of either WinXP or maybe even try out Vista on my S10.  I really don't care about the separate partitions and onekey, and would rather just reformat it into one.  But, I don't have an external optical drive and really don

  • High Availibity solution for office web app server 2013 for Sharepoint 2013

    I have a scenario with the three nodes SP1 , SP2 and DR-SP with server 2012 standard, each running SharePoint 2013 enterprise, All of three nodes are members of single SharePoint farm that spans two data centers.Primary Data Center have two nodes SP1

  • How to display icon in view

    I've already seen some questions on this forum about displaying icons but in ALV Table.I have data in ALV display and user status as icon but when i select a row i need to display all row details in another view but for user status field its not show