spring

Spring - configuring a class not as a bean though

Hi all, I have a Spring-managed bean (Application-scoped, or a singleton in the Spring world) that has properties within it that are a list of objects. I'd like to configure those objects in XML if that is possible without too much effort. If I declare them as a bean, then I can inject them, but I don't want them to be Spring-managed ...

Tomcat 6 Virtual Hosting Same Spring Application

I want to deploy the same .war file to two different virtual hosts on the same Tomcat 6 instance. However, I am running into a problem with the Spring framework and registering a bean. Here is the error I am seeing... org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [com.dti.servlets.Confi...

Data does not persist using HIbernate with Spring's @Transactional Annotation

I have an application that I am currently writing that will use Spring and Hibernate. In my services layer I have injected a DAO that will do some very basic CRUD-ing actions. For grins, I have created a method annotated as follows: @Transactional(readOnly = false, propogation=Propogation.REQUIRES_NEW) public void doSomeWork(Dao dao, En...

Does spring form taglib disabled attribute really have to resolve to a string?

I've been playing around with the spring form taglib lately and came across a fairly disturbing phenomenon. <form:select path="whatever" disabled="${true}"> Will render a select element that is NOT disabled <form:select path="whatever" disabled="${'true'}"> Will render a select element that IS disabled. This indicates to me that t...

Hibernate Search with index in a different database

I have a database which is readonly (I only have the access to view), but I have to index this database for search. The DAO layer to this table is now using a generic DAO approach with Hibernate+JPA. Is it possible to add hibernate search to this view and store the index in a separate database? I am aware that I may lose the capability ...

How can I implement a redirect-after-post form with Spring's AnnotationMethodHandlerAdapter?

I would like to write a @RequestMapping style form controller that redirects after a validation error and round-trips the values and error messages into the GET requested form (the Spring docs always just show the view being rendered in directly in response to the POST). Essentially, I think this comes down to putting the BindingResult i...

cxf jaxws with spring on gwt 2.0

Hi, I'm trying to use an application which uses cxf-jaxws in bean definition: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:util="http://www.springframework.or...

Does dependency injection exist in Rails?

Does the fact that Rails have an MVC approach mean that is has dependency injection? Or is there a reason that we don't talk about dependency injection in Rails? If Rails does have dependency injection, what does it consist of? ...

Spring file upload in a mixed form

I want to upload a file to my spring 3.0 applicatoin (created with roo). I already have the following entity: @Entity @RooJavaBean @RooToString @RooEntity public class SelniumFile { @ManyToOne(targetEntity = ShowCase.class) @JoinColumn private ShowCase showcase; @Lob @Basic(fetch = FetchType.LAZY) private byte...

Spring MVC 3.0.0 app won't bootstrap on Weblogic Server 11gR1 - ClassCastException

I have a Spring MVC (3.0.0.RELEASE) based application I need to deploy to Oracle Weblogic Server 11gR1. It works fine on Spring TC Server. When I deploy my application WAR file (either via STS/Eclipse "Servers" view or to the "auto-deploy" folder, or manually via the web admin) I get the following exception: <Feb 3, 2010 9:17:20 AM...

Spring ContextLoader fails to find applicationContext.xml

I've been working alone on a project for a long time and now another developer joined so I wanted to set up the project on his machine from SVN. We are both using very similar set-ups: OS X Snow Leopard Latest Eclipse WTP m2eclipse Maven Plugin Subversive SVN Plugin Tomcat 6.0.24 The Spring version used is 2.5.6. I set up the proje...

Using Camel 2.1 with Grails 1.2.1 - Classloading problem

I'm trying to define a Camel context in my Grails application. resource.groovy: xmlns camel: 'http://camel.apache.org/schema/spring' camel { camelContext(id:'camelContext') { } } Results in a stacktrace containing: 2010-02-03 13:24:42,209 [main] ERROR spring.GrailsRuntimeConfigurator - [RuntimeConfiguration] Unable to l...

Is It Possible To Spring Autowire the same Instance of a protoype scoped class in two places

Hi ** changed the example to better express the situation i am using spring 2.5 and have the following situation @Component @Scope("prototype") Class Foo { } class A { @Autowired Foo fooA; } class B { @Autowired Foo fooB; } class C { @Autowired Foo fooC; } i am trying to understand if there is some way to us...

How to set springframework @Transactional with AspectJ.

Hi. I want to use spring-aspects to make my methods transactional but without using spring AOP (spring AOP works just fine with: <tx:annotation-driven/> ). I'm using maven to manage my project. Is there a way to do compile time weaving on my project classes so "they are Transactional". I was trying to use this plugin: http://mojo.code...

Spring security 2.0.5 LDAP authentication setup w/Active Directory

I've been having a hell of a time trying to get LDAP authentication working with this application (apache Roller). It seems like it would just be "populate the right fields and go", but I'm still attempting to authenticate against the database (the default authentication method). I don't understand what's telling spring-security to use...

JDBC MySQL; is supplying the DB name & username/password enough?

Hi, When setting up a JDBC connection in a J2EE application, do you need to specify the schema name in addition to the database name? I have followed this tutorial and have setup a database, and username/password, but I'm coming up against this error when I startup my application. Is it possible that DBUnit is trying to insert the data...

Spring MVC configuration question

I have a basic Java EE Spring (MVC) application setup that displays a home page with dynamic content. I am completely new to Spring and am confused how to proceed at this point and add more pages to my application. Do I need to create a new controller for each url on my site? Right now I have the following mapping in my ..-servlet.xml...

spring security login pages?

I have some confusion with how spring security works: In my application, I need to have a login page for users after which they are redirected back the page from where they came. I went through a few spring security tutorials and read some articles, and the examples work by securing a certain page on a site (managed by the <intercept u...

What's wrong with my Url Mappings?

I am trying to map a couple urls to their respective controllers as follows: /index.html => HomeController /login/index.html = LoginController My mapping bean in my servlet xml looks like this: <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <map> <entr...

Anybody using Qi4J

I was reading an InfoQ article on Composite Oriented Programming earlier on: http://www.infoq.com/articles/Composite-Programming-Qi4j I was interested in finding out whether anybody is currently using (or has used) the Qi4j framework at all? How does it compares to using a traditional dependency injection framework such as Spring for ...