Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!

sreenivas jeenor

Ranch Hand
+ Follow
since Jan 09, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sreenivas jeenor


I use the class javax.tools.JavaCompiler (jdk6) to compile a dynamic source file, but the source file depends on some jar file.how should i do it.

here is my code



here the code shows compile time errors for import files.


How to add jar files to compile my java file
7 years ago
lines 5 and 6 accept only PrintStream object.
8 years ago
Hi ,


I am working on ANT.my requirement is to display Ant output on HTML/Jsp page.

normally i am using Ant project to execute the build file.

here is the code-my program runs and shows ant build results/errors in the console,but i want them to be stored on a string and then use that in jsp page.



help me

Thanks
Srinivas
8 years ago

hi ,

i am getting the following error when using session.doWork

here is the code






error


org.hibernate.exception.GenericJDBCException: error executing work
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
at org.hibernate.impl.SessionImpl.doWork(SessionImpl.java:1991)
at com.coromandel.ers.daos.impl.AdminDAOImpl.getLocalProcTest(AdminDAOImpl.java:403)
at com.coromandel.ers.services.impl.AdminServicesImpl.getLocalProcTest(AdminServicesImpl.java:113)
at com.coromandel.ers.actions.ReportsAction.getReportDetails(ReportsAction.java:223)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: Callable statments not supported.
at com.mysql.jdbc.Connection.prepareCall(Connection.java:1282)
at org.apache.commons.dbcp.DelegatingConnection.prepareCall(DelegatingConnection.java:212)
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareCall(PoolingDataSource.java:268)
at com.coromandel.ers.daos.impl.AdminDAOImpl$1.execute(AdminDAOImpl.java:408)
at org.hibernate.impl.SessionImpl.doWork(SessionImpl.java:1987)
... 72 more

here is my procedure in Mysql

DROP PROCEDURE IF EXISTS ers_schema.GetLocReport;
CREATE PROCEDURE ers_schema.`GetLocReport`(OUT res int,IN status int)
BEGIN
select count(*) into res from localmap v where v.statusid=status;
END;

here is my entity




myDAO is here



i am getting the following error

org.springframework.dao.TransientDataAccessResourceException: Hibernate
operation:
could not execute query; SQL [call GetLocReport(?, ?)]; Callable statments
not supported.; nested exception is java.sql.SQLException: Callable
statments not supported.
8 years ago
hi,

i am using file upload interceptor for file uploads.
If i mention a static path the file is getting stored in that location. if i mention the path using context.getRealPath("/"); it is storing in eclipse workshop internal .
folders.The Eclipse workspace is in D: folder. My application name is Struts2proj and the actual file should be stored in Struts2proj/Images.
but when i print the filepath it is showing in this way " D:\Workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Struts2proj\Images"

here is the code

import java.io.File;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.io.FileUtils;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.util.ServletContextAware;

import com.opensymphony.xwork2.ActionSupport;

public class FileUploadAction extends ActionSupport implements ServletContextAware,
ServletRequestAware {
private File userImage;
private String userImageContentType;
private String userImageFileName;

private HttpServletRequest servletRequest;
// ServletContext context = ServletActionContext.getServletContext();
ServletContext context;

public void setServletContext(ServletContext context) {
this.context = context;
}


public String execute() {
try {

String filePath = context.getRealPath("/")+"Images";

System.out.println("Server path:" + filePath);

File fileToCreate = new File(filePath, this.userImageFileName);

FileUtils.copyFile(this.userImage, fileToCreate);


} catch (Exception e) {
e.printStackTrace();
addActionError(e.getMessage());

return INPUT;
}
return SUCCESS;
}

public File getUserImage() {
return userImage;
}

public void setUserImage(File userImage) {
this.userImage = userImage;
}

public String getUserImageContentType() {
return userImageContentType;
}

public void setUserImageContentType(String userImageContentType) {
this.userImageContentType = userImageContentType;
}

public String getUserImageFileName() {
return userImageFileName;
}

public void setUserImageFileName(String userImageFileName) {
this.userImageFileName = userImageFileName;
}

@Override
public void setServletRequest(HttpServletRequest servletRequest) {
this.servletRequest = servletRequest;

}
}



help me out

Thanks
8 years ago
private Type data;

here is



its shows an error java.lang.ClassCastException: GenericComposite cannot be cast
to CWE
9 years ago
Returns the data contained by this instance of Varies. Returns a GenericPrimitive unless setData() has been called.
9 years ago
Hi ,

i am working on this code.

how to achieve runtime casting for the following code


Similarly other classes like XPN, XCN implements composite.

in the Main file the code is..
-----------------------


--------------------

help me...
9 years ago
hi,

i want to pass values from Jsp to applet and to read them in applet code

here is my code

<%String empid= request.getParameter("ID");%>

<jsp:plugin type="applet"
code="applet/PrintApplet.class"
codebase="http://localhost:8080/myadmin";
jreversion="1.6.0"
archive="http://localhost:8080/myadmin/PrintApplet.jar";
name="PrintApplet"
width="520"
height="520">
<jsp:params>
<jsp:param name="empID" value="<%=empid%>">
</jsp:params>
<jsp:fallback> Your browser do not support applets! </jsp:fallback>
</jsp:plugin>


the following is the error

org.apache.jasper.JasperException: /CaptureFinger.jsp(122,36) The <jsp:param tag can only have jsp:attribute in its body.
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:130)
9 years ago
hi guys,

when i run the applet with database connection , the applet is loaded but nothing is displayed. I receive the following message in java console:
"java.lang.ClassNotFoundException: com.mysql.jdbc.Driver"

i am using the jsp plugin tag,even loading the jar file

<jsp:plugin type="applet"
code="applet/MyApplet.class"
codebase="http://localhost:8080/AppletExample";
jreversion="1.6.0"
archive="http://localhost:8080/AppletExample/lib/mysql-connector-java-3.0.16-ga-bin.jar";
name="MyApplet"
width="520"
height="520">
<jsp:fallback> Your browser do not support applets! </jsp:fallback>
</jsp:plugin>
9 years ago
What I am doing is capturing a biometric information ,returns a byte[] so I needed to convert it from
byte[] to a string that I could set as a url parameter and passing it as url parameter, so &m=(biometric info).

in the receiving servlet , i am able to decode to string.
my question is how how to get the actual byte array value in the servlet.

9 years ago
My Requirement: access session variable(a) in applet and add new variable(b) in applet then forward back to servlet and store both values in database.
9 years ago
hi anbarasu,

here i dont want an common exception page.

what i want is when response.redirect() is failed due to error then the exceptionHandler.jsp should be called.

but this is not happening.instead of opening exceptionHandler.jsp it shows HTTP 404

10 years ago
JSP
Hi

i have a condition where an URL is manipulated or changed wantedly. i have to catch the error and move to error page. but the error page is never called.

I am using response.sendRedirect("MyURL"); in the jsp page. If the URL is correct its working fine.

If i manipulate the URL and use the command it shows HTTP 404 error in the same page but not calling the error page

here is my code.help me out
10 years ago
JSP