spring

Javascript preventing Spring form from being POSTed

Strange problem going on here. I'm developing a JSR168 portlet that is using Spring and the Spring form taglib. I have a search form on a page to go through a catalog of reports based on the criteria the user selects, and for the most part it works fine. However, there is one sequence of events that is triggering an error. I have a Jav...

Sharing Spring Security Configuration Between Applications

I'm brand spanking new at Spring and have gotten a majority of the knowledge I do have from the Spring Recipes book from Apress. I've got LDAP authentication working with Spring Security within one webapp. I would like to rip out my application context beans and properties files from this one webapp, however, and somehow externalize the...

Java: Need efficient notifications between site users.

I have a simple ajax game between 2 users with java backend (tomcat, spring). I need some good way of notifying one user that his opponent made a turn. Now all communication is done through database and waiting for opponent to finish his turn looks like this: while(!timeout && !opponentIsDone) { //...get the game record from db and...

[Spring AOP] Pointcut not working for generic interface

I'm using Spring framework (2.5) and it's AOP features. I've a pointcut expression, like @Pointcut("execution(public * org.springframework.batch.item.ItemReader+.read(..))") public void itemReaderMethods() {} Where the ItemReader interface is a Spring interface and it's signature is: org.springframework.batch.item.ItemReader<T> Th...

Spring JPA and persistence.xml

I'm trying to set up a Spring JPA Hibernate simple example WAR for deployment to Glassfish. I see some examples use a persistence.xml file, and other examples do not. Some examples use a dataSource, and some do not. So far my understanding is that a dataSource is not needed if I have: <persistence-unit name="educationPU" transaction-ty...

Integration Test with Spring: Cannot convert value of type error

I am in the process of developing Integration Test scripts for our spring application. When I run the test from ant I am getting the following error message: Any ideal as why? Testcase: testgetDefaultItemForStoreWithInvalidStoreId(com.xyz.business.admin.role.RoleUtilityUnitTest): Caused an ERROR Error creating bean with name 'groun...

EJB vs Spring + POJO

What advantages does EJB have to be stacked with Spring? Why couldn't I just use Spring Entity Manager, Security, and POJOs to do what EJB does? ...

Startup performance of Spring @Configurable with Compile Time Weaving

Hi this is my first question on stack overflow, so please be kind. i am running an app with spring 2.5.x Configurable Annotations Compile time weaving (CTW) maven eclipse/ajdt I use CTW and everything runs fine. But if i instantiate an annotated class for the first time it takes very long. the second time it is very fast. Looking ...

Using Spring by Creating Multiple ApplicationContexts to manage bean life time - is this okay?

I have used Spring before but I am no expert and only used it for standard web-development previously. Currently, I am working on a project where Spring is being used very differently. It's a stand-alone Swing app which has many displays and the user can switch between a display via a toolbar. When the display changes, all the compo...

Spring and JSF and JPA

I'm integrating these in a basic web application, being deployed in Glassfish. Upon startup, the error I am getting is: nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;) The closest solution I can find has something to do w...

What are the benefits of proxying by class as opposed to proxying by interface (Spring)?

I've always been quite annoyed at some of the apps I now have to maintain that insist on using proxying by class instead of proxying by interface. More specifically, I have service layer classes that are proxied, but I can't make them final (even though they should be) because for some reason someone has decided they should be proxied b...

In Spring with jpa/hibernate, how do I keep a session open to avoid lazy initialization exceptions?

I currently mark collections in entity beans as eager to avoid getting a lazy initialization exception when I try to access the collection properties after loading the bean with the EntityManager. If I instead leave the collection as lazy loading, how do I keep a session open? I thought about trying @Transactional, but even if that work...

Spring 3.0 and SOAP - What's best practice?

Hi guys, I'm reimplementing a web app in Spring, and I need to expose the business logic with SOAP. I'm going for Spring 3.0, and I'd like to know: what is the recommended way of exposing Spring beans? The rest of my stack is Tomcat 6, JDK 1.6, Struts 2. Cheers Nik ...

Test if Spring Scope is active

How can I test if the Session scope is active in Spring? for example, at startup some classes need a User object which is Session scoped, than i return a mock User object. the bean in question is declared with aop:scoped-proxy. how can i test if the session scope is active? ...

Does anyone know if Hibernate and java will work effectively with Access?

I have a small project that doesn't require much disk space, so i considered using an access database. I was wondering if anyone used a Spring + Hibernate + access combination, if so can they post the connection properties. thanks guys ...

Use of getBean as opposed to method injection in Spring

I have an application that has multiple screens and each screen is selected via a button. Each screen contains pretty heavy-weight components so it's important that only the activate screen is in memory - all others should be available for garbage collection. The app uses Spring for the glue and currently it switches screens using getB...

SWFUpload and Java: Session is lost.

I am using SWFUpload to upload files to java servlet (spring framework). The problem is that the current web session is lost during file upload (it creates a new session). I read that it is a known bug and there are some workarounds somewhere but I can't find anything. Does anyone know how to make it work? Thanks. ...

Book: Modern day equivalent of the Wrox Spring book

I loved the 2005 book "Professional Java Development with the Spring Framework" by Johnson. What would be the 2008-9 equivalent of this in terms of the quality and clarity the book provided? Essentially looking for a book for someone new to Spring, I still think the 2005 book is somewhat relevant, but much has changed in the Spring wor...

DBCP connection validation problem

I decided to use DBCP mainly because I was getting timeouts on my database connections. In theory, once you define a "validation query", DBCP will by default run that query on the connection before using it, so you always know the connection is OK. I set it up two weeks ago and it seemed to work. However, last night I got a timeout exce...

SimpleJdbcTemplate and null parameters

I'm using SimpleJdbcTemplate and MapSqlParameterSource in the folowing way: MapSqlParameterSource parameterSource = new MapSqlParameterSource(); parameterSource.addValue("typeId", typeId, Types.BIGINT); List<Long> ids = _jdbcTemplate.query(_selectIdByParameters, new EntityIdRowMapper(), parameterSource); When typeId ( which is a Long...