spring

Running spring program inside application server

Hi Everybody I have here a slight problem. We have written a big spring based application that runs on pure J2SE. No security manager, everything fine. Now I got a request to get this app inside some container inside an application server. Obviously the application wont run after i am done with the porting because they have a security...

Spring user transaction with hibernate

I want to control hibernate transaction myself so I can rollback at any time. I calling a thread to do business but not waiting for it to finish its job and update DB. This update is only available when the method ends but I want to commit changes in each for loop so I need to control hibernate transaction. My Sample code is below: for...

DBUnit: How to refresh only on failure ?

I am using DBUnit to test a Spring/Hibernate persistence. I created an abstract test: public abstract class AbstractTestCase extends AbstractTransactionalDataSourceSpringContextTests { @Override protected String[] getConfigLocations() { return new String[] { "classpath:/applicationContext.xml", "classpath:/testDataSource...

What is the state of the art Web Application framework?

I am wanting to develop a web application, what is the current state of the art to do so? Google Web Toolkit? Favorite languages: C#, Java, Python. If I understand correctly the respective best ways are ASP.NET, Spring, and Django correct? Also Rails is out there too. I'm just saying general purpose? Suppose you had a version of MSP...

WAS 6.1, Hibernate, Spring and transaction managmement configuration

I'm using Websphere Application Server Express v6.1 and am writing an application which uses Spring 2.0.7, Hibernate 3.5. My datasource is Oracle 10g. I have 2 question Which is a better transaction manager? Websphere's or Hibernate's? If IBM is the answer then how should I configure it in the spring config XML? This is my current d...

How can I check Spring Security for user authentication and get roles from Flex?

I'm using Spring, Spring Security, BlazeDS, Flex and spring-flex. I know that I can call channelSet.login() and channelSet.logout() to hook into Spring Security for authentication. channelSet.authenticated apparently only knows about the current Flex session, as it always starts off as false, until you call channelSet.login(). What I ...

Extending spring's default component factory

This is a short one: I want to modify the way spring instantiates my beans (in this case, by creating a proxy instead of simply instantiating it). I can't use Jdk Dynamic Proxies nor cglib to generate the proxies (if this was the case, I could use spring aop). In my opinion, the best way to do this would be to extend spring's bean fa...

Hibernate flush and JTAUnexpectedRollbackException

Hi All, I am using Spring and Hibernate. And Atomikos for transactions. I use annotation based transactions. I am having a DAO object and in one of the methods I call entityManager.persist() to save the object. Now whenever there is an ORA- error during update, for example a constraint is violated or one of the columns is having length...

Are there Compound property values in Spring

I read about Compound property names in the "The Spring Framework (2.5) - Reference Documentation - chapter 3.3.2.7" Can i use the same concept to set values of properties? Can i use a compound string as a value expression? <bean id="service1" class="a.b.c.Service1Impl" scope="prototype"> <property name="service2" ref="service2"/> ...

What is org.springframework.orm.hibernate3.support.BlobByteArrayType good for?

What is org.springframework.orm.hibernate3.support.BlobByteArrayType good for?Why not map a byte[] as the Hibernate basic type "binary"? What are the differences? When to use which? Thanks! ...

Spring Security: Authentication returns null

Hi all, I have configured a Spring bean as follows to return a SecurityContext: <bean id="securityContext" class="org.springframework.security.context.SecurityContextHolder" factory-method="getContext"> </bean> When I use this bean the Authentication object returns null. Authentication authentication = securityContext.getAuthen...

Spring - How do you set Enum keys in a Map with annotations

Hi all, I've an Enum class public enum MyEnum{ ABC; } than my 'Mick' class has this property private Map<MyEnum, OtherObj> myMap; I've this spring xml configuration. <util:map id="myMap"> <entry key="ABC" value-ref="myObj" /> </util:map> <bean id="mick" class="com.x.Mick"> <property name="myMap" ref="myMap" /> </bean...

How do you run Spring 2.5.6 sample apps in Jdeveloper 11g?

I am trying to run imageDB and jpetstore in JDeveloper 11g. It compiles fine, but it won't run, and the weblogic server throws errors. Does anyone know how to successfully run Spring 2.5.x sample applications in Jdeveloper 11g? I get the following error when I try jpetstore sample. Jul 27, 2009 5:03:20 PM org.springframework.web.contex...

Is Spring able to handle this user case? Neither property nor constructor injection...

Hi all, Basically, I have a class A which depends on class B which in turn depends on a spring managed bean C, but I dont want to keep B as a class variable just use B inside one method for some reason. My solution is to create a static method get() in B which returns a instance of B. Now the problem is, C is not injected to B correctl...

Using Multiple ApplicationContexts in Spring - question about cleaning up resources

If I have a main appCtx and then I have a series of separate appCtxs which refer to the main one as the parent, then can I destory the child contexts to free up memory? In effect I want to use the child appCtxs as object caches and I want to have the option of saying to a specific cache - "I'm not using the beans in this cache any more ...

Spring Framework Connecting JVM with each other

Hi all, I have 4 servers and JVM is installed on them. I wrote a java service that Quartz calls this services every 10 minutes. But in 4 servers, every 10 minutes 4 calls are done. This sitiuation creates race condition. I want only one service on 4 JVM. How can I do that with Spring Framework? ...

org/springframework/metadata/Attributes not found in spring3.0?

may i know which jar is this class java.lang.NoClassDefFoundError: org/springframework/metadata/Attributes located? i cannot find it inside org.springframework.aop-3.0.0.M1.jar . but in older version of spring, it exist spring2.0 . the reason i need this file is because i am trying out spring modules 0.9 @Cacheable tutorial. ...

ResultSet and Select * Performance

I am refactoring some Spring JDBC code in which some of the costlier queries do "SELECT * FROM..." - and was about to start checking which columns were actually needed and just SELECT x , y FROM.. them. But reading through the ResultSet class is seemed that most data is lazily loaded. When you do a ResultSet.next() it moves the cursor ...

Pros and cons of using BlazeDS or web services as the remoting and messaging technology between Flex view layer and Spring business layer?

In my company, we are going to use Flex3 for the presentation layer of a new financial web application and Spring for the business layer but a debate is still going on regarding the best messaging/remoting technology. Can you share your own experiences in terms of pros and cons of using one or the other technology? ...

Retrieving a model from ModelAndView in jsp

Hi all, I am currently trying to return a model from onSubmit() in my controller. I then am trying to retrieve this in my jsp. for example Map model = new HashMap(); model.put("errors", "example error"); return new ModelAndView(new RedirectView("login.htm"), "model", model); and then retrieving it with <c:out value="${model.errors}...