spring

How to do URL authentication in struts2

Hi, I am using struts2.1.6 + Spring 2.5 I have four modules in my application. Registration Module Admin Module Quote Module Location Module. In registration module the customer can register himself and only after registering he is supposed to have access of the remaining three modules. I want to implement something like if the acti...

What is the purpose of Managers / Transactions?

I'm building a spring application for the first time. I'm running into lots of problems with concurrency, and I suspect that there is something wrong with the way I'm managing the backend. The only difference I can see between my backend code and examples I've seen are manager classes. In my code, I have my model (managed by hibernate) ...

PropertyPlaceholderConfigurer works from Maven command line, but not from Eclipse?

I have Eclipse configured to use an external maven instance. Nonetheless I have an integration test that runs fine from the command line, but fails from within Eclipse. The error is a class Spring application context bean error: Cannot convert value of type [java.lang.String] to required type The culprit it a bean that sets property...

How to leverage Spring Integration in a real-world JMS distributed architecture?

For the following scenario I am looking for your advices and tips on best practices: In a distributed (mainly Java-based) system with: many (different) client applications (web-app, command-line tools, REST API) a central JMS message broker (currently in favor of using ActiveMQ) multiple stand-alone processing nodes (running on multip...

using JdcbTemplate standalone

Hi We are looking into using the JdbcTemplate for accessing the DB - but we have many different DB-connections, that each class could use, so injecting the jdbcTemplate is not an option atm. So if we do a jdbcTemplate = new JdbcTemplate(dataSource); what will the transaction policy be? Auto-commit is off in the DB. ...

How to stop Spring MVC blocking all other Servlets?

Hi, I'm using Spring 2.5 MVC and wan't to add another third-party Servlet. The Problem is, that Spring MVC catches all request, so the Servlet isn't getting any request. Here a web.xml Snippet: <servlet> <servlet-name>SpringMVC</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <l...

NullPointerException while raise an embedded ldap server using spring

Hello, I'm trying to raise the Spring Embedded Ldap Server using: But I'm keep on getting this exception: 2010-06-10 14:33:35,559 ERROR main ApacheDSContainer start - Server startup failed java.lang.NullPointerException at org.apache.directory.server.core.schema.DefaultSchemaService.initialize(DefaultSchemaService.java:382) ...

Dependency injection: Scoping by region (Guice, Spring, Whatever)

Here's a simplified version of my needs. I have a program where every B object has its own C and D object, injected through Guice. In addition an A object is injected into every C and D objects. What I want: that for each B object, its C and D objects will be injected with the same A object. [Edit-Start] (1) Guice supports "singlet...

Tiles locale change only refreshes tiles that come through controller

Tiles locale change only refreshes tiles that come through controller and not tiles that are just jsp pages that are called from tiles definitions. Is there some way to make all tiles refresh without writing some javascript refresh function or writing controllers for every tile? ...

Spring Embedded Server

Hey, I'm using spring 3.0.2 and ApacheDS 1.5.5 and I'm trying to run the embedded server using: The content of the user.s.ldif file is : dn: cn=The Postmaster,dc=example,dc=com objectClass: organizationalRole cn: The Postmaster But I always get this error: 16566 [main] INFO org.apache.directory.server.protocol.shared.store. LdifFil...

how to display error message occurred in handleAction() for spring MVC portlet:

I'm sure this question is more related to spring MVC itself, not to the portlet part of spring MVC. I'm new to both of them. I'm developing a portlet based on spring MVC portlet. I need to show a list of links and, when the user clicks on any of them, I get its ID in the controller and do some processing. There's the possibility that th...

How to remove/hide Atomikos startup error message?

When Atomikos is configured via Spring, a jta.properties or transactions.properties file is not needed. Nonetheless, Atomikos starts up with the follow messages printed to stderr: No properties path set - looking for transactions.properties in classpath... transactions.properties not found - looking for jta.properties in classpath... F...

Spring Web: Getting file from web context using Resource?

Is there a way to get a resource in a spring web application using a simple Resource? I am trying not to pass any context, and need to obtain a file from the WEB-INF/freemarker/email/ directory. ...

Sharing beans from contextListener -- dispatcher servlet

Hello! ok, i have another question now. I have a bunch of beans loaded succesfully in applicationContext.xml, which loads from web.xml: <context-param> <param-name>contextConfigLocation</param-name> <param-value>applicationContext.xml</param-value> </context-param> <listener> <listener-class>com.bamboo.common.factory.Log4JC...

how to call service inside service layer

in my service layer public class MyServiceLayerImpl{ public void method1(){ MyServicelayer.method(); //is this correct? } public void method2(){ } @Autowired MyServiceInterface MyServiceLayer; } if i have method inside service layer that need to call another service inside service layer. i cannot ...

Spring - scheduling and pooling runnables of different state (each Runnable instance has different state)

Hi, I can't figure out what to use for scheduling and pooling runnables of different state (each Runnable instance has different state). I could use ScheduledExecutorFactoryBean together with MethodInvokingRunnable to supply arguments. But take a look at the key ScheduledExecutorFactoryBean method, it is designed in a way that all task s...

Spring 3 - Theme with separate JSP

Hi, I'm trying to rewrite some Spring 1.2 code to Spring 3.0 one. Currently I'm stuck with JSP resolved by URL problem. Application uses separate JSP files with different layouts for serving the same model from the same controller. The JSP is switched using interceptor, that intercepts the url and changes the view. For example: /desig...

UrlFilenameViewController keeping URL extension in the view name

I am using Spring MVC, and am using the UrlFilenameViewController to directly map incoming URLs onto my View Resolver without a controller in between. I'm using this to have Freemarker written CSS and JS files, by simply having a .css.ftl and .js.ftl file in the appropriate place. This much all works great. Some browsers seem to have pr...

Problem creating JPA EntityMananger in Spring Context

I have a JPA/Spring application that uses Hibernate as the JPA provider. In one portion of the code, I have to manually create a DAO in my application with the new operator rather than use Spring DI. When I do this, the @PersistenceContext annotation is not processed by Spring. In my code where I create the DAO I have an EntityManager...

Spring JavaMailSenderImpl javax.mail.NoSuchProviderException: smtp

I have a very large project with a ton of dependancies, and am getting the following exception when trying to send mail: javax.mail.NoSuchProviderException: smtp I know the code works because it is part of a library that is used in other projects. Does anyone know what would cause this exception to happen? I have looked through all o...