spring

OutOfMemoryError: Trying to optimise Maven multi-module unit tests using HSQLDB, DBUnit, unitils, Hibernate, Spring

I have a big multi-module Maven project with thousands of tests. Each test loads DAOs, services, etc using the SpringApplicationContext annotation. My unitils configuration looks like this: database.driverClassName=org.hsqldb.jdbcDriver database.url=jdbc:hsqldb:file:mytestdb database.schemaNames=PUBLIC database.userName=sa database.pass...

How to separate spring contexts in intelliJ IDEA

Hi! I have a problem configuring IntelliJ IDEA for developing spring and maven powered application. App has two separate spring configurations for production and test purposes. In spring facet props in IDEA I created two different file sets but when configuring one of contexts IDEA shows variants for both ones in code completion. How c...

access Spring context in OSGi bundle

I have an OSGi bundle that uses the bundle-context.xml file to initialize a bean. <bean id="myBean" class="test.MyClass"> <property name="output" value="test"/> </bean> I have a factory class that needs to get the bean instance. In the non-OSGI world, I've always just the following to initialize the context and get a handle to a...

Has anyone succesfully got Tomcat running via Spring OSGi Web in ServiceMix4?

We've been using Fuse's Apache ServiceMix version 4.2.0-fuse-02-00 for a while now for standard OSGi applications and have been fairly successful. We've also been leveraging CXF for making web services available. Now we'd like to deploy our webapps to servicemix4 and leverage the OSGi layer for dependencies and services. However it seem...

Spring Security integration with Facebook Connect

Spring Security for us uses an email as the username and a password. To log someone in through code I call: securityContext.setAuthentication(objectWithUsername); How do I then allow facebook connect users to login who don't have an email or password with us? I can't call the above method because it requires a username. ...

Is there a standard Facebook Java Api?

Is there a standard implementation in Java for the Facebook Api? From what I read the http://code.google.com/p/facebook-java-api/ doesn't work. ...

Problem in java enum injection using spring

Hi, I'm trying to inject java enum through spring context using Here's what I've done. In my spring config, I've following entry <util:constant id="Content" static-field="com.test.taxonomy.model.MetadataTypeEnum.CONTENT_GROUP" /> Here, I'm trying to leverage an Enum ADSKContentGroup to be injected in my bean's (ADSK...

Hard time with Spring anonymous/callback classes for data persistence

Hey, I'm trying to accommodate to Spring JDBC, but what bugs me is using these anonymous classes, where we cannot pass any local variables unless they are final which might be easy to arrange, but what about if I need to loop an array or collection ? I cannot declare "FedModel fm" to be final as it gets reinitialized in the loop, but I...

Web service using CXF, Jetty and Spring

I try to create simple web service with CXF, Jetty and Spring. I create service interface @WebService public interface AnonymousService { @WebMethod public String getVersion(); } and its implementation @Service("anonymousService") @WebService( serviceName = "AnonymousService", targetNamespace = "http://ws.test/", ...

How should you handle exceptions that occur below the level of the Controller in a Spring MVC web app?

Let's say you've got a Spring web app with a structure like this: com/ myapp/ controller/ model/ service/ How should you handle exceptions that occur below the level of the controller? Should you make methods in the Model and Service layers throw their exceptions up to the Controller layer? What to...

where to find a open source project which uses one of more of (spring,struts2,hibernate,JSF)

Hi everyone, I would like to involve in a open source project, since I prefer web development and frameworks such as spring, struts2, Hibernate and JSF, I'd like to find such a project to get involved. Can someone point me to right direction or correct me if I'm search something that didn't exists? Thank in advance, Nuwan ...

Why the need for a strict enforcement of interfaces for classes in a Spring MVC service layer?

In the Spring web app I am working on, there is a service layer that relates to the rest of the web app structure like this: com/ myapp/ controller/ model/ service/ This service layer is made up of interface and implementation classes. Why is it so important to have interfaces for all of these classe...

Why would a Spring login form not reveal any error information for a failed login?

My Spring MVC app is not allowing any logins and I can't figure out why. I've added logging to the Login Controller but nothing is being outputted there. The login page just seems to automatically redirect to the error page without going through the Login Controller. Any ideas how to debug this problem? <http auto-config="false" acce...

Apache CXF - startup time

Hi, We are working on one of the application wherein Apache CXF, Spring is used to develop webservices. The application now contains more than 50 webservices and more than 300 spring managed beans. Every time the application server is started it takes more than 15-20 minutes. (server with 4gb ram, jboss/tomcat app server, linux os) Is t...

Using both @RequestBody and normal parameters

Hi, I am using spring 3 controllers with a flex client. I am now using @RequestBody in order to pass xml's to the server. How can i pass additional parameters? Thank you. ...

Spring - how to gather informations during rollbacks in declarative transaction management

Hi, Could please anybody tell me If it is safe and recommended to catch SQL and other exceptions within @Transactional methods ? When programmatic transaction management is used, I can simply catch the exception and do whatever I want, but I don't know if I don't break the transactional AOP system by catching these exceptions that would...

is it possible to use class.forname to load a class that exists within a module wired up with Spring?

I have two maven modules and a need for class A in module 1 to load class B in module 2 using class.forname. this works very well and I can call the right methods on class B no problem at all. module 1 is wired up using spring and I'd like to wire module 2 up in the same way for consistency. I tried this and compiled it up no issue. b...

How should I initialize class freemarker.template.Configuration?

Attempting to follow this Java tutorial. About 63 pages in, you are instructed how to create a form ("New.jsp") to submit new events. When I try to visit the page, I get the following error: HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this...

why setDisallowedFields for id? -- Spring petclinic example

From the Spring API, i understood that @InitBinder is used to initialize some binding rules.. In the petclinic example why we have setdisallowed("id")? when the id is not displayed on the form? @InitBinder public void setAllowedFields(WebDataBinder dataBinder) { dataBinder.setDisallowedFields("id"); } The id field is not displaye...

Catch Spring MVC No Mapping Error

Hi, I configured below exception resolver in my web configuration file but I am not sure why it cannot handle errors such as this 'No Matching error found for servlet request: path '/etc' <bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver"> <property name="exceptionMappings"> <props> ...