True randomization in java

Hi,
I need to split a file of 20290 lines into two files randomly ; each random split has to produce two subfiles, one representing 80%, the other 20% of the original 20290.
I need to produce 1000 different 80-20 splits.
I woudl like to write a class A that:
-- puts the input file into an ArrayList.
-- generats randomly a sequence of numbers between 0 and 20289.
-- prints out the file in that sequence splitted into 80-20%.
Then I would like to write a class B that:
-- calls class A 1000 times to produce 1000 different 80-20 splits
I see that there is a java.util.Random class, but I have never used it.
Could someone show me:
-- how do I make sure that the numbers generated are between 0 and the size of the input file minus one( assuming I put it all into an arraylist, for example, i.e. 20289) ?
-- how do I make sure that for each 80-20 split I seed Random() so that I get a different sequence of numbers ?
Thank you very much,
Grazia

Look at java.util.Collections.shuffle to randomly reorder your ArrayList.
If you have to do the randomization yourself (not using 'shuffle'), use the same java.util.Random instance over and over. Then you won't need to be sure you get 1000 different seeds.

Similar Messages

  • True nature of Java

    Hi guys,
    I recently wrote submitted a transcript for my book on Java to O'Reily that was well recieved and will be popping into your local bookstore in the near future. David Flanagan was so impressed, he offerred to write the Forward. I think what I have to say will enlighten many of you who are currently in the dark about the TRUE nature of Java. One thing I find in abundance in these forums is the unnecessary use of the "public static void main" function. Also, many of you live under the dillusion that Java is an object oriented language, when in reality nothing could be further from the truth. Java does NOT enforce encapsulation and the type checking ranks only SLIGHTLY above JavaScript! Also, Java is NOT as platform independant as $un claims ("Write Once, Debug Everywhere"). Not to mention that Swing is the biggest joke amongst all of the higher minded GUI architects in the industry (me included).
    I look forward to your "intelligent" (lol) comments. Feel free to contact me directly if you need any insight into any of the problems you are currently facing with Java.
    ~reverse_polish
    <HP_CALC> Rocks! </HP_CALC>

    Congratulations on your talent as a writer.
    However, none of your assertions are original. You're just giving them (as SScotties said) an over-simplistic form, maybe to make more impact on your readers.
    Furthermore, your criticism is not contructive. What alternative(s) are you suggesting ? I hope (for your future as a writer) that it isn't C/C++ or VB...
    Unless you come up with a new programming language (which would be, not only new, but better) and join the Hall of Fame of Computer programming, I'll stick with the less crappy (i.e the best ) of what's available for us down here on earth...
    Keep us posted on your book.

  • True compiler for java

    Is there a true compiler, instead of an interpreter, for java out there? I wanted something that would actually give me an .exe and not run on the virtual machine.

    sigh...
    There is no interpreter.

  • Problems while creating a Java stored proc with dynamic SQL

    Hi,
    I am trying to write a stored procedure which uses dynamic SQL. The code runs fine outside the database (on DOS PROMPT),but gives me an exception when I try to execute it as a procedure. Could somebody help me out?
    The exception given is:
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.security.AccessControlException: the Permission (java.net.SocketPermission
    elcamino.mcasolutions.com resolve) has not been granted by
    dbms_java.grant_permission to SchemaProtectionDomain(SPO|PolicyTableProxy(SPO))
    Does it have anything to access permissions to that user?
    Thanks in advance!
    Joe

    Hi:
    This store procedure is a Java stored procedure (JSP)?
    If true, change your Java code to connect to database because you are connected.
    For example:
    Connection con = new OracleDriver().defaultConnection();
    instead of
    Connection con = DriverManager.getConnection(..);
    Bye.
    J.

  • System Start up issue in my ABAP + JAVA system

    HI,
    when i try to start up my SAP (ABAP+JAVA) system, server processes fail to start. Below is the trace file.
    Though it says missing file jvmx.jar, not sure if this is the reason for the start up issue.
    Thanks to check and assist.
    trc file: "D:\usr\sap\P1D\DVEBMGS00\work\dev_server1", trc level: 1, release: "700"
    node name   : ID3944951
    pid         : 7752
    system name : P1D
    system nr.  : 00
    started at  : Wed May 05 13:27:07 2010
    arguments   :
       arg[00] : D:\usr\sap\P1D\DVEBMGS00\exe\jlaunch.exe
       arg[01] : pf=D:\usr\sap\P1D\SYS\profile\P1D_DVEBMGS00_blrkec115278d
       arg[02] : -DSAPINFO=P1D_00_server
       arg[03] : pf=D:\usr\sap\P1D\SYS\profile\P1D_DVEBMGS00_blrkec115278d
       arg[04] : -DSAPSTART=1
       arg[05] : -DCONNECT_PORT=1243
       arg[06] : -DSAPSYSTEM=00
       arg[07] : -DSAPSYSTEMNAME=P1D
       arg[08] : -DSAPMYNAME=blrkec115278d_P1D_00
       arg[09] : -DSAPPROFILE=D:\usr\sap\P1D\SYS\profile\P1D_DVEBMGS00_blrkec115278d
       arg[10] : -DFRFC_FALLBACK=ON
       arg[11] : -DFRFC_FALLBACK_HOST=localhost
    [Thr 7756] Wed May 05 13:27:07 2010
    [Thr 7756] *** WARNING => INFO: Unknown property [instance.box.number=P1DDVEBMGS00blrkec115278d] [jstartxx.c   841]
    [Thr 7756] *** WARNING => INFO: Unknown property [instance.en.host=blrkec115278d] [jstartxx.c   841]
    [Thr 7756] *** WARNING => INFO: Unknown property [instance.en.port=3201] [jstartxx.c   841]
    [Thr 7756] *** WARNING => INFO: Unknown property [instance.system.id=0] [jstartxx.c   841]
    JStartupReadInstanceProperties: read instance properties [D:\usr\sap\P1D\DVEBMGS00\j2ee\cluster\instance.properties]
    -> ms host    : blrkec115278d
    -> ms port    : 3901
    -> OS libs    : D:\usr\sap\P1D\DVEBMGS00\j2ee\os_libs
    -> Admin URL  :
    -> run mode   : NORMAL
    -> run action : NONE
    -> enabled    : yes
    Used property files
    -> files [00] :
    -> D:\usr\sap\P1D\DVEBMGS00\j2ee\cluster\instance.properties
    Instance properties
    -> ms host    : blrkec115278d
    -> ms port    : 3901
    -> os libs    : D:\usr\sap\P1D\DVEBMGS00\j2ee\os_libs
    -> admin URL  :
    -> run mode   : NORMAL
    -> run action : NONE
    -> enabled    : yes
    Bootstrap nodes
    -> [00] bootstrap            : D:\usr\sap\P1D\DVEBMGS00\j2ee\cluster\instance.properties
    -> [01] bootstrap_ID3944900  :
    -> D:\usr\sap\P1D\DVEBMGS00\j2ee\cluster\instance.properties
    -> [02] bootstrap_ID3944950  :
    -> D:\usr\sap\P1D\DVEBMGS00\j2ee\cluster\instance.properties
    -> [03] bootstrap_ID3944951  :
    -> D:\usr\sap\P1D\DVEBMGS00\j2ee\cluster\instance.properties
    Worker nodes
    -> [00] ID3944900            : D:\usr\sap\P1D\DVEBMGS00\j2ee\cluster\instance.properties
    -> [01] ID3944950            : D:\usr\sap\P1D\DVEBMGS00\j2ee\cluster\instance.properties
    -> [02] ID3944951            : D:\usr\sap\P1D\DVEBMGS00\j2ee\cluster\instance.properties
    [Thr 7756] JLaunchRequestQueueInit: create named pipe for ipc [Thr 7756] JLaunchRequestQueueInit: create pipe listener thread [Thr 7776] WaitSyncSemThread: Thread 7776 started as semaphore monitor thread.
    [Thr 7764] JLaunchRequestFunc: Thread 7764 started as listener thread for np messages.
    [Thr 7756] NiInit3: NI already initialized; param 'maxHandles' ignored (1;202) [Thr 7756] CPIC (version=700.2005.12.02)
    [Thr 7756] *** WARNING => Maximum Java heap size specified twice (through maxHeapSize and in javaParameters) - using -Xmx1024m [jstartxx.c   2604]
    [Thr 7756] [Node: server1] java home is set by profile parameter  Java Home: C:\j2sdk1.4.2_21 [Thr 7756] JStartupICheckFrameworkPackage: can't find framework package D:\usr\sap\P1D\DVEBMGS00\exe\jvmx.jar
    JStartupIReadSection: read node properties [ID3944951]
    -> node name          : server1
    -> node type          : server
    -> node execute       : yes
    -> jlaunch parameters :
    -> java path          : C:\j2sdk1.4.2_21
    -> java parameters    : -Djava.security.policy=./java.policy -Djava.security.egd=file:/dev/urandom -Dorg.omg.CORBA.ORBClass=com.sap.engine.system.ORBProxy -Dorg.omg.CORBA.ORBSingletonClass=com.sap.engine.system.ORBSingletonProxy -Djavax.rmi.CORBA.PortableRemoteObjectClass=com.sap.engine.system.PortableRemoteObjectProxy -Dorg.xml.sax.driver=com.sap.engine.lib.xml.parser.SAXParser -verbose:gc -Djco.jarm=1 -XX:PermSize=256m -XX:MaxPermSize=256m -XX:NewSize=160m -XX:MaxNewSize=160m -XX:SurvivorRatio=2 -XX:TargetSurvivorRatio=90 -XX:PrintGCTimeStamps -XX:UseTLAB -XX:SoftRefLRUPolicyMSPerMB=1 -Dsun.io.useCanonCaches=false -Djava.awt.headless=true -XX:+UseParNewGC
    -> java vm version    : 1.4.2_21-b03
    -> java vm vendor     : Java HotSpot(TM) Server VM (Sun Microsystems Inc.)
    -> java vm type       : server
    -> java vm cpu        : x86
    -> heap size          : 1024M
    -> init heap size     : 1024M
    -> root path          : D:\usr\sap\P1D\DVEBMGS00\j2ee\cluster\server1
    -> class path         : .\bin\boot\boot.jar;.\bin\boot\jaas.jar;.\bin\system\bytecode.jar;.
    -> OS libs path       : D:\usr\sap\P1D\DVEBMGS00\j2ee\os_libs
    -> main class         : com.sap.engine.boot.Start
    -> framework class    : com.sap.bc.proj.jstartup.JStartupFramework
    -> registr. class     : com.sap.bc.proj.jstartup.JStartupNatives
    -> framework path     : D:\usr\sap\P1D\DVEBMGS00\exe\jstartup.jar;D:\usr\sap\P1D\DVEBMGS00\exe\jvmx.jar
    -> shutdown class     : com.sap.engine.boot.Start
    -> parameters         :
    -> debuggable         : no
    -> debug mode         : no
    -> debug port         : 50026
    -> shutdown timeout   : 120000
    [Thr 7756] JLaunchISetDebugMode: set debug mode [no] [Thr 7792] JLaunchIStartFunc: Thread 7792 started as Java VM thread.
    JHVM_LoadJavaVM: VM Arguments of node [server1]
    -> stack   : 262144 Bytes
    -> arg[  0]: exit
    -> arg[  1]: abort
    -> arg[  2]: vfprintf
    -> arg[  3]: -Djava.security.policy=./java.policy
    -> arg[  4]: -Djava.security.egd=file:/dev/urandom
    -> arg[  5]: -Dorg.omg.CORBA.ORBClass=com.sap.engine.system.ORBProxy
    -> arg[  6]:
    -> -Dorg.omg.CORBA.ORBSingletonClass=com.sap.engine.system.ORBSingletonP
    -> roxy arg[  7]:
    -> -Djavax.rmi.CORBA.PortableRemoteObjectClass=com.sap.engine.system.Por
    -> tableRemoteObjectProxy arg[  8]:
    -> -Dorg.xml.sax.driver=com.sap.engine.lib.xml.parser.SAXParser
    -> arg[  9]: -verbose:gc
    -> arg[ 10]: -Djco.jarm=1
    -> arg[ 11]: -XX:PermSize=256m
    -> arg[ 12]: -XX:MaxPermSize=256m
    -> arg[ 13]: -XX:NewSize=160m
    -> arg[ 14]: -XX:MaxNewSize=160m
    -> arg[ 15]: -XX:SurvivorRatio=2
    -> arg[ 16]: -XX:TargetSurvivorRatio=90
    -> arg[ 17]: -XX:+PrintGCTimeStamps
    -> arg[ 18]: -XX:+UseTLAB
    -> arg[ 19]: -XX:SoftRefLRUPolicyMSPerMB=1 arg[ 20]:
    -> -Dsun.io.useCanonCaches=false arg[ 21]: -Djava.awt.headless=true arg[
    -> 22]: -XX:+UseParNewGC arg[ 23]:
    -> -Dsys.global.dir=D:\usr\sap\P1D\SYS\global
    -> arg[ 24]: -Dapplication.home=D:\usr\sap\P1D\DVEBMGS00\exe
    -> arg[ 25]: -Djava.class.path=D:\usr\sap\P1D\DVEBMGS00\exe\jstartup.jar;D:\usr\sap\P1D\DVEBMGS00\exe\jvmx.jar;.\bin\boot\boot.jar;.\bin\boot\jaas.jar;.\bin\system\bytecode.jar;.
    -> arg[ 26]:
    -> -Djava.library.path=C:\j2sdk1.4.2_21\jre\bin\server;C:\j2sdk1.4.2_21\
    -> jre\bin;C:\j2sdk1.4.2_21\bin;D:\usr\sap\P1D\DVEBMGS00\j2ee\os_libs;D:
    -> \oracle\product\10.2.0\db_1\bin;C:\SYSROOT\system32;C:\SYSROOT;C:\SYS
    -> ROOT\System32\Wbem;C:\Program
    -> Files\CA\SharedComponents\ScanEngine;C:\Program
    -> Files\CA\SharedComponents\CAUpdate\;C:\Program
    -> Files\CA\SharedComponents\ThirdParty\;C:\Program
    -> Files\CA\SharedComponents\SubscriptionLicense\;C:\Program
    -> Files\CA\eTrustITM;C:\Program Files\Windows
    -> Imaging\;D:\usr\sap\P1D\SYS\exe\uc\NTI386
    -> arg[ 27]: -Dmemory.manager=1024M
    -> arg[ 28]: -Xmx1024M
    -> arg[ 29]: -Xms1024M
    -> arg[ 30]: -DLoadBalanceRestricted=no
    -> arg[ 31]: -Djstartup.mode=JCONTROL
    -> arg[ 32]: -Djstartup.ownProcessId=7752 arg[ 33]:
    -> -Djstartup.ownHardwareId=N1596875852
    -> arg[ 34]: -Djstartup.whoami=server
    -> arg[ 35]: -Djstartup.debuggable=no
    -> arg[ 36]: -DSAPINFO=P1D_00_server
    -> arg[ 37]: -DSAPSTART=1
    -> arg[ 38]: -DCONNECT_PORT=1243
    -> arg[ 39]: -DSAPSYSTEM=00
    -> arg[ 40]: -DSAPSYSTEMNAME=P1D
    -> arg[ 41]: -DSAPMYNAME=blrkec115278d_P1D_00 arg[ 42]:
    -> -DSAPPROFILE=D:\usr\sap\P1D\SYS\profile\P1D_DVEBMGS00_blrkec115278d
    -> arg[ 43]: -DFRFC_FALLBACK=ON
    -> arg[ 44]: -DFRFC_FALLBACK_HOST=localhost arg[ 45]: -DSAPSTARTUP=1
    -> arg[ 46]: -DSAPSYSTEM=00 arg[ 47]: -DSAPSYSTEMNAME=P1D arg[ 48]:
    -> -DSAPMYNAME=blrkec115278d_P1D_00 arg[ 49]: -DSAPDBHOST=blrkec115278d
    -> arg[ 50]: -Dj2ee.dbhost=blrkec115278d
    CompilerOracle: exclude com/sapportals/portal/pb/layout/taglib/ContainerTag addIviewResources
    CompilerOracle: exclude com/sap/engine/services/keystore/impl/security/CodeBasedSecurityConnector getApplicationDomain
    CompilerOracle: exclude com/sap/engine/services/rmi_p4/P4StubSkeletonGenerator generateStub
    CompilerOracle: exclude com/sapportals/portal/prt/util/StringUtils escapeToJS
    CompilerOracle: exclude com/sapportals/portal/prt/core/broker/PortalServiceItem startServices
    CompilerOracle: exclude com/sap/engine/services/webservices/server/deploy/WSConfigurationHandler downloadFile
    CompilerOracle: exclude com/sapportals/portal/prt/jndisupport/util/AbstractHierarchicalContext lookup
    CompilerOracle: exclude com/sapportals/portal/navigation/cache/CacheNavigationNode getAttributeValue
    CompilerOracle: exclude com/sapportals/portal/navigation/TopLevelNavigationiView PrintNode
    CompilerOracle: exclude com/sapportals/wcm/service/ice/wcm/ICEPropertiesCoder encode
    CompilerOracle: exclude com/sap/lcr/pers/delta/importing/ObjectLoader loadObjects
    CompilerOracle: exclude com/sap/engine/services/webservices/jaxrpc/encoding/InstanceBuilder readElement
    CompilerOracle: exclude com/sap/engine/services/webservices/jaxrpc/encoding/InstanceBuilder readSequence
    CompilerOracle: exclude com/sap/engine/services/webservices/jaxrpc/encoding/TypeMappingImpl initializeRelations
    CompilerOracle: exclude com/sap/engine/services/webservices/jaxrpc/encoding/GeneratedComplexType loadInto [Thr 7792] JHVMLoadJavaVM: Java VM created OK.
    JHVM_BuildArgumentList: main method arguments of node [server1]
    [Thr 7872] Wed May 05 13:27:08 2010
    [Thr 7872] JHVM_RegisterNatives: registering methods in com.sap.bc.krn.perf.PerfTimes
    [Thr 7872] Wed May 05 13:27:09 2010
    [Thr 7872] JHVM_RegisterNatives: registering methods in com.sap.bc.proj.jstartup.JStartupFramework
    [Thr 7872] JLaunchISetClusterId: set cluster id 3944951 [Thr 7872] JLaunchISetState: change state from [Initial (0)] to [Waiting for start (1)] [Thr 7872] JLaunchISetState: change state from [Waiting for start (1)] to [Starting (2)]
    Wed May 05 13:27:13 2010
    5.640: [ParNew 81920K->5980K(1007616K), 0.0258446 secs]
    Wed May 05 13:27:17 2010
    9.773: [ParNew 87893K->13835K(1007616K), 0.0529425 secs]
    Wed May 05 13:27:21 2010
    13.293: [ParNew 95755K->17179K(1007616K), 0.0572638 secs]
    Wed May 05 13:27:23 2010
    15.634: [ParNew 99099K->17958K(1007616K), 0.0419008 secs]
    [Thr 6392] Wed May 05 13:27:26 2010
    [Thr 6392] JHVM_RegisterNatives: registering methods in com.sap.mw.rfc.driver.CpicDriver [Thr 6392] JHVM_RegisterNatives: registering methods in com.sap.i18n.cp.ConverterJNI
    [Thr 6392] Wed May 05 13:27:29 2010
    [Thr 6392] JHVM_RegisterNatives: registering methods in com.sap.mw.rfc.engine.Compress
    [Thr 7804] Wed May 05 13:27:33 2010
    [Thr 7804] JLaunchIExitJava: exit hook is called (rc = -11113) [Thr 7804] **********************************************************************
    ERROR => The Java VM terminated with a non-zero exit code.
    Please see SAP Note 943602 , section 'J2EE Engine exit codes'
    for additional information and trouble shooting.
    [Thr 7804] JLaunchCloseProgram: good bye (exitcode = -11113)

    Have you changed your java administrator password recently? If so, have you changed it in the configtool as well?
    Kind regards,
    Mark

  • Logging API: Java 1.5 logs a lot in FINE, etc.

    I noticed that my application log contains a lot more entries since I use Java 1.5 when I log fine/finer/finest messages. I tried to workaround this by just change the log levels of my loggers (by inspecting the logger name prefixes). But the Java messages still log:
         * Set level for all registered loggers of the LogManager.
         * @param level New level to set.
         * @param prefix Optional prefix string for loggers to consider.
        static public void setGlobalLevel(Level level, String prefix) {
            if (level != null) {
                LogManager logManager = LogManager.getLogManager();
                if (logManager != null) {
                    Enumeration<String> enu = logManager.getLoggerNames();
                    boolean first = true;
                    while (enu.hasMoreElements()) {
                        String loggerName = enu.nextElement();
                        if (prefix == null || loggerName.startsWith(prefix)) {
                            Logger logger = logManager.getLogger(loggerName);
                            if (logger != null) {
                                logger.setLevel(level);
                            }//else: logger unavailable
                            if (first) {
                                logger.log(Level.CONFIG, "Global log level changed to "+level);
                                first = false;
                    }//next logger
                }//else: LogManager unavailable
            }//else: level unavailable
        }//setGlobalLevel()

    Okay, I try to explain it differently. SInce Java 1.5, why I log messages with level FINE, FINER, or FINEST, I get lots of additional entries like:
    2005-04-19 13:13:22.076 FINER focus owner is javax.swing.JButton[,12,97,161x33,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@19d3b3a,flags=424,maximumSize=,minimumSize=,preferredSize=,defaultIcon=javax.swing.ImageIcon@19050a0,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=Log-Datei,defaultCapable=true] [java.awt.focus.KeyboardFocusManager]
    2005-04-19 13:13:22.076 FINER >>> java.awt.event.KeyEvent[KEY_PRESSED,keyCode=18,keyText=Alt,keyChar=Undefined keyChar,modifiers=Alt,extModifiers=Alt,keyLocation=KEY_LOCATION_LEFT] on frame0 [java.awt.focus.KeyboardFocusManager]
    2005-04-19 13:13:22.404 FINER focus owner is javax.swing.JButton[,12,97,161x33,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@19d3b3a,flags=424,maximumSize=,minimumSize=,preferredSize=,defaultIcon=javax.swing.ImageIcon@19050a0,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=Log-Datei,defaultCapable=true] [java.awt.focus.KeyboardFocusManager]
    2005-04-19 13:13:22.404 FINER >>> java.awt.event.KeyEvent[KEY_RELEASED,keyCode=9,keyText=Tabulator,keyChar=Tabulator,modifiers=Alt,extModifiers=Alt,keyLocation=KEY_LOCATION_STANDARD] on frame0 [java.awt.focus.KeyboardFocusManager]
    2005-04-19 13:13:22.716 FINER focus owner is javax.swing.JButton[,12,97,161x33,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@19d3b3a,flags=424,maximumSize=,minimumSize=,preferredSize=,defaultIcon=javax.swing.ImageIcon@19050a0,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=Log-Datei,defaultCapable=true] [java.awt.focus.KeyboardFocusManager]
    2005-04-19 13:13:22.716 FINER >>> java.awt.event.KeyEvent[KEY_RELEASED,keyCode=18,keyText=Alt,keyChar=Undefined keyChar,keyLocation=KEY_LOCATION_LEFT] on frame0 [java.awt.focus.KeyboardFocusManager]
    2005-04-19 13:13:22.732 FINE >>> java.awt.event.WindowEvent[WINDOW_LOST_FOCUS,opposite=null,oldState=0,newState=0] on frame0 [java.awt.focus.KeyboardFocusManager]
    2005-04-19 13:13:22.732 FINE java.awt.event.WindowEvent[WINDOW_LOST_FOCUS,opposite=null,oldState=0,newState=0] on frame0 [java.awt.focus.DefaultKeyboardFocusManager]
    2005-04-19 13:13:22.732 FINE Active de.icomps.prt.gui.ClientReportPrinterConsole[frame0,110,46,1140x794,invalid,layout=java.awt.BorderLayout,title=iComps Client Report Printer 1.1.6,resizable,normal,defaultCloseOperation=DO_NOTHING_ON_CLOSE,rootPane=javax.swing.JRootPane[,4,23,1132x767,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true], Current focused de.icomps.prt.gui.ClientReportPrinterConsole[frame0,110,46,1140x794,invalid,layout=java.awt.BorderLayout,title=iComps Client Report Printer 1.1.6,resizable,normal,defaultCloseOperation=DO_NOTHING_ON_CLOSE,rootPane=javax.swing.JRootPane[,4,23,1132x767,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true], losing focus de.icomps.prt.gui.ClientReportPrinterConsole[frame0,110,46,1140x794,invalid,layout=java.awt.BorderLayout,title=iComps Client Report Printer 1.1.6,resizable,normal,defaultCloseOperation=DO_NOTHING_ON_CLOSE,rootPane=javax.swing.JRootPane[,4,23,1132x767,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true] opposite null [java.awt.focus.DefaultKeyboardFocusManager]
    2005-04-19 13:13:22.732 FINE >>> java.awt.event.FocusEvent[FOCUS_LOST,temporary,opposite=null] on javax.swing.JButton[,12,97,161x33,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@19d3b3a,flags=424,maximumSize=,minimumSize=,preferredSize=,defaultIcon=javax.swing.ImageIcon@19050a0,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=Log-Datei,defaultCapable=true] [java.awt.focus.KeyboardFocusManager]
    2005-04-19 13:13:22.732 FINE java.awt.event.FocusEvent[FOCUS_LOST,temporary,opposite=null] on javax.swing.JButton[,12,97,161x33,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@19d3b3a,flags=424,maximumSize=,minimumSize=,preferredSize=,defaultIcon=javax.swing.ImageIcon@19050a0,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=Log-Datei,defaultCapable=true] [java.awt.focus.DefaultKeyboardFocusManager]
    2005-04-19 13:13:22.732 FINE java.awt.event.FocusEvent[FOCUS_LOST,temporary,opposite=null] on javax.swing.JButton[,12,97,161x33,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@19d3b3a,flags=424,maximumSize=,minimumSize=,preferredSize=,defaultIcon=javax.swing.ImageIcon@19050a0,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=Log-Datei,defaultCapable=true] [java.awt.focus.Component]
    2005-04-19 13:13:22.732 FINE >>> java.awt.event.WindowEvent[WINDOW_DEACTIVATED,opposite=null,oldState=0,newState=0] on frame0 [java.awt.focus.KeyboardFocusManager]
    2005-04-19 13:13:22.732 FINE java.awt.event.WindowEvent[WINDOW_DEACTIVATED,opposite=null,oldState=0,newState=0] on frame0 [java.awt.focus.DefaultKeyboardFocusManager]
    2005-04-19 13:13:22.748 FINER Setting global active window to null, old active de.icomps.prt.gui.ClientReportPrinterConsole[frame0,110,46,1140x794,invalid,layout=java.awt.BorderLayout,title=iComps Client Report Printer 1.1.6,resizable,normal,defaultCloseOperation=DO_NOTHING_ON_CLOSE,rootPane=javax.swing.JRootPane[,4,23,1132x767,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true] [java.awt.focus.KeyboardFocusManager]
    2005-04-19 13:13:22.748 FINE >>> java.awt.event.FocusEvent[FOCUS_LOST,permanent,opposite=null] on frame0 [java.awt.focus.KeyboardFocusManager]
    So, I try just to set the levels FINE, FINER, FINEST for my applications loggers that all have logger names being the Java package name and class name (e.g. "one.two.three.MyClass"). So, I change the levels of all logers who's lagger name starts with "one.two.three". That should lead to log messages of FINE/FINER/FINEST from my loggers. But I still get the log messages of Java internal loggings like
    >>> java.awt.event.FocusEvent[FOCUS_LOST,permanent,opposite=null] on frame0
    from java.awt.focus.KeyboardFocusManager.

  • Java 7: Problems launching applets with jars on "file://" location

    Hi,
    We are experiencing a problem when updating our client's JRE from Java6 U 21 up to Java7 U 55.
    We have developed an Applet which is composed by several JAR files. Some of those JARs must be stored in local drive, and the JAR with the main Java class is stored on server.
    Let's supose we have a similar scenario like this:
    https://blahblahbah/bar.jar
    https://blahblahbah/test.html
    C:/foo.jar
    The code of test.html:
    <embed
      archive="file:///C:/foo.jar"
      cache_archive="bar.jar"
    />
    This code works fine on Java 6 and Applet is correctly loaded.
    However, with Java 7 a security exception is raised when trying to load JAR files from "file:///" location during Applet launch:
    java.lang.SecurityException: Permission denied: file:/C:/foo.jar
        at sun.plugin2.applet.Applet2Manager._loadJarFiles(Unknown Source)
    We have tried several tests using a java.policy file which grants all possible permisions:
    grant codeBase "file:/C:/foo.jar" {
        permission java.security.AllPermission;
    grant {
      permission java.security.AllPermission;
    We also tried to low Java's security level to "MEDIUM", with no success.
    We finally only managed to run the Applet if we explicity disable the "Next-Generation Plugin" with Internet Explorer 8. However, that's not a suitable solution, and still does not work with Mozilla family browsers.
    Eventhought with Mozilla browsers is still not working.
    Is there any restrictions in Java 7 that prevents to read jars from being loaded from local drive when launching Applets?
    Thanks in advance,

    Thank you baftos.
    I had read the whole message before posting mine. It's not the same problem. I'm able to run the sample signed applet always having the jar in the same location than the HTML page serving the applet via JNLP:
    <jar href="SignedAppletTest.jar" main="true"/>
    However, the security exception raises when trying to read that jar from local drive:
    <jar href="file://C:/SignedAppletTest.jar" main="true"/>
    ExitException[ 3]java.lang.SecurityException: Permission denied: file://C:/SignedAppletTest.jar
        at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)
    I have even tried to decompile JNLP2Manager class, without seeing anything useful on that loadJarFiles method
    The only way I managed to avoid the problem is unchecking the New Generation Plugin and running the Applet with IE. Not a suitable solution for me at all..

  • Need Help with Java Space Invaders Game!

    Hi, im new to these forums so forgive if i dont follow the right way on laying things out. Im trying to create space invaders game but im stuck when im trying to create multiple aliens/ invaders. I have a class called Aliens (which is the invaders), and i can create an instance of an Alien. But when I try to create multiple instances they are not showing up on screen. I am not getting any error message though (which im hoping is a good sign, lol).
    GamePanel is where all the action is and Alien is the alien (invaders) class.
    Here is the code:
    import java.awt.; import javax.swing.; import java.awt.Image; import java.awt.event.KeyListener; import java.awt.event.KeyEvent;
    public class GamePanel extends JComponent implements KeyListener { SpaceInvaders game; static Player player1; Aliens alien1; static public Image spaceship2R; static public Image spaceship2L;
    public GamePanel(SpaceInvaders game)
         this.game = game;
         player1 = new Player(this);
         player1.start();
                   ///// trying to create multiple instances of aliens here
         for(int i=0; i<4; i++)
              alien1 = new Aliens(this);
              alien1.setX(i*100);
              alien1.start();
        this.setFocusable(true);
        this.addKeyListener(this);
    public void paintComponent(Graphics g)
         Image pic1 = player1.getImage();
         Image pic2 = alien1.getImage();
         super.paintComponent(g);
         g.drawImage(pic1, player1.getX(), player1.getY(), 50, 50,this);
         g.drawImage(pic2, alien1.getX(), alien1.getY(), 50, 50,this);
    }//end class
    import java.awt.Image; import java.awt.*;
    class Aliens extends Thread { //variables GamePanel parent; private boolean isRunning; private int xPos = 0, yPos = 0; Thread thread; static char direction = 'r'; Aliens alien; static public Image alien1; static public Image alien2;
    public Aliens(GamePanel parent)
         this.parent = parent;
         isRunning = true;
    public void run()
         while(isRunning)
              Toolkit kit = Toolkit.getDefaultToolkit();
              alien1 = kit.getImage("alien1.gif");
              alien2 = kit.getImage("alien2.gif");
              try
                      thread.sleep(100);
                 catch(InterruptedException e)
                      System.err.println(e);
                 updateAliens();
                 parent.repaint();
    public static Image getImage()
         Image alienImage = alien1;
        switch(direction){
             case('l'):
                  alienImage = alien1;
                  break;
             case('r'):
                  alienImage = alien1;
                  break;
        return alienImage;     
    public void updateAliens()
         if(direction=='r')
              xPos+=20;
              if(xPos >= SpaceInvaders.WIDTH-50||xPos < 0)
                   yPos+=50;
                   xPos-=20;
                   direction='l';
         else
              xPos-=20;
              if(xPos >= SpaceInvaders.WIDTH-50||xPos < 0)
                   yPos+=50;
                   xPos+=20;
                   direction='r';
    public void setDirection(char c){ direction = c; }
    public void setX(int x){ xPos = x; }
    public void setY(int y){ yPos = y; }
    public int getX(){ return xPos; }
    public int getY(){ return yPos; }
    }//end classEdited by: deathwings on Oct 19, 2009 9:47 AM
    Edited by: deathwings on Oct 19, 2009 9:53 AM

    Maybe the array I have created is not being used in the paint method, or Im working with 2 different objects as you put it? Sorry, Im just learning and I appreciate your time and help. Here is my GamePanel Class and my Aliens class:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.Image;
    import java.awt.event.KeyListener;
    import java.awt.event.KeyEvent;
    import java.awt.image.BufferStrategy;
    public class GamePanel extends JComponent implements KeyListener
         SpaceInvaders game;
         static Player player1;
         static Bullets bullet;
         //static public Image spaceship2R;
         //static public Image spaceship2L;
         private BufferStrategy strategy;
         static int alienNum =0;
         static Aliens[] aliens;
         public GamePanel(SpaceInvaders game)
              this.game = game;
              player1 = new Player(this);
              player1.start();
              Aliens[] aliens = new Aliens[10];
              for(int i=0; i<4; i++)
                   aliens[i] = new Aliens(this);
                   aliens.setX(i*100);
                   aliens[i].start();
                   alienNum++;
              initialiseGame();
              this.setFocusable(true);
    this.addKeyListener(this);
         public void paintComponent(Graphics g)
              Image pic1 = player1.getImage();
              Image pic2 = aliens[0].getImage();
              Image bulletPic = bullet.getImage();
              super.paintComponent(g);
              g.drawImage(pic1, player1.getX(), player1.getY(), 50, 50,this);
              for ( int i = 0; i < alienNum; i++ )
                   g.drawImage(pic1, aliens[0].getX(), aliens[0].getY(), 50, 50,this);
              //if (bullet.fired==true){
              //     g.drawImage(bulletPic, bullet.getX(), bullet.getY(), 20, 20,this);
         public void keyPressed(KeyEvent k)
              switch (k.getKeyCode()) {
              case (KeyEvent.VK_KP_DOWN):
              case (KeyEvent.VK_DOWN):
                   player1.setDirection('d');
                   break;
              case (KeyEvent.VK_KP_UP):
              case (KeyEvent.VK_UP):
                   player1.setDirection('u');
              break;
              case (KeyEvent.VK_KP_RIGHT):
              case (KeyEvent.VK_RIGHT):
                   player1.setDirection('r');
              break;
              case (KeyEvent.VK_KP_LEFT):
              case (KeyEvent.VK_LEFT):
                   player1.setDirection('l');
              break;
              case (KeyEvent.VK_SPACE):
                   fireBullet();
              break;
         public void keyTyped(KeyEvent k) {}//empty
         public void keyReleased(KeyEvent k)
              player1.setDirection('n');
         public void initialiseGame()
         public static void checkCollision()
              Rectangle playerRec = new Rectangle(player1.getBoundingBox());
              for(int i=0; i<alienNum; i++)
                   //if(playerRec.intersects(aliens[i].getBoundingBox()))
                        //collisionDetected();
         public static void collisionDetected()
              System.out.println("COLLISION");
         public void fireBullet()
              Bullets bullet = new Bullets(player1.getX(),player1.getY());
              bullet.fired=true;
    }//end GamePanelimport java.awt.Image;
    import java.awt.*;
    class Aliens extends Thread
         //variables
         GamePanel parent;
         private boolean isRunning;
         private int xPos = 0, yPos = 0;
         Thread thread;
         static char direction = 'r';
         Aliens alien;
         static public Image alien1;
         static public Image alien2;
         public Aliens(GamePanel parent)
              this.parent = parent;
              isRunning = true;
         public void run()
              while(isRunning)
                   Toolkit kit = Toolkit.getDefaultToolkit();
                   alien1 = kit.getImage("alien1.gif");
                   //alien2 = kit.getImage("alien2.gif");
                   try
              thread.sleep(100);
         catch(InterruptedException e)
              System.err.println(e);
              updateAliens();
              parent.repaint();
         public static Image getImage()
              Image alienImage = alien1;
         switch(direction){
              case('l'):
                   alienImage = alien1;
                   break;
              case('r'):
                   alienImage = alien1;
                   break;
         return alienImage;     
         public void updateAliens()
              if(direction=='r')
                   xPos+=20;
                   if(xPos >= SpaceInvaders.WIDTH-50||xPos < 0)
                        yPos+=50;
                        xPos-=20;
                        direction='l';
              else
                   xPos-=20;
                   if(xPos >= SpaceInvaders.WIDTH-50||xPos < 0)
                        yPos+=50;
                        xPos+=20;
                        direction='r';
         public Rectangle getBoundingBox()
              return new Rectangle((int)xPos, (int)yPos, 50, 50);
         public void setDirection(char c){ direction = c; }
         public void setX(int x){ xPos = x; }
         public void setY(int y){ yPos = y; }
         public int getX(){ return xPos; }
         public int getY(){ return yPos; }
    }//end class                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to handle blob data with java and mysql and hibernate

    Dear all,
    I am using java 1.6 and mysql 5.5 and hibernate 3.0 . Some time i use blob data type . Earlier my project's data base was oracle 10g but now i am converting it to Mysql and now i am facing problem to save and fetch blob data to mysql database . Can anybody give me the source code for blob handling with java+Mysql+Hibernate
    now my code is :--
    ==================================================
    *.hbm.xml :--
    <property name="image" column="IMAGE" type="com.shrisure.server.usertype.BinaryBlobType" insert="true" update="true" lazy="false"/>
    ===================================================
    *.java :--
    package com.shrisure.server.usertype;
    import java.io.OutputStream;
    import java.io.Serializable;
    import java.sql.Blob;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Types;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    import oracle.sql.BLOB;
    import org.hibernate.HibernateException;
    import org.hibernate.usertype.UserType;
    import org.jboss.resource.adapter.jdbc.WrappedConnection;
    import com.google.gwt.user.client.rpc.IsSerializable;
    public class BinaryBlobType implements UserType, java.io.Serializable, IsSerializable {
    private static final long serialVersionUID = 1111222233331231L;
    public int[] sqlTypes() {
    return new int[] { Types.BLOB };
    public Class returnedClass() {
    return byte[].class;
    public boolean equals(Object x, Object y) {
    return (x == y) || (x != null && y != null && java.util.Arrays.equals((byte[]) x, (byte[]) y));
    public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
    BLOB tempBlob = null;
    WrappedConnection wc = null;
    try {
    if (value != null) {
    Connection oracleConnection = st.getConnection();
    if (oracleConnection instanceof oracle.jdbc.driver.OracleConnection) {
    tempBlob = BLOB.createTemporary(oracleConnection, true, BLOB.DURATION_SESSION);
    if (oracleConnection instanceof org.jboss.resource.adapter.jdbc.WrappedConnection) {
    InitialContext ctx = new InitialContext();
    DataSource dataSource = (DataSource) ctx.lookup("java:/DefaultDS");
    Connection dsConn = dataSource.getConnection();
    wc = (WrappedConnection) dsConn;
    // with getUnderlying connection method , cast it to Oracle
    // Connection
    oracleConnection = wc.getUnderlyingConnection();
    tempBlob = BLOB.createTemporary(oracleConnection, true, BLOB.DURATION_SESSION);
    tempBlob.open(BLOB.MODE_READWRITE);
    OutputStream tempBlobWriter = tempBlob.getBinaryOutputStream();// setBinaryStream(1);
    tempBlobWriter.write((byte[]) value);
    tempBlobWriter.flush();
    tempBlobWriter.close();
    tempBlob.close();
    st.setBlob(index, tempBlob);
    } else {
    st.setBlob(index, BLOB.empty_lob());
    } catch (Exception exp) {
    if (tempBlob != null) {
    tempBlob.freeTemporary();
    exp.printStackTrace();
    st.setBlob(index, BLOB.empty_lob());
    // throw new RuntimeException();
    } finally {
    if (wc != null) {
    wc.close();
    public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException {
    final Blob blob = rs.getBlob(names[0]);
    return blob != null ? blob.getBytes(1, (int) blob.length()) : null;
    public Object deepCopy(Object value) {
    if (value == null)
    return null;
    byte[] bytes = (byte[]) value;
    byte[] result = new byte[bytes.length];
    System.arraycopy(bytes, 0, result, 0, bytes.length);
    return result;
    public boolean isMutable() {
    return true;
    public Object assemble(Serializable arg0, Object arg1) throws HibernateException {
    return assemble(arg0, arg1);
    public Serializable disassemble(Object arg0) throws HibernateException {
    return disassemble(arg0);
    public int hashCode(Object arg0) throws HibernateException {
    return hashCode();
    public Object replace(Object arg0, Object arg1, Object arg2) throws HibernateException {
    return replace(arg0, arg1, arg2);
    =================================================================
    can anyone give me the source code for this BinaryBlobType.java according to mysql blob handling ..

    Moderator action: crosspost deleted.

  • Jax-ws 2.2.8 and ws-addressing: Client throwing java.lang.NullPointerException on receipt of HTTP 202 when using non-anonymous ReplyTo address

    Server: JBoss EAP 6.2.0
    Client: JDK 1.7.0_51 x64
    JAX-WS: RI 2.2.8 ( via -Djava.endorsed.dirs )
    I am getting a java.lang.NullPointerException when calling the operation on the WS endpoint from the client when using non-anonymous replyTo address.
    I have simplified the scenario into a small test case that hopefully others can replicate. Since the exception is happening on the client instead of the server, I would think that the container used is irrelevant, but I have specified it nonetheless.
    1) WebService:
    package test.webservice;
    import java.util.Random;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    import javax.jws.soap.SOAPBinding;
    import javax.xml.ws.soap.Addressing;
    @WebService(targetNamespace="http://services.nowhere.org/")
    @Addressing(required=true)
    @SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
    public class RandomTest {
        @WebMethod
        public long nextRandom(@WebParam boolean forceException) throws Exception {
            if( forceException ) {
                throw new Exception("Some exception");
            Random rand = new Random();
            return rand.nextLong();
    2) Generated WSDL by JBossEAP 6.2.2:
    <?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://webservice.test/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="RandomTestService" targetNamespace="http://webservice.test/">
      <wsdl:types>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://webservice.test/" elementFormDefault="unqualified" targetNamespace="http://webservice.test/" version="1.0">
      <xs:element name="nextRandom" type="tns:nextRandom"/>
      <xs:element name="nextRandomResponse" type="tns:nextRandomResponse"/>
      <xs:complexType name="nextRandom">
        <xs:sequence/>
      </xs:complexType>
      <xs:complexType name="nextRandomResponse">
        <xs:sequence>
          <xs:element name="return" type="xs:long"/>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>
      </wsdl:types>
      <wsdl:message name="nextRandom">
        <wsdl:part element="tns:nextRandom" name="parameters">
        </wsdl:part>
      </wsdl:message>
      <wsdl:message name="nextRandomResponse">
        <wsdl:part element="tns:nextRandomResponse" name="parameters">
        </wsdl:part>
      </wsdl:message>
      <wsdl:portType name="RandomTest">
        <wsdl:operation name="nextRandom">
          <wsdl:input message="tns:nextRandom" name="nextRandom" wsam:Action="http://webservice.test/RandomTest/nextRandomRequest" wsaw:Action="http://webservice.test/RandomTest/nextRandomRequest">
        </wsdl:input>
          <wsdl:output message="tns:nextRandomResponse" name="nextRandomResponse" wsam:Action="http://webservice.test/RandomTest/nextRandomResponse" wsaw:Action="http://webservice.test/RandomTest/nextRandomResponse">
        </wsdl:output>
        </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="RandomTestServiceSoapBinding" type="tns:RandomTest">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsaw:UsingAddressing wsdl:required="true"/>
        <wsp:PolicyReference URI="#RandomTestServiceSoapBinding_WSAM_Addressing_Policy"/>
        <wsdl:operation name="nextRandom">
          <soap:operation soapAction="" style="document"/>
          <wsdl:input name="nextRandom">
            <soap:body use="literal"/>
          </wsdl:input>
          <wsdl:output name="nextRandomResponse">
            <soap:body use="literal"/>
          </wsdl:output>
        </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="RandomTestService">
        <wsdl:port binding="tns:RandomTestServiceSoapBinding" name="RandomTestPort">
          <soap:address location="http://localhost:8080/servertest/RandomTest"/>
        </wsdl:port>
      </wsdl:service>
        <wsp:Policy xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="RandomTestServiceSoapBinding_WSAM_Addressing_Policy"><wsam:Addressing><wsp:Policy/></wsam:Addressing></wsp:Policy>
    </wsdl:definitions>
    3) ant build.xml to generate the client code from WSDL
    <?xml version="1.0" encoding="UTF-8"?>
    <project default="build" basedir="..">
        <property name="jaxws.classpath" location="C://jaxws-2.2.8/jaxws-ri/lib/*.jar"/>
        <taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
               <classpath path="${jaxws.classpath}"/>
        </taskdef>
        <target name="build" >
            <!-- For these to work, the JAR files in tools/jaxws-ri must be included in Ant's classpath -->
            <wsimport wsdl="http://localhost:8080/servertest/RandomTest?wsdl"
                   verbose="true"
                   sourcedestdir="src"
                   destdir="bin"
                   keep="true">
                   <xjcarg value="-enableIntrospection"/>
            </wsimport>
        </target>
    </project>
    4) Client code
    4a) ClientTest.java - Actual client run from client
    package test.wsclient;
    import java.util.ArrayList;
    import java.util.List;
    import javax.xml.ws.BindingProvider;
    import javax.xml.ws.Endpoint;
    import javax.xml.ws.handler.Handler;
    import javax.xml.ws.soap.AddressingFeature;
    import org.nowhere.services.RandomTest;
    import org.nowhere.services.RandomTestService;
    public class ClientTest {
        public static void main(String args[]) throws Exception {
            ClientTest app = new ClientTest();
            app.testAddressing();
        public void testAddressing() throws Exception {
            String REPLY_TO_ADDRESS = "http://localhost:8082/servertest/RandomCallback";
            String FAULT_TO_ADDRESS = "http://localhost:8082/servertest/RandomCallbackFault";
            RandomTestService service = new RandomTestService();
            RandomTest port = service.getRandomTestPort(new AddressingFeature());
            BindingProvider provider = (BindingProvider) port;
            // pass the replyTo address to the handler
            provider.getRequestContext().put("ReplyTo", REPLY_TO_ADDRESS);
            provider.getRequestContext().put("FaultTo", FAULT_TO_ADDRESS);
            // Register handlers to set the ReplyTo and FaultTo on the SOAP request sent to the WS endpoint
            List<Handler> handlerChain = new ArrayList<Handler>();
            handlerChain.add(new ClientHandler());
            provider.getBinding().setHandlerChain(handlerChain);
            // Start endpoint to receive callbacks from WS
            Endpoint endpoint = Endpoint.publish(REPLY_TO_ADDRESS, new CallbackSEI());
            try {
                port.nextRandom(false);
            } catch( Exception ex ) {
                ex.printStackTrace();
            } finally {
                Thread.sleep(10000);
            endpoint.stop();
            System.exit(0);
    4b) ClientHandler.java - Used to set the wsa ReplyTo address and FaultTo address when sending SOAP request from client to server
    package test.wsclient;
    import java.util.Set;
    import javax.xml.namespace.QName;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPHeader;
    import javax.xml.ws.handler.MessageContext;
    import javax.xml.ws.handler.MessageContext.Scope;
    import javax.xml.ws.handler.soap.SOAPHandler;
    import javax.xml.ws.handler.soap.SOAPMessageContext;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    public class ClientHandler implements SOAPHandler<SOAPMessageContext> {
        public ClientHandler() {};
        @Override
        public Set<QName> getHeaders() {
            return null;
        @Override
        public void close(MessageContext arg0) {
        @Override
        public boolean handleFault(SOAPMessageContext context) {
            return true;
        protected void setAnAddress(SOAPHeader header, String tagName, String address) {
            NodeList nodeListReplyTo = header.getElementsByTagName(tagName);
            NodeList nodeListAddress = nodeListReplyTo.item(0).getChildNodes();
            for (int i = 0; i < nodeListAddress.getLength(); i++) {
                Node node = nodeListAddress.item(i);
                if ("Address".equals(node.getLocalName())) {
                    node.setTextContent(address);
                    break;
        protected String getMessageID(SOAPHeader header) {
            NodeList nodeListMessageId = header.getElementsByTagName("MessageID");
            return nodeListMessageId.item(0).getTextContent();
        @Override
        public boolean handleMessage(SOAPMessageContext context) {
            Boolean isOutbound = (Boolean) context.get(SOAPMessageContext.MESSAGE_OUTBOUND_PROPERTY);
            if (isOutbound) {
                try {
                    SOAPEnvelope envelope = context.getMessage().getSOAPPart().getEnvelope();
                    SOAPHeader header = envelope.getHeader();
                    /* extract the generated MessageID */
                    String messageID = getMessageID(header);
                    context.put("MessageID", messageID);
                    context.setScope("MessageID", Scope.APPLICATION);
                    /* change ReplyTo address */
                    setAnAddress(header, "ReplyTo", (String) context.get("ReplyTo"));
                    setAnAddress(header, "FaultTo", (String) context.get("FaultTo"));
                } catch (Exception ex) {
                    throw new RuntimeException(ex);
            return true;
    4c) CallbackSEI.java - endpoint on the client for server to send the SOAP response back to the client
    package test.wsclient;
    import javax.annotation.Resource;
    import javax.jws.Oneway;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    import javax.xml.ws.Action;
    import javax.xml.ws.RequestWrapper;
    import javax.xml.ws.WebServiceContext;
    import javax.xml.ws.soap.Addressing;
    @WebService
    @Addressing
    //@HandlerChain(file = "/handler-chain.xml")
    public class CallbackSEI {
        @Resource
        private WebServiceContext context;
         * If there is no namespace specified in the method below, then the CallbackSEI needs to be in the same package as the
         * WS endpoint.
        @Oneway
        @Action(input="http://services.nowhere.org/RandomTest/nextRandomResponse")
        @RequestWrapper(localName="nextRandomResponse", targetNamespace="http://services.nowhere.org/")
        public void handleNotification(@WebParam(name="return")long random) {
            System.out.println("Asynch response received");
            System.out.println( random );
            //System.out.println("This response relates to the message ID: "+ getMessageID());
    In summary:
    Server is listening on port 8080
    Client will listen in port 8082 for the callback from the server for the SOAP response
    Now when I run the client, I see that the proper behaviour as far as ws-addressing is concerned. That is:
    client  -- SOAP request ( on port 8080 ) --> server
    client <-- HTTP 202 ( empty HTTP body )  --- server
    client <-- SOAP response ( on port 8082 )  --- server
    All well and good, except that I am getting a NullPointerException on the client side when I call the operation.
    With debugging of the SOAP request and responses, I get the following output:
    ---[HTTP request - http://localhost:8080/servertest/RandomTest]---
    Accept: text/xml, multipart/related
    Content-Type: text/xml; charset=utf-8
    SOAPAction: "http://services.nowhere.org/RandomTest/nextRandomRequest"
    User-Agent: JAX-WS RI 2.2.8 svn-revision#13980
    <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><S:Header><To xmlns="http://www.w3.org/2005/08/addressing">http://localhost:8080/servertest/RandomTest</To><Action xmlns="http://www.w3.org/2005/08/addressing">http://services.nowhere.org/RandomTest/nextRandomRequest</Action><ReplyTo xmlns="http://www.w3.org/2005/08/addressing">
        <Address>http://localhost:8082/servertest/RandomCallback</Address>
    </ReplyTo><FaultTo xmlns="http://www.w3.org/2005/08/addressing">
        <Address>http://localhost:8082/servertest/RandomCallbackFault</Address>
    </FaultTo><MessageID xmlns="http://www.w3.org/2005/08/addressing">uuid:bcd2f6ef-3034-49e8-b837-dbd6a772fb93</MessageID></S:Header><S:Body><ns2:nextRandom xmlns:ns2="http://services.nowhere.org/"><arg0>false</arg0></ns2:nextRandom></S:Body></S:Envelope>--------------------
    ---[HTTP response - http://localhost:8080/servertest/RandomTest - 202]---
    null: HTTP/1.1 202 Accepted
    Content-Length: 0
    Content-Type: text/xml;charset=UTF-8
    Date: Fri, 18 Jul 2014 08:34:36 GMT
    Server: Apache-Coyote/1.1
    java.lang.NullPointerException
        at com.sun.proxy.$Proxy38.nextRandom(Unknown Source)
        at test.wsclient.ClientTest.testAddressing(ClientTest.java:43)
        at test.wsclient.ClientTest.main(ClientTest.java:18)
    ---[HTTP request]---
    Cache-control: no-cache
    Host: localhost:8082
    Content-type: text/xml; charset=UTF-8
    Content-length: 704
    Connection: keep-alive
    Pragma: no-cache
    User-agent: Apache CXF 2.7.7.redhat-1
    Accept: */*
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><Action xmlns="http://www.w3.org/2005/08/addressing">http://services.nowhere.org/RandomTest/nextRandomResponse</Action><MessageID xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:65d8d7fc-09e4-494a-a9c5-0a01faf4d7e6</MessageID><To xmlns="http://www.w3.org/2005/08/addressing">http://localhost:8082/servertest/RandomCallback</To><RelatesTo xmlns="http://www.w3.org/2005/08/addressing">uuid:bcd2f6ef-3034-49e8-b837-dbd6a772fb93</RelatesTo></soap:Header><soap:Body><ns2:nextRandomResponse xmlns:ns2="http://services.nowhere.org/"><return>2870062781194370669</return></ns2:nextRandomResponse></soap:Body></soap:Envelope>--------------------
    Asynch response received
    2870062781194370669
    As you can see from the output above, the proxy is throwing an Exception when it receives the HTTP 202 response.
    Any ideas ?

    I think I have found when I get this error and probably I have found a bug. I will appreciate if someone can confirm this.
    In my BPEL project setup, my BPEL process's wsdl file imports another wsdl from different namespace. Here is sample snippet -
    <wsdl:definitions targetNamespace="http://namespace/1">
    <wsdl:import namespace="http://namespace/2" location="resources/another.wsdl"/>
    <plnk:partnerLinkType....../>
    </wsdl:definitions>
    Please let me know. I checked the bundled samples with Oracle BPEL PM and did not find any similar case where process wsdl imports another wsdl.
    Thank you.
    Meghana

  • The '$' character no more allowed in java identifier since JDK 1.4.2 ?

    Since JDK 1.4.2, I'm no more able to compile java
    sources. :-((
    Their compilation worked fine on 1.3 and 1.4.1.
    Note that these java sources are generated automatcally
    via a tool.
    <b>The $ (dollar) character seems to be no more allowed
    in java identifier.</b>
    Here is a part of the Java Language Specification (second edition):
    "An identifier is an unlimited-length sequence of Java letters and Java digits, the first of which must be a Java letter.
    An identifier cannot have the same spelling (Unicode character sequence) as a keyword (�3.9), boolean literal (�3.10.3), or the null literal (�3.10.7).
    A "Java letter" is a character for which the method
    Character.isJavaIdentifierStart returns true.
    A "Java letter-or-digit" is a character for which the method Character.isJavaIdentifierPart returns true.
    The Java letters include uppercase and lowercase ASCII Latin letters A-Z (\u0041-\u005a), and a-z (\u0061-\u007a), and, for historical reasons, the ASCII underscore (_, or \u005f) and dollar sign ($, or \u0024). The $ character should be used only in
    mechanically generated source code or, rarely, to access preexisting names on legacy systems.
    Here is the result of the Character methods on JDK 1.4.2:
    <code>
    Character.isJavaIdentifierPart('$'): true
    Character.isJavaIdentifierStart('$'): true
    </code>
    Here are two very samples java sources which reproduce
    this probleme
    <code>
    package sb;
    public interface Essai {
    public void method1(int i);
    public static class InnerClass {
    public void test() {};
    public void setInnerClass(InnerClass ic);
    package sb;
    public class EssaiImpl implements Essai {
    public void method1(int p1) {
    public void setInnerClass(sb.Essai$InnerClass p1) {
    </code>

    public void setInnerClass(sb.Essai$InnerClass p1) {There is no type named Essai$InnerClass defined anywhere in your program. That is an error in your program that previous compilers failed to detect.

  • Java Programming -- Can't Beat It!

    Is it true that the Java Programming language, with its "Write Once, Run Anywhere" promise, allows developers to easily write powerful code that can be run on any platform? Is there any other programming language that can make such a promise?

    Is it true that the Java Programming language, with
    its "Write Once, Run Anywhere" promise, allows
    developers to easily write powerful code that can be
    run on any platform? yes.
    provided, you follow certain guidelines and only use standard librarys (or deploy them with your program)
    Is there any other programming
    language that can make such a promise?no. at the moment not. and i don't think there will be one in the next few years.

  • A problem with java program(reset problem in java GUY)

    I do not know how to make the button reset,my program only could reset diagram but button.If any one who could help me to solve this problem.The problem is When the reset button is pressed, the image should immediately revert to the black square, and the 4 widgets listed above should show values that
    correspond to the black square.
    import java.awt.*;
    import javax.swing.*;
    public class DrawPanel extends JPanel {
         public final static int CIRCLE = 1, SQUARE = 2;
         private int shape;
         private boolean fill;
         private boolean showStatus;
        private int shapeSize = 100;
        private Color foreground;
         // draw a specified shape
        public void paintComponent (Graphics g){
              super.paintComponent(g);
              // find center
            int x=(getSize().width-shapeSize)/2;
              int y=(getSize().height-shapeSize)/2;
              if (shape == CIRCLE) {
                 if (fill == true){
                     g.setColor(foreground);
                      g.fillOval(x, y, shapeSize, shapeSize);
                else{
                       g.setColor(foreground);
                    g.drawOval(x, y, shapeSize, shapeSize);
              else if (shape == SQUARE){
                 if (fill == true){
                     g.setColor(foreground);
                        g.fillRect(x, y, shapeSize, shapeSize);
                else{
                        g.setColor(foreground);
                    g.drawRect(x, y, shapeSize, shapeSize);
        // set showStatus value
        public void setShowStatus (boolean s) {
              showStatus = s;
         // return showstatus value
        public boolean getShowStatus () {
              return showStatus;
         // set fill value
        public void setFill(boolean isFill) {
              fill = isFill;
         // set shape value
        public void setShape(int shapeToDraw) {
              shape = shapeToDraw;
        // set shapeSize value
        public void setShapeSize(int newShapeSize) {
              shapeSize = newShapeSize;
        // set foreground value
        public void setForeground(Color newColor) {
              foreground = newColor;
         // repaint DrawPanel
        public void draw (){
              if(showStatus == true)
              repaint();
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class shapes extends JFrame {
         private JPanel buttonPanel; // panel for buttons
         private DrawPanel myPanel;  // panel for shapes
         private JButton resetButton;
        private JComboBox colorComboBox;
         private JRadioButton circleButton, squareButton;
         private ButtonGroup radioGroup;
         private JCheckBox filledButton;
        private JSlider sizeSlider;
         private boolean isShow;
         private int shape;
         private boolean isFill=true;
        private String colorNames[] = {"black", "blue", "cyan", "darkGray", "gray",
                                   "green", "lightgray", "magenta", "orange",
                                   "pink", "red", "white", "yellow"};   // color names list in ComboBox
        private Color colors[] = {Color.black, Color.blue, Color.cyan, Color.darkGray,
                              Color.gray, Color.green, Color.lightGray, Color.magenta,
                              Color.orange, Color.pink, Color.red, Color.white, Color.yellow};
         public shapes() {
             super("Draw Shapes");
             // creat custom drawing panel
            myPanel = new DrawPanel(); // instantiate a DrawPanel object
            myPanel.setBackground(Color.white);
             // set up resetButton
            // register an event handler for resetButton's ActionEvent
            resetButton = new JButton ("reset");
             resetButton.addActionListener(
              // anonymous inner class to handle resetButton events
                 new ActionListener() {
                       // draw a black filled square shape after clicking resetButton
                     public void actionPerformed (ActionEvent event) {
                             // call DrawPanel method setShowStatus and pass an parameter
                          // to decide if show the shape
                         myPanel.setShowStatus(true);
                             isShow = myPanel.getShowStatus();
                             shape = DrawPanel.SQUARE;
                         // call DrawPanel method setShape to indicate shape to draw
                             myPanel.setShape(shape);
                         // call DrawPanel method setFill to indicate to draw a filled shape
                             myPanel.setFill(true);
                         // call DrawPanel method draw
                             myPanel.draw();
                             myPanel.setFill(true);
                             myPanel.setForeground(Color.black);
                   }// end anonymous inner class
             );// end call to addActionListener
            // set up colorComboBox
            // register event handlers for colorComboBox's ItemEvent
            colorComboBox = new JComboBox(colorNames);
            colorComboBox.setMaximumRowCount(5);
            colorComboBox.addItemListener(
                 // anonymous inner class to handle colorComboBox events
                 new ItemListener() {
                     // select shape's color
                     public void itemStateChanged(ItemEvent event) {
                         if(event.getStateChange() == ItemEvent.SELECTED)
                             // call DrawPanel method setForeground
                             // and pass an element value of colors array
                             myPanel.setForeground(colors[colorComboBox.getSelectedIndex()]);
                        myPanel.draw();
                }// end anonymous inner class
            ); // end call to addItemListener
            // set up a pair of RadioButtons
            // register an event handler for RadioButtons' ItemEvent
             squareButton = new JRadioButton ("Square", true);
             circleButton = new JRadioButton ("Circle", false);
             radioGroup = new ButtonGroup();
             radioGroup.add(squareButton);
             radioGroup.add(circleButton);
            squareButton.addItemListener(
                // anonymous inner class to handle squareButton events
                new ItemListener() {
                       public void itemStateChanged (ItemEvent event) {
                           if (isShow==true) {
                                 shape = DrawPanel.SQUARE;
                                 myPanel.setShape(shape);
                                 myPanel.draw();
                   }// end anonymous inner class
             );// end call to addItemListener
             circleButton.addItemListener(
                   // anonymous inner class to handle circleButton events
                new ItemListener() {
                       public void itemStateChanged (ItemEvent event) {
                             if (isShow==true) {
                                 shape = DrawPanel.CIRCLE;
                                 myPanel.setShape(shape);
                                 myPanel.draw();
                             else
                                 System.out.println("Please click Reset button first");
                   }// end anonymous inner class
             );// end call to addItemListener
             // set up filledButton
            // register an event handler for filledButton's ItemEvent
            filledButton = new JCheckBox("Filled", true);
             filledButton.addItemListener(
              // anonymous inner class to handle filledButton events
            new ItemListener() {
                  public void itemStateChanged (ItemEvent event) {
                    if (isShow==true) {
                            if (event.getStateChange() == ItemEvent.SELECTED) {
                                  isFill=true;
                                  myPanel.setFill(isFill);
                                  myPanel.draw();
                            else {
                                isFill=false;
                                  myPanel.setFill(isFill);
                                  myPanel.draw();
                    else
                        System.out.println("Please click Reset button first");
              }// end anonymous inner class
             );// end call to addItemListener
            // set up sizeSlider
            // register an event handler for sizeSlider's ChangeEvent
            sizeSlider = new JSlider(SwingConstants.HORIZONTAL, 0, 300, 100);
            sizeSlider.setMajorTickSpacing(10);
            sizeSlider.setPaintTicks(true);
            sizeSlider.addChangeListener(
                 // anonymous inner class to handle sizeSlider events
                 new ChangeListener() {
                      public void stateChanged(ChangeEvent event) {
                          myPanel.setShapeSize(sizeSlider.getValue());
                             myPanel.draw();
                 }// end anonymous inner class
             );// end call to addChangeListener
            // set up panel containing buttons
             buttonPanel = new JPanel();
            buttonPanel.setLayout(new GridLayout(4, 1, 0, 50));
             buttonPanel.add(resetButton);
             buttonPanel.add(filledButton);
            buttonPanel.add(colorComboBox);
            JPanel radioButtonPanel = new JPanel();
            radioButtonPanel.setLayout(new GridLayout(2, 1, 0, 20));
            radioButtonPanel.add(squareButton);
            radioButtonPanel.add(circleButton);
            buttonPanel.add(radioButtonPanel);
            // attach button panel & draw panel to content panel
            Container container = getContentPane();
            container.setLayout(new BorderLayout(10,10));
            container.add(myPanel, BorderLayout.CENTER);
             container.add(buttonPanel, BorderLayout.EAST);
            container.add(sizeSlider, BorderLayout.SOUTH);
            setSize(500, 400);
             setVisible(true);
         public static void main(String args[]) {
             shapes application = new shapes();
             application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }Many thanks

    Who is this Java guy anyway?

  • How to pass attribute of type java.util.ArrayList Property to a Tag

    How do I pass an attribute of type, java.util.ArrayList<my.entity.Property> to a Tag implementation class?
    Please advise!
    Thanks,
    Joe
    package my.tags;
    import java.io.IOException;
    import java.util.ArrayList;
    import javax.servlet.jsp.tagext.SimpleTagSupport;
    import javax.servlet.jsp.JspException;
    import my.entity.Property;
    public class PropertiesTag extends SimpleTagSupport {
        private ArrayList<Property> properties;
        public void setProperties(ArrayList<Property> properties) {
              this.properties = properties;
         public void doTag() throws JspException, IOException {
    <?xml version="1.0" encoding="utf-8" ?>
    <taglib ...>
         <tag>
              <name>propertiesTag</name>
              <tag-class>my.tags.PropertiesTag</tag-class>
              <body-content>empty</body-content>
              <description>Displays the product selection left menu</description>
              <attribute>
                   <name>properties</name>
                   <required>true</required>
                   <rtexprvalue>true</rtexprvalue>
                   <type>java.util.ArrayList<my.entity.Property></type>
              </attribute>
         </tag>
    </taglib>Here's the error message:
    org.xml.sax.SAXParseException: The element type "my.entity.Property" must be terminated by the matching end-tag "</my.entity.Property>".

    802826 wrote:
    How do I pass an attribute of type, java.util.ArrayList<my.entity.Property> to a Tag implementation class?
    Please advise!
    As already pointed out, there is no way to specify a generic type in a tag library descriptor. You may however specify an Object type in your tld and still have the variable in your tag as a parameterized generic type.
    In your tld change the type to Object.
    <type>java.lang.Object</type>.
    The properties tag itself needs no change and can continue to use parameterized types.
    cheers,
    ram.

  • Dynamically refresh jspx component(i.e af:outputText) based on Java

    Scenario : To update my marquee OutputText value based on Table value change
    I have a requirement like, based on db table value change one of my component has to be refreshed from my server program(i.e java).
    I got the event using DataUpdateEventListener from DB that some changed has been occurred on my table, and the value is set to true on my java class...
    Problem
    Using that true value i have to get the component(i.e af:outputText) from jspx (note: which is not in the region) and refresh the component so that my output value will be updated.
    Any one of you have any idea abut this problem please suggest
    Thanks in advance
    Karthik

    Check my blog http://tompeez.wordpress.com/2013/03/24/jdeveloper-11-1-1-6-0-self-closing-popup/ which shows how to use a poll component on a page. As the use case is to only call hte bean methos once you have to change the implementation in a way that you don't reset the timeout, but leave is as is so that the poll listener is called periodically.
    Timo
    Edited by: Timo Hahn on 13.05.2013 09:23
    I found this video from Shay Shmeltzer showing how to use the poll component: https://blogs.oracle.com/shay/entry/using_the_afpoll_to_refresh_pa

Maybe you are looking for

  • EASY Document Management System

    Hi, I am new to DMS and I want to learn Easy DMS. I checked the sap library but still not clear. So can any one tell me what are the steps there to start and how to link eDMS and SAP. Thanks in advance Regards, Ravikanth.

  • Address Book Notes is deleting data....

    I've used OS X for years and never been stumped like this before. I use Address Book, have it synced with MobileMe and also synced to my iPhone. Today I was adding notes to a Contact under the note field and the notes kept disappearing. Strangely it

  • I want to run a program on my ipad that runs on my mac using the terminal

    I have a prgram that I can run in terminal on my mac.  I would like to be able to run it on my iPad.  Is that possible?

  • IE7 vs IE9 - any reason to update specific to Captivate?

    I am listing minimum requirements to use Captivate training.  MANY users have IE 7 and it would be a monumental task to upgrade them all right now UNLESS their is a specific browser version problem with IE7.  Does anyone know of any problems?  If so,

  • Can't open premiere projects.

    Everytime I try to open a premiere pro prpoject I get this message - "This project contained a sequence that could not be opened. No sequence preview preset file or codec could be associated with this sequence type." I have already opened and worked