spring

Singleton design pattern vs Singleton beans in Spring container

As we all know we have beans as singleton by default in Spring container and if we have a web application based on Spring framework then in that case do we really need to implement Singleton design pattern to hold global data rather than just creating a bean through spring. Please bear with me if I'm not able to explain what I actually ...

Is the REST support in Spring 3's MVC Framework production quality yet?

Hi all, Since Spring 3 was released in December last year, I have been trying out the new REST features in the MVC framework for a small commercial project involving implementing a few RESTful Web Services which consume XML and return XML views using JiBX. I plan to use either Hibernate or JDBC Templates for the data persistence. As a ...

No bean named '...' is defined and Spring @Resource annotation

I use @Resource to annotate bean classes, @Autowired to autowire dependencies, and in Spring configuration file these things: context:component-scan base-package="package1,package2" tx:annotation-driven So, it works fine (tested). Spring scans package1, package2, classes with @Resource annotation and then I can get them using...

Transaction Management

Hi all, In my code I am updating two table, one after the other. update(table1_details); update(table2_details); So if the update fails in table1 , table2 should not be updated or should be rolled back. How to handle this situation. I know I have to use transaction. Can some one help with code !!! I am using Java with spring and hi...

How to resolve Error listenerStart when deploying web-app in Tomcat 5.5?

Hi there. I've deployed an Apache Wicket web-application that uses Spring and Hibernate to my Tomcat 5.5 instance. When I navigate to the Tomcat Manager interface I see that the web-application I deployed is not running. When I press 'Start' I get the following error message; "FAIL - Application at context path /spaghetti could not be s...

Spring struts and forms

Hi guy, I need to integrate struts with spring for a project. I read the doc to ingrate struts and it's ok for classic beans but I have a problem for my forms. I have a form like this in my struts-config.xml: <form-beans> <form-bean name="creationForm" type="org.apache.struts.validator.DynaValidatorActionForm" > <form-property n...

Setting nested object to null when selected option has empty value

Hello, I have a Class which models a User and another which models his country. Something like this: public class User{ private Country country; //other attributes and getter/setters } public class Country{ private Integer id; private String name; //other attributes and getter/setters } I have a Spring form where...

DataSource for Tomcat web app, Spring and Hibernate

Web app runs on Tomcat. Datasource is configured with Spring configuration, and is used by Hibernate. If we cannot use JNDI, what would you suggest to use as a DataSource? org.springframework.jdbc.datasource.DriverManagerDataSource will be ok? It's not very good, but sincerely speaking, it can be used on production server, right? Just ...

Connection Pool hangs using Glassfish and Apache DBCP with Spring

We have a Spring application that uses Apache DBCP for connection pooling. Our app has been in production for almost a year with no problems. However, during the past few weeks, the application has frozen a number of times. (By frozen, I mean no requests are handled.) The problem is temporarily fixed by restarting the Glassfish domai...

Spring Task with Quartz Not Running

I'm using the QuartzJobBean in order to run a task in my spring web application my xml which is being included: <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd"&gt; <beans> <bean id="siteMapGeneratorJob" class="org.springframework.sc...

How to use a Spring config file in a Maven dependency

In dependency A I have the following: <beans> <bean id="simplePersonBase" class="com.paml.test.SimplePerson" abstract="true"> <property name="firstName" value="Joe" /> <property name="lastName" value="Smith" /> </bean> </beans> And then in ...

How to know the line of a bug in a spring generated bean ?

Hello, I've got a website build with Spring and jpa (by hibernate). I've got a bug and I don't know how to identify the line where the bug appears. I can't debug it on my ide because it's a live version (all runs fine in local). I've got log which says: o rg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveM...

Not able to use spring Beans outside container . Always picking up WebSphere Context

We have the a whole lot of spring bean defined in our project which we deploy in Websphere ^. One example being the following: <bean id="oasJdbcData" class="oracle.jdbc.pool.OracleConnectionCacheImpl"> <property name="driverType"> <value>oracle.jdbc.driver.OracleDriver</value> </property> <property na...

How to let Tomcat publish WSDL for the WS it provides (CXF 2.2, Spring 3, Tomcat6)

Hi, I am trying to implement a simple web service provider using Tomcat6, CXF 2.2, Spring 3, and actually the service itself runs fine (I can call web methods using the original WSDL and SoapUI). However, Tomcat returns a blank page on "?wsdl" requests. Also, when I try to manipulate the (would-be) published WSDL by adding a publishedEnd...

Why so Long time span in creating Session Factory?

Hi My project is web application running in the tomcat container. This application is a spring framework based hibernate application. The problem with this is it takes a lot of time when creates session factory. here is the logs 2010-04-15 23:05:28,053 DEBUG [SessionFactoryImpl] Session factory constructed with filter configurations :...

Java / Spring / JSP - how to output value added using ModelAndView.addObject

Hi, I have the following code in my controller final ModelAndView m = new ModelAndView(); m.addObject("date", "15" ); In my view I have been able to output this by doing ${date} However how can I print it out using out.print or assign it to a new variable e.g. <% out.print( ${date} ) %> Thanks ...

Spring security problem, Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping'

Hello; I'm developping a web application with spring mvc, i started by developping the web application after i'm trying to add spring security; but i have this message, and i don't find a solution, thanks 16-04-2010 12:10:22:296 6062 ERROR org.springframework.web.servlet.DispatcherServlet - Context initialization failed org.springframe...

NoSuchMethodError with Spring MutableValues

Hello experts! I have written a test where i specify my application context location with annotations. I then autowire my dao into the test. @ContextConfiguration(locations = {"file:service/src/main/webapp/WEB-INF/applicationContext.xml"}) public class MyTest extends AbstractTestNGSpringContextTests { @Autowired ...

Can i use Spring on GAE?

Can i use Spring Webflow/MVC and Spring Security and Hibernate on Google App Engine? Is there a list/summary of java frameworks that can be used on the GAE? ...

How can I get access to spring container?

I have a spring container running, and I have class with which I want to have access to the bean created inside spring container. The class I have is not registered with the spring container. One thing I can do is that I can use MethodInvoker to call a static method, so I will have access to static field (this would be a bean from sprin...