spring

Configuration problem: Cannot locate BeanDefinitionParser for element [executor]

I m new to spring and m just trying on my hands using spring MVC 2.0 and spring webflow 1.0. but i m getting following error might be when dispatcher deligate request to flow... Configuration problem: Cannot locate BeanDefinitionParser for element [executor] i have spring 2.0 jar file and webflow 1.0 jar file in application build pat...

IDE support for Spring framework; Are they worth using?

I'm using Intellij IDEA Community Edition for IDE, and I like it a lot. However, it does not have any special "Spring support" (plug-ins/tools). My next project uses Spring (which I'm not very familiar with), and I'm wondering whether I should consider changing my IDE from early on; e.g. to SpringSource eclipse/Intellij IDEA Professio...

Use a ContextLoaderListener in accordance with DispatchServlet

I want to use both ContextLoaderListener (so that I can pass Spring Beans to my servlet) as well as DispatchServlet (Spring MVC). However, currently I have to pass init param to these both class initializer: <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/spring/app-config.xml </param-value> So, I use the sam...

Expose jar resources over web

I have a web-service (with Spring-WS). I have a jar with several schemas (schema1.xsd, schema2.xsd and schema3.xsd) which I include in my web service. Is there a way to expose the schemas from the jar through a servlet somehow in my web-service wep app? My Spring MessageDispatcherServlet is mapped to /ws/ I would like my schemas to b...

Hibernate sending superfluous queries to the database.

I have an odd problem where Hibernate is running more queries than I've asked for, and can't see the need for. Here is my controller: @Autowired UserService users; @RequestMapping("/test") @ResponseBody public String test() { User user = users.findUser(1L); return "Found user: "+user.getEmail(); } Here is the UserService: @...

How do I get spring to inject my EntityManager?

I'm following the guide here, but when the DAO executes, the EntityManager is null. I've tried a number of fixes I found in the comments on the guide, on various forums, and here (including this), to no avail. No matter what I seem to do the EntityManager remains null. Here are the relevant files, with packages etc changed to protect ...

Exception in JEE application Email Notification Pattern

We have spring 3.0.x based application, we use SimpleMappingExceptionResolver which sends emails on an exception, when the exception happens within the DispatcherServlet. This gives us following flexibility: Subject can include who the logged in user is, so that we can send personalized email to the user Subject also includes the ser...

Databinding a StructuredPropertyEditor specific to type and target in Spring(Grails) - Selective application

Using Grails 1.2.2, I'm working on binding a structured property (CC expiration Date) to a java.util.Date but only for specific Domain and Commands objects. I've found the StructuredPropertyEditor interface, but the only way that I've found to register it is to use the PropertyEditorRegistrar and register the editor for the java.util.Da...

what's the best practice to config Hibernate-Spring for multiple database relationship?

We have a main mysql database which all of the applications within our organization need the data within this database. How can I config my java web application to use this database with it's specific database when I use Spring and Hibernate within my application? How can I config JPA annotations for example between CONTRACT table within...

Specifying Locations relative to the context XML in Spring

Is there a way to reference a properties file on a file system (not on a classpath) relative to the Spring's context file itself? What I want to do is the below: <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <!-- I want the below to be re...

Using beans from another project

Hello; I'm a novice on spring, i started to develop a new application with 2 modules, each one is a project, the first one is a java project, it contains the services beans declared in a servicescontext.xml, the second prpject is a web application that use the first project. I need to declare beans in the web application that use the se...

How do I use a custom authentication mechanism for a Java web application with Spring Security?

Hi, I'm working on a project to convert an existing Java web application to use Spring Web MVC. As a part of this I will migrate the existing log-on/log-off mechanism to use Spring Security. The idea at this stage is to replicate the existing functionality and replace only the web layer, leaving the service classes and objects in pla...

How to deal with databases for websites written in Java, more specifically Wicket?

Hi there. I'm new to website development using Java but I've got started with Wicket and make a little website. I'd like to expand on what I've already made (a website with a form, labels and links) and implement database connectivity. I've looked at a couple of examples, in example Mystic Paste, and I see that they're using Hibernate ...

What happens on a JMS queue when onMessage() throws a JMSException?

Hi, I'm using Spring 2.5 with my custom class that implements MessageListener. If a JmsException is thrown in my onMessage( ) method, what happens to the state of the queue? Is the message considered "delivered" by the queue the moment onMessage is called? Or does the JmsException trigger some kind of rollback and the message is re-e...

Access FlowScope from JSP without JSTL

I'm using Spring Web Flow (v. 1.0.5) and I have a JSP page that makes an AJAX call to a flow and needs to read in the XML results. That flow successfully sets an object into the FlowScope, then calls a JSP page to render the results. In the JSP page, I'd like to test whether the object has a property (say, .firstName) and if so, do som...

Why is hibernate returning a proxy object?

I have a service method that calls a DAO which then returns an object from the database. This method is called from numerous parts of the system. However, one particular method is getting a return type of ObjectClass_$$_javassist_somenumber as the type. Which is throwing things off. I call the service method exactly the same as everywher...

ClassNotFoundException when running a Spring + Maven2 project on Tomcat 6 from within Eclipse 3.5

When trying to launch a Web project from within Eclipse I get: SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa...

Is it a good idea to "migrate business logic code into our domain model"?

I am reading Hibernate in Action and the author suggests to move business logic into our domain models (p. 306). For instance, in the example presented by the book, we have three entities named Item, Bid, and User and the author suggests to add a placeBid(User bidder, BigDecimal amount) method to the Item class. Considering that usually...

How to parameterize @Scheduled(fixedDelay) with Spring 3.0 expression language?

When using the Spring 3.0 capability to annotate a scheduled task, I would like to set the fixedDelay as parameter from my configuration file, instead of hard-wiring it into my task class, like currently... @Scheduled(fixedDelay=5000) public void readLog() { ... } Unfortunately it seems that with the means of the Spring Expres...

Black Magic in Grails Data Binding!?

As described in http://n4.nabble.com/Grails-Data-Binding-for-One-To-Many-Relationships-with-REST-tp1754571p1754571.html i'm trying to automatically bind my REST data. I understand now that for one-to-many associations the map that is required for the data binding must have a list of ids of the many side such as: [propName: propValue, m...