SCJP designation introduced 10 years ago. Now there is no longer a Sun Certified Java Professional (SCJP) designation. Instead, the new vernacular is OCP, standing for Oracle Certified Professional.

At the most fundamental level, the JDK version being tested has been updated. The latest incarnation of the Java Professional designation from Oracle will be testing candidates on version 1.7 of the JDK, not Java 5 or Java 6, as the previous examinations did.

Other change to obtain certification is now two step process, which starts first with passing the Oracle Certified Associate exam, or as it’s referred to on Oracle’s certification site, the Java SE 7 Programmer I test. Once you pass the new Associate exam, you are then qualified to write the Java SE 7 Programmer II exam, and if you pass that, you’ll have gained your Java ProfessionaL designation


share on: facebook
Saturday, December 10, 2011

HTML5 Quick Learning Guide


share on: facebook
Monday, July 25, 2011

Channel in BlazeDS

What is Channel

Channels are Client side objects that encapsulate the connection behaviour between flex components and blazeds server.

What Channel will do



  • Channel formats and translates the message into a network specific form.

  • Channel communicates with corresponding end points on the BlazeDS server.

  • Channels impose an order to the flow of messages sent to the server and the order of corresponding responses to ensure that the interaction between the client and server occurs in a consistent and predictable fashion.

Where to configure channel


We define channels and endpoints in services-config.xml file


How to configure channel
<channels>
...
<channel-definition id="my-amf"
type="mx.messaging.channels.AMFChannel">
<endpoint url="http://servername:port/myapp/messagebroker/amf"
type="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>
</channels>



share on: facebook
Saturday, October 9, 2010

Failed launch Flash Player - Flex Mojos

When I am working with Maven and Flex with FlexMojos I come across the below error.


+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building firstApp Flex
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] [flexmojos:compile-swf {execution: default-compile-swf}]
[INFO] Flexmojos 3.7
[INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[WARNING] Source file was not defined, flexmojos will guess one.
[INFO] Flex compiler configurations:
-compiler.accessible=false
-compiler.actionscript-file-encoding UTF-8
-compiler.allow-source-path-overlap=false
-compiler.as3=true
-compiler.debug=false
-compiler.es=false
-compiler.external-library-path E:\raghava\firstApp\target\classes\libraries\pla
yerglobal-9.swc
-compiler.fonts.local-fonts-snapshot E:\raghava\firstApp\target\classes\fonts.se
r
-compiler.fonts.managers flash.fonts.JREFontManager flash.fonts.AFEFontManager f
lash.fonts.BatikFontManager
-compiler.headless-server=false
-compiler.include-libraries=
-compiler.keep-all-type-selectors=false
-compiler.keep-generated-actionscript=false
-compiler.library-path E:\raghava\firstApp\target\classes\libraries\flex.swc E:\
raghava\firstApp\target\classes\libraries\framework.swc E:\raghava\firstApp\targ
et\classes\libraries\rpc.swc E:\raghava\firstApp\target\classes\libraries\utilit
ies.swc D:\Documents and Settings\Jagadesh\.m2\repository\com\adobe\flex\framewo
rk\framework\3.2.0.3958\framework-3.2.0.3958-en_US.rb.swc D:\Documents and Setti
ngs\Jagadesh\.m2\repository\com\adobe\flex\framework\rpc\3.2.0.3958\rpc-3.2.0.39
58-en_US.rb.swc
-compiler.locale en_US
-compiler.namespaces.namespace http://www.adobe.com/2006/mxml E:\raghava\firstAp
p\target\classes\config-3.2.0.3958\mxml-manifest.xml
-compiler.optimize=true
-compiler.source-path E:\raghava\firstApp\src\main\flex
-compiler.strict=true
-compiler.use-resource-bundle-metadata=true
-compiler.verbose-stacktraces=false
-default-background-color 8821927
-default-frame-rate 24
-default-script-limits 1000 60
-default-size 500 375
-metadata.date Sat Oct 09 09:40:02 PDT 2010
-metadata.localized-title firstApp Flex x-default
-target-player 9.0.0
-use-network=true
-verify-digests=true -static-link-runtime-shared-libraries=false -load-config=
-metadata.language+=en_US
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory E:\raghava\firstApp\src\test\resource
s
[INFO] [flexmojos:test-compile {execution: default-test-compile}]
[INFO] Flexmojos 3.7
[INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[WARNING] Test folder not foundE:\raghava\firstApp\src\test\java
[INFO] [flexmojos:test-run {execution: default-test-run}]
[INFO] Flexmojos 3.7
[INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[INFO] Running tests E:\raghava\firstApp\target\test-classes\TestRunner.swf
[WARNING] [LAUNCHER] Using regular flashplayer tests
[INFO] ------------------------------------------------------------------------
[INFO] Tests run: 0, Failures: 0, Errors: 0, Time Elapsed: 0 sec
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Accept timed outE:\raghava\firstApp\target\test-classes\TestRunner.swf

[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Accept timed outE:\ragha
va\firstApp\target\test-classes\TestRunner.swf
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:6
0)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Accept timed outE:\ra
ghava\firstApp\target\test-classes\TestRunner.swf
at org.sonatype.flexmojos.test.FlexUnitMojo.tearDown(FlexUnitMojo.java:3
15)
at org.sonatype.flexmojos.test.FlexUnitMojo.execute(FlexUnitMojo.java:16
5)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:694)
... 17 more
Caused by: org.sonatype.flexmojos.test.TestRunnerException: Accept timed outE:\r
aghava\firstApp\target\test-classes\TestRunner.swf
at org.sonatype.flexmojos.test.DefaultTestRunner.run(DefaultTestRunner.j
ava:87)
at org.sonatype.flexmojos.test.FlexUnitMojo.run(FlexUnitMojo.java:279)
at org.sonatype.flexmojos.test.FlexUnitMojo.execute(FlexUnitMojo.java:16
4)
... 19 more
Caused by: java.net.SocketTimeoutException: Accept timed out
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
at java.net.ServerSocket.implAccept(ServerSocket.java:450)
at java.net.ServerSocket.accept(ServerSocket.java:421)
at org.sonatype.flexmojos.test.monitor.AbstractSocketThread.openClientSo
cket(AbstractSocketThread.java:124)
at org.sonatype.flexmojos.test.monitor.AbstractSocketThread.run(Abstract
SocketThread.java:62)
at java.lang.Thread.run(Thread.java:595)
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 53 seconds
[INFO] Finished at: Sat Oct 09 09:40:27 PDT 2010
[INFO] Final Memory: 20M/63M
[INFO] ------------------------------------------------------------------------
E:\raghava\firstApp>mvn -e install
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building firstApp Flex
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] [flexmojos:compile-swf {execution: default-compile-swf}]
[INFO] Flexmojos 3.7
[INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[WARNING] Source file was not defined, flexmojos will guess one.
[INFO] Flex compiler configurations:
-compiler.accessible=false
-compiler.actionscript-file-encoding UTF-8
-compiler.allow-source-path-overlap=false
-compiler.as3=true
-compiler.debug=false
-compiler.es=false
-compiler.external-library-path E:\raghava\firstApp\target\classes\libraries\pla
yerglobal-9.swc
-compiler.fonts.local-fonts-snapshot E:\raghava\firstApp\target\classes\fonts.se
r
-compiler.fonts.managers flash.fonts.JREFontManager flash.fonts.AFEFontManager f
lash.fonts.BatikFontManager
-compiler.headless-server=false
-compiler.include-libraries=
-compiler.keep-all-type-selectors=false
-compiler.keep-generated-actionscript=false
-compiler.library-path E:\raghava\firstApp\target\classes\libraries\flex.swc E:\
raghava\firstApp\target\classes\libraries\framework.swc E:\raghava\firstApp\targ
et\classes\libraries\rpc.swc E:\raghava\firstApp\target\classes\libraries\utilit
ies.swc D:\Documents and Settings\Jagadesh\.m2\repository\com\adobe\flex\framewo
rk\framework\3.2.0.3958\framework-3.2.0.3958-en_US.rb.swc D:\Documents and Setti
ngs\Jagadesh\.m2\repository\com\adobe\flex\framework\rpc\3.2.0.3958\rpc-3.2.0.39
58-en_US.rb.swc
-compiler.locale en_US
-compiler.namespaces.namespace http://www.adobe.com/2006/mxml E:\raghava\firstAp
p\target\classes\config-3.2.0.3958\mxml-manifest.xml
-compiler.optimize=true
-compiler.source-path E:\raghava\firstApp\src\main\flex
-compiler.strict=true
-compiler.use-resource-bundle-metadata=true
-compiler.verbose-stacktraces=false
-default-background-color 8821927
-default-frame-rate 24
-default-script-limits 1000 60
-default-size 500 375
-metadata.date Sat Oct 09 09:50:02 PDT 2010
-metadata.localized-title firstApp Flex x-default
-target-player 9.0.0
-use-network=true
-verify-digests=true -static-link-runtime-shared-libraries=false -load-config=
-metadata.language+=en_US
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory E:\raghava\firstApp\src\test\resource
s
[INFO] [flexmojos:test-compile {execution: default-test-compile}]
[INFO] Flexmojos 3.7
[INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[WARNING] Test folder not foundE:\raghava\firstApp\src\test\java
[INFO] [flexmojos:test-run {execution: default-test-run}]
[INFO] Flexmojos 3.7
[INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[INFO] Running tests E:\raghava\firstApp\target\test-classes\TestRunner.swf
[WARNING] [LAUNCHER] Using regular flashplayer tests
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to launch Flash Player. Probably java was not able to find flashp
layer.
Make sure flashplayer is available on PATH
or use -DflashPlayer.command=${flashplayer executable}
Read more at: https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests

CreateProcess: FlashPlayer.exe E:\raghava\firstApp\target\test-classes\TestRunne
r.swf error=2
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to launch Flash P
layer. Probably java was not able to find flashplayer.
Make sure flashplayer is available on PATH
or use -DflashPlayer.command=${flashplayer executable}
Read more at: https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:6
0)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to launch Flas
h Player. Probably java was not able to find flashplayer.
Make sure flashplayer is available on PATH
or use -DflashPlayer.command=${flashplayer executable}
Read more at: https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests
at org.sonatype.flexmojos.test.FlexUnitMojo.run(FlexUnitMojo.java:291)
at org.sonatype.flexmojos.test.FlexUnitMojo.execute(FlexUnitMojo.java:16
4)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:694)
... 17 more
Caused by: org.sonatype.flexmojos.test.launcher.LaunchFlashPlayerException: Fail
ed to launch Flash Player.
at org.sonatype.flexmojos.test.launcher.AsVmLauncher.runFlashplayer(AsVm
Launcher.java:126)
at org.sonatype.flexmojos.test.launcher.AsVmLauncher.start(AsVmLauncher.
java:102)
at org.sonatype.flexmojos.test.DefaultTestRunner.run(DefaultTestRunner.j
ava:75)
at org.sonatype.flexmojos.test.FlexUnitMojo.run(FlexUnitMojo.java:279)
... 20 more
Caused by: java.io.IOException: CreateProcess: FlashPlayer.exe E:\raghava\firstA
pp\target\test-classes\TestRunner.swf error=2
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.(ProcessImpl.java:81)
at java.lang.ProcessImpl.start(ProcessImpl.java:30)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
at java.lang.Runtime.exec(Runtime.java:591)
at java.lang.Runtime.exec(Runtime.java:464)
at org.sonatype.flexmojos.test.launcher.AsVmLauncher.runFlashplayer(AsVm
Launcher.java:122)
... 23 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 35 seconds
[INFO] Finished at: Sat Oct 09 09:50:08 PDT 2010
[INFO] Final Memory: 20M/63M
[INFO] ------------------------------------------------------------------------

As per the life cycle mojos trying to run unit test and unable to find flashplayer. To resolve this I have downloaded flashplayer exe file added to PATH. Again I got the same problem. Now I renamed the download flashplayer name to flashplayer.exe, my build completed successfully.


share on: facebook

It is a good practice to use int in place of Number if the type int can able to satisfy your requirements. First we will see the difference between int,uint and Number.

  • uint - values ranging from 0 to 4,294,967,29 (positive numbers)
  • int - values ranging from -2,147,483,648 to 2,147,483,647
  • Number -can have values ranging far beyond int and uint and can include a decimal point
Among above three int type is faster follwed by Number. In looping always use int in place of Number.

Avoid:

var l:int = myArray.length;
for(var i:Number=0; i<l;i++>
{
............
}
Use:
var l:int = myArray.length;
for(var i:int=0; i<l;i++>
{
............
}


share on: facebook
Saturday, August 21, 2010

Flex ArrayList vs ArrayCollection

Flex 4 introduced new collection ArrayList. ArrayList and ArrayCollection both are used to manipulate and store listdata. The key differences between ArrayList and ArrayCollection are

  • ArrayList is lighter version of ArrayCollection
  • With ArrayCollection we can sort and filter listdata and it is not possible with ArrayList


share on: facebook

Flash Player and AIR use a technique called garbage collection to clear objects from memory that are no longer in use. An object is considered no longer in use if no references to it exist. The garbage collector disregards weak references, which means that a listener function that has only a weak reference pointing to it is eligible for garbage collection.

In Action Script, we use addEventListener method to attach an event listener. It includes the bellow parameters:

eventName:String,
listener:Object,
useCapture:Boolean=false,
priority:Integer=0,
useWeakReference:Boolean=false

The useWeakReference parameter allows us to specify whether the reference to the listener function is weak or normal. Setting this parameter to true allows us to avoid situations in which listener functions persist in memory even
though they are no longer needed.

For example:

btn.addEventListener(MouseEvent.CLICK, clickHandler,false,0,true);


share on: facebook