Showing posts from September, 2012

Struts 2 : Warning :No configuration found for the specified action: 'Login.action' in namespace: '/'

No configuration found for the specified action: 'Login.action' in namespace: '/'''. Form action defaulting to 'action' attribute's literal value.

Solution:To remove this warning you need to change following...

See your struts.xml file what name you have specified...

If you are using namespace / and your action name is 'Login' then  replace Login.action to Login as given below...

<s:form action="Login.action" method="post" > 

 Use below with namespace 

1) <s:form action="Login" method="post" namespace="/"> 


 2) <s:form action="/Login" method="post" > 

 Now you will not get this warning.

Google App Engine: Java mail API : Mail failed

Uncaught exception from servlet java.lang.SecurityException: SHA1 digest error for com/sun/mail/smtp/SMTPTransport.class at at at java.util.jar.JarVerifier.processEntry( at java.util.jar.JarVerifier.update( at java.util.jar.JarVerifier$ at sun.misc.Resource.getBytes( at at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke( at java.lang.reflect.Method.invoke( at java.lang.ClassLoader.loadClass( at javax.mail.Session.getService( at javax.mail.Session.getTransport( at javax.mail.Session.getTranspo…

Google App engine :Struts 2 : There is no Action mapped for namespace [/] and action name .

here is a code from my web.xml


where index.jsp is redirected to a struts 2 action...

But when I access http://localhost:8888 I received the error below:

There is no Action mapped for namespace [/] and action name .


Solution:   Please edit your struts.xml and enter this action as last action( only after all actions as a default action).

<action name="*">
           <result type="redirectAction">
             <param name="actionName">Home.action</param>

Now this must be the last action and it will work like a default action for your application.

Google App Engine: java.lang.RuntimeException:

java.lang.RuntimeException: com.example.web.dto.SessionObjectDTO
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(
at org.mortbay.jetty.servlet.ServletHandler.handle(

Hibernate with Struts 2 : Warning : javax.naming.NamingException

[13-09-2012 16:25:41] [WARN ] - Could not bind factory to JNDI
javax.naming.NamingException: Name is not valid
at org.apache.naming.NamingContext.bind(
at org.apache.naming.NamingContext.rebind(
at org.apache.naming.SelectorContext.rebind(
at javax.naming.InitialContext.rebind(
at org.hibernate.util.NamingHelper.bind(
at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(
at org.hibernate.impl.SessionFactoryImpl.<init>(
at org.hibernate.cfg.Configuration.buildSessionFactory(
at com.example.persistence.dao.impl.HibernateConnection.<init>(
at com.example.persistence.dao.impl.HibernateConnection.<init>(
at com.example.persistence.dao.impl.HibernateConnection.getInstance(
at com.example.persis…

Java IO Package: Convert byte[] data array to InputStream

If you want to make InputStream using data array of bytes like byte [], you can use following,
Let's suppose your file data is copied in following byte array.

byte []  newImageData contains all data which have been read from some file.
InputStream inputStream = new ByteArrayInputStream(newImageData);

Google App engine: Image Scaling

You can use following app engine classes to resize images using Java.


public byte[] resizedImage(byte[] oldImageData,int width,int height) throws IOException{

ImagesService imagesService = ImagesServiceFactory.getImagesService();
        Image oldImage = ImagesServiceFactory.makeImage(oldImageData);":oldImage height:"+oldImage.getHeight()+" and width:"+oldImage.getWidth());
  Transform resize = ImagesServiceFactory.makeResize(width,height);
        Image newImage = imagesService.applyTransform(resize, oldImage);
        byte[] newImageData = newImage.getImageData();…

Upload file on Google cloud storage using Java servlet on google app engine

Hopefully you have configured all jars and settings to run and deploy your project on google app engine using eclipse,

if not then visit google app engine-->google cloud storage java api link..

1) index.html

      <form action="" method="post" enctype="multipart/form-data">
         <p> Please write a file to test cloud storage... </p>
         <input type="file" name="cloudFile" />
         <input type="submit" value="Write a  file on cloud Storage">

2) web.xml

<?xml vers…