Wednesday, March 16, 2011

Add external jar while building with ant tool

Just add binaryLibraries in <build> tag with jars separated by ; symbol.

Tuesday, February 15, 2011

Obfuscation problem while deploying J2mePolish App Jar in Web Application

To decrease the size of mobile application in J2ME Polish, it uses obfuscator(Proguard). It renames all the generated classes in it's own way. While deploying the same jar in web application, we cannot use the class name of app.

Eg. We use UseDTO class in J2ME Polish, then it is renamed as aa.class by Proguard.

To overcome the solution, use 'keep' option of obfuscator in build.xml file of J2ME Polish app.

<obfuscator name="Proguard" unless="test">
    <keep class="com.abc.UseDTO">
</obfuscator>


What the above statement does is obfuscate all the class except UserDTO.

Now you can use UserDTO class in web application or any other project.

Thanks

Thursday, December 2, 2010

Tomcat Start Problem After Successful Installation in Windows

After installing Tomcat Server in Windows, Tomcat couldnot be restarted. In it's log file, following error is logged.

[2010-12-03 12:17:20] [986 prunsrv.c] [error] Failed creating java C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll

.................





Solution :: Just copy msvcr71.dll file located in c:\Programs Files\Java\jdk1.6.0\bin to C:\Windows\system32 folder.

Now try to start Tomcat Server. Your problem should be solved now.

Wednesday, November 10, 2010

Netbeans + Ubuntu - Caused: java.io.IOException: read past EOF

I had unexpected shutdown of my PC due to power failure. After I restarted my PC and opened the Netbeans (version 6.7.1), I got error
java.io.IOException : Caused: java.io.IOException: read past EOF.
Due to it I couldnot be able to auto complete the code.


For the above mentioned problem, I found a simple solution.


JUST REMOVE THE .netbeans folder in ur home directory.

Thanks

Wednesday, October 20, 2010

Phpmyadmin login problem

I have started my MySQL server. I can successfully login using the command line. ie..,

mysql> mysql -u root -p password
However, I couldnot login in phpmyadmin with the same username and password.


The solution to above problem is ...

1. Open the hosts.allow file in /etc directory.
$sudo vim /etc/hosts.allow

2. Add the following line in it.
mysqld: 127.0.0.1: ALLOW

Then, u can successfully login in phpmyadmin.

Thanks.

Friday, June 11, 2010

Handle KeyPress Event in List

Let's take a scenario, where we provide the feature for user to select an option from the given list of options and press RIGHT key in the mobile to select that option. To implement this scenario in J2ME, we don't have other options but to use Canvas Class to track which key is pressed by the user.

However, we can implement this feature in J2MEPolish easily. For that we need to use the class de.enough.polish.ui.List and override the method " public void keyPressed(int keyCode)" in the List. However don't forget to override this method by "super.keyPressed(code)".

:-))

Loving J2MEPolish !! ;-)

Tuesday, April 27, 2010

Cannot call actionListener method on <a4j:commandLink/> with javascript

If you have problem with calling the actionListener method in JSF with 4j:commandLink and the javascript method for validation ...

javascript code ::

function confirmAdd(){

var flag=false;

if(confirm("Are you sure to add ??")){
flag=true;
}

}

and the JSF a4j:commandLink ::
<a4j:commandlink actionlistener="#{bean.addValues}" value="AddConfirm" onclick="return confirmAdd();" ajaxsingle="true">
<f:param value="#{bean.value}"/>
</a4j:commandLink>

then the method addValues in actionListener is not called ..

For that the Solution is ::

<a4j:commandlink actionlistener="#{bean.addValues}" value="AddConfirm" onclick="if(!confirmAdd()){return false;}" ajaxsingle="true">
<f:param value="#{bean.value}"/>
</a4j:commandLink>

then the method addValues in actionListener get called and the values are added.