db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@eurix.it
Subject NullPointerException
Date Fri, 09 May 2008 09:09:00 GMT
hi all!

i'm developing a simple applications using spring web flow and apache
derby. why, calling this method,

    public boolean exists(Toponomastica data) {
        return getJdbcTemplate().queryForInt("SELECT COUNT(*) FROM
TOPONOMASTICA WHERE SIGLA = '?'", new Object[]{data.getSigla()})
>= 1;
    }

the system raises this exception?

java.lang.NullPointerException
	org.apache.derby.client.am.PreparedStatement.checkForValidParameterIndex(Unknown
Source)
	org.apache.derby.client.am.PreparedStatement.checkSetterPreconditions(Unknown
Source)
	org.apache.derby.client.am.PreparedStatement.setStringX(Unknown Source)
	org.apache.derby.client.am.PreparedStatement.setString(Unknown Source)
	org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal(StatementCreatorUtils.java:234)
	org.springframework.jdbc.core.StatementCreatorUtils.setParameterValue(StatementCreatorUtils.java:88)
	org.springframework.jdbc.core.ArgPreparedStatementSetter.setValues(ArgPreparedStatementSetter.java:51)
	org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:621)
	org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:566)
	org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:616)
	org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:645)
	org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:653)
	org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:696)
	org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:707)
	org.springframework.jdbc.core.JdbcTemplate.queryForInt(JdbcTemplate.java:734)
	JdbcToponomasticaDao.saveOrUpdate(JdbcToponomasticaDao.java:36)
	JdbcToponomasticaDao.saveOrUpdate(JdbcToponomasticaDao.java:18)
	ToponomasticaActions.insertOrUpdate(ToponomasticaActions.java:49)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:597)
	org.springframework.webflow.util.DispatchMethodInvoker.invoke(DispatchMethodInvoker.java:99)
	org.springframework.webflow.action.MultiAction.doExecute(MultiAction.java:133)
	org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:192)
	org.springframework.webflow.engine.AnnotatedAction.execute(AnnotatedAction.java:146)
	org.springframework.webflow.engine.ActionExecutor.execute(ActionExecutor.java:59)
	org.springframework.webflow.engine.ActionState.doEnter(ActionState.java:156)
	org.springframework.webflow.engine.State.enter(State.java:191)
	org.springframework.webflow.engine.Transition.execute(Transition.java:212)
	org.springframework.webflow.engine.TransitionableState.onEvent(TransitionableState.java:107)
	org.springframework.webflow.engine.Flow.onEvent(Flow.java:534)
	org.springframework.webflow.engine.impl.RequestControlContextImpl.signalEvent(RequestControlContextImpl.java:205)
	org.springframework.webflow.engine.impl.FlowExecutionImpl.signalEvent(FlowExecutionImpl.java:202)
	org.springframework.webflow.executor.FlowExecutorImpl.resume(FlowExecutorImpl.java:222)
	org.springframework.webflow.executor.support.FlowRequestHandler.handleFlowRequest(FlowRequestHandler.java:111)
	org.springframework.webflow.executor.mvc.FlowController.handleRequestInternal(FlowController.java:165)
	org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
	org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)

calling other methods, like

    public List<Toponomastica> getAll() {
        return (List<Toponomastica>)(getJdbcTemplate().query("SELECT *
FROM TOPONOMASTICA", new ToponomasticaRowMapper()));
    }

or

    public boolean delete(int id) {
        return getJdbcTemplate().update("DELETE FROM TOPONOMASTICA WHERE
ID = ?", new Object[]{new Integer(id)}) == 1;
    }

works correctly

any ideas?

thanks,
  Gianluca


Mime
View raw message