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.

Wednesday, January 6, 2010

Ubuntu 9.10 and Samba Shares (testparm error)

Recently I got this error when trying to share a folder from within my Home folder in Ubuntu 9.10 (Karmic Koala) :

Failed to execute child process "testparm" (No such file or directory)

The fix was extremely simple – just install ’samba-common-bin’ with the command.

$ sudo apt-get install samba-common-bin

Then, there you are done.

No reboot is needed, just go back to your folder and share it again.

Sunday, January 3, 2010

passing parameter through h:commandButton in JSF

In JSF, <h:commandButton> doesnot support <f:param> so that we cannot use it to pass parameter. However, it is supported in <h:commandLink> . So, in order to pass parameter through , <h:commandButton> we can use <f:attribute> . An example is shown to demonstrate this:

<h:commandButton actionListener=#{bean.callAction}/>
<f:attribute name="parameterName" value="parameterValue"/>
</h:commandButton>

In backing bean,

public void callAction(ActionEvent ae){
String paramValue = (String) ae.getComponent().getAttributes().get("parameterName");
System.out.println("Parameter value is :: "+paramValue);
}

The output is -
Parameter value is :: parameterValue

which is in the value attribute of f:attribute tag.