spring

JDBC & Deadlock avoidance question (Basic)

I'm using JDBC (through Spring's JDBCTemplate) to access a small number of tables in a database. Although I haven't had anything happen yet, I'm concerned about the possibility of deadlock. I was under the impression there was a way to specify a lock order for queries that access multiple tables for deadlock avoidance, but I don't know...

Quartz & Spring - Clustered but NOT Persistent?

In my Spring application I'm using the SchedulerFactoryBean to integrate with Quartz. We're going to have clustered Tomcat instances, and thus I want to have a clustered Quartz environment, so that the same jobs don't run at the same time on different web servers. To do this, my app-context.xml is as follows: <bean class="org.springfra...

Spring MVC without HTTP requests

Hi, I need to create a system oriented around Methods where providers can register for the Methods they handle and consumers can do two things (for now) - either get Metadata for a method or execute it. I'm considering creating a REST style architecture where methods are resources with unique URIs and an interface consisting of two meth...

Create ApplicationContext as Spring bean (by other application context)

How i can define one ApplicationContext as prototype spring bean in other application context. Also i need pass current context as parent to new application context. Details: I have Bean, that represent one user sessions in rich client application. This class manage lifetime of application context, and few other objects (like database ...

WebSphere tries to load Spring related schemas from internet

Hello world, I have some problem running spring in my j2ee application. Short introduction: I use WebSphere 6.1 (i don't know that it is websphere specific or more general problem) Artifacts: web application (war) where in WEB-INF/lib folder maven publishes all needed spring dependencies. war is then packaged in ear and deploys on ...

How can a test 'dirty' a spring application context?

The spring framework documentation states: In the unlikely case that a test may 'dirty' the application context, requiring reloading - for example, by changing a bean definition or the state of an application object - Spring's testing support provides mechanisms to cause the test fixture to reload the configurations and...

Weblogic classpath and Spring Resources

I'm trying to set a bean property like this: <bean id="threadImport" class="com.foo.bat.util.ThreadImport" singleton="false"> <property name="mailSender" ref="mailSender"/> <property name="parseConfFile" value="classpath:parse/import.xml" /> <property name="logFilename" value="/tmp/import.log" /> but none of files are found. Wha...

Exposing the web service using CXF

Hi, I have a requirement to expose a webservice using CXF. I am following this easy tutorial link text and did the following steps Created a service and an implementation with @WebService annotations Added the standard xml snippet of including cxf.xml and other xmls specified Now I need to deploy this webservice in multiple containers....

Why does @RequestParameter String someValue in Spring 3 return 2x values ?

Let's say I have this method in my controller: @RequestMapping(value="/home", method=RequestMethod.GET) public void captcha(@RequestParam String someValue, HttpServletResponse response) { System.out.println(someValue); } Why does the result of this request: http://something/home?someValue=testvalue123 return this? testvalue12...

Spring excluding pages from urlrewrite rule set on root

Hi guys. Here is the simple explanation of the problem: I have a controller RedirectController so that I want to handle everything like http://mydomain/** However, still I want need to redirect http://mydomain/ to index controller (or index.jspx whatever) and most probably I need to exclude /help /about URLs in the future. The current...

Spring-Hibernate used in a webapp,what are strategies for Thread safe session management

I'm developing a web app with Spring and Hibernate and I was so obsessed by making he application thread safe and being able to support heavy load that based on my boss recommendation I end up writing my own session and a session container to implement a session per request pattern. Plus I have a lot of DAOs and me not willing to write t...

Spring AOP Advice on Annotated Controllers

I am trying to use AOP to do some processing after an annotated controller. Everything is running with no errors, but the advice is not being executed. Here is the controller code: @Controller public class HomeController { @RequestMapping("/home.fo") public String home(ModelMap model) { model = new ModelMap(); ...

Spring 3 Annotated Configuration Picks up @Configuration and @Component but not @Controller

So I'm trying to configure my web app without XML and go the all annotated route. I have a few classes annotated with @Configuration and @Component that are getting picked up automatically, but for some reason my @Controller annotations aren't being recognized and mapped to their corresponding @RequestMapping values. My web.xml file loo...

Can Spring-WS 1.5 be used with Spring 3?

Spring-ws 1.5.9 depends on Spring 2.5 (based on the pom). Can it be used with Spring 3 without running into any classloading issues. I know that some of the packages match between the two, can I just not include those Spring 3 jars? I cant seem to find any official word on this. ...

Creating user info bean in JBoss

Hi there, I'm a little bit stuck in a problem right now: I've got a JBoss Portal which runs on a JBoss AS 4.2.3. There are running some webapps on the machine which provide some portlets to users. Now I need a centralized solution: Every time an user logs in I want to create a session bean where some user information is hold. I'm using...

Spring: how do I inject an HttpServletRequest into a request-scoped bean ?

I'm trying to set up a request-scoped bean in Spring. I've successfully set it up so the bean is created once per request. Now, it needs to access the HttpServletRequest object. Since the bean is created once per request, I figure the container can easily inject the request object in my bean. How can I do that ? ...

How do I handle a single text io stream with multiple inputs and outputs?

So I'm working through a bit of a problem, and some advice would be nice. First a little background, please excuse the length. I am working on a management system that queries network devices via the TL1 protocol. For those unfamiliar with the protocol, the short answer is that is is a "human readable" language that communicates via a ...

Rendering a GSP from a Quartz job in Grails

I have a quartz job that needs to render a GSP, when I tried: def g = new org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib() def text = g.render(template: "/templates/myTemplate", model: [language: language, product: product]) I received the following exception: org.quartz.JobExecutionExcept...

Hibernate JPA, Spring MVC and LazyInitializationException

Hi All When trying to get items from db, I got this error: 13:00:13.876 [7838526@qtp-204712603-0] ERROR o.h.LazyInitializationException - failed to lazily initialize a collection of role: bo.myobj, no session or session was closed org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: de.myob.linke...

Infinite Recursion with Jackson JSON and Hibernate JPA issue

When trying to convert a JPA object that has a bi-directional association into JSON, I keep getting org.codehaus.jackson.map.JsonMappingException: Infinite recursion (StackOverflowError) All I found is this thread which basically concludes with recommending to avoid bi-directional associations. Does anyone have an idea for a workaro...