Kurinchi Blogger Scribbles …


Archive for the ‘Java’ Category

May 20
2011

JAVA: public class naming

Last updated: January 2nd, 2012

A JAVA program file can only contain one public java class and this should be named the same as the java file itself.

There can be any number of classes with / without other modifiers.

Classes without any modifiers will get compiled even if the name of the class does not match the name of the java program file.
(more…)

Feb 15
2011

Netbeans: Authentication required dialog box requesting user name and password

Last updated: March 13th, 2011

If a user role and his credentials are not set or is incorrect for Tomcat startup via NetBeans IDE you will get this dialog box opened

i) First check the Netbeans configuration settings Open Tools > Server

ii) Base path for Catalina will be set in the General tab andn it will be of the form \CATALINA_BASE\conf\tomcat-users.xml. Check if a user and his role is defined as stated in the below syntax. If not add these lines

<role rolename=”manager”/>
<user username=”tomcat” password=”secured” roles=”manager”/>

iii) In Tools > Server > General tab enter the username and password stated in the tomcat-users.xml file and this will stop the Netbeans IDE from asking you the name and password

Feb 14
2011

To debug struts, add the below line in the struts.xml file

Last updated: March 13th, 2011

//struts.xml
<struts>
<constant name=”struts.devMode” value=”true” />
…..
</struts>

Feb 13
2011

Netbeans: HTTP Status 404 – There is no Action mapped for namespace / and action name

Last updated: March 13th, 2011

i) Check where struts.xml is defined – Path where the file exists. In netbeans, easy way to do this to add the struts.xml file to package folder.

ii) Check if the correct namespace is added in the struts.xml

iii) Check if the package name is given correctly for the class in execution.


Valid HTML 4.01 Strict  Valid HTML 4.01 Strict