spring

Marking a 3rd party class property as required (Java/Spring)

Recently, I hit a very perplexing error while trying to clean up my spring configs. The exception was being thrown from deep within a third party library and was basically an obfuscated NPE. What I would like to be able to do is configure spring to require a specific field on this class as being required, but I do not want to build a cu...

cannot access to annotated spring service

I'm trying to access @Service defined class Interfaces are defined, here is an implementation @Service public class TypeServiceImpl implements TypeService { @Autowired TypeDAO dao; public List<DocType> findAll() { System.out.println("accessing findAll"); //have no appearence return dao.findAll(); } ...

Is it possible to use placeholder in context.xml

I'm using Spring and struts and have the following entry in '/META-INF/context.xml' <Context cachingAllowed="false" useHttpOnly="true"> <Resource name="jdbc/xxx" auth="Container" type="javax.sql.DataSource" factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" maxActive="100" maxIdle="30" maxWait="10000" ...

problem with DWR integration in spring?

Actually this is not, how can we integrate DWR and all that. But actually the problem is i am using xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr" and few hours back 'http://www.directwebremoting.org' was down, so i was unable to deploy my application, And now when the site is back i got to know that this link 'http:/...

Ready configurations for Spring + Hibernate

Sometimes, it's very tediously to make own configuration, find all libraries, check it ... So, is there any ready typical (template) config for appropriative task? ...

LazyInitializationException while unit-testing Hibernate entity classes for use in Spring, using TestNG

Hi guys, In my Spring configuration, I've asked that the session should remain open in my views: <bean name="openSessionInViewInterceptor" class="org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor"> <property name="sessionFactory" ref="sessionFactory"/> <property name="flushMode" value="0" /> </bean> ...

Transaction with two sql insert

I have two sql insert to do (say for examples in tables A and B), they are in a transaction because I want the database to remain consistent, that is, a tuple in A must have references in B. In the second insert I need the id that comes from the first, but I don't get this id until I make a commit on the transaction. So I'm stuck. I do...

spring annotation configration issue

I donnt know why spring 2.5.6 keep complaining .. but i dont have any "orderBy" annotation... 2009-10-10 13:55:37.242::WARN: Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.annotation.internalPersiste nceAnnotationProcessor': Error setting property values; ne...

@Secured service methods and spring ws

I have the following project structure: base project (service layer, model) web project webservice project where both the web project and the web service project depend on the base project and use services provided by it. I make heavy use of the Spring Framework which means the Services are Spring Beans with methods secured by the...

Spring map definition

What's the best way to create a bean for a HashMap<Class,String>? Specifically, do I need to explicitly create a Class bean for the key or is the class name enough? ...

Using spring:message to define form tag attribute in Spring web application

I'm developing a Java/Spring web application. The problem I'm currently facing is that I'd like to have message from message.resources shown as an attribute in an HTML. <input type="submit" name="login" value="login" /> So instead of the hardcoded value "login" I need to the value of <spring:message code="general.submit" /> as the v...

How to define Spring datasource in controller ?

Is it possible to define a datasource connector in a Spring controller ? I'm working on a tool : synchronize a source table to a target table. I would define source and target in my controller (to synchronize different databases - in my view I can select different source and target databases). Actually, I define my datasource in file c...

hibernate and spring persistance problem. Possible identity value not incremented?

I am using hibernate 3.2.6, and spring 2.5.6 The database Im connecting to is: DB2 for Z OS 390 V8.1 When I run my testcase (below) I save the test file object. Hibernate DOES Save the object to the database, but my test blows out after the save, where it's trying to update the object with the correct id. I think that it's not getting...

Any Flex 4 migration experience?

My current development stack is MySQL + iBatis + Spring + Spring BlazeDS Integration 1.01 + BlazeDS 3.2 and Flex 3 with Mate 0.8.9 framework. Now Flash Builder 4 beta 2 is out. There are cool features like Data Centric Development (DCD), form generation etc... Do you know how Spring Blazeds Integration works with BlazeDS 4? What about M...

Ways to do a 2 dimensional array in java?

I want to store 2 dimensional values i.e. B-1, C-2, D-3, etc. Any suggestions on the classes or interfaces that can be used? ...

SpringJUnit4ClassRunner initialize beans for each test?

The following test illustrates that this test bean is initialized twice by Spring. I'm hoping someone can tell me why this is so, since it should only be once. Here's the test: import org.apache.log4j.Logger; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.InitializingBean; import org.s...

DWR + Spring + JPA Session Closed

Background The application I am working on currently uses Spring + JPA. Everything was working fine before we decided to introduce DWR. Using DWR I invoke a method on a Service class and it then redirects to the Controller. try{ return WebContextFactory.get() .forwardToString("/search.do?searchString=" + ...

Struts Versus Spring

Hi. Wanna ask which is better to use. Struts or spring. What are its edges over the other and the difference on their flow or how they work. ...

How can I use SimpleFormController with Validator with Spring 3?

Hi, I'm using Spring 3 and using SimpleFormController is deprecated. It sounds like we should use annotions like @Controller instead. Okay, but how can I manage the validator for my form within my controller? Thanks ...

How to externalize a Spring MessageSources bundle outside the WAR

Hi, I have to externalize the Spring MessageSources bundle for i18n support (properties files) outside the classpath in order to modify properties more easily. How can I do that ? <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basename" value="test-messages"/> Tha...