spring

OSGi Logging with spring-DM extender not logging

My Setup: I am able to create a simple OSGi bundle with Log4J as my logging framework and when deployed to my OSGi container (Equinox) it works great my logging is configured very simply with a seperate bundle fragment that configures my logging. This setup does not have spring involved and it works really nicely. My Issue: I am convert...

Spring deployment-level configuration

When I wrote JEE apps, I used JBoss Datasources to control which databases the deployment used. E.g. the dev versions would use a throwaway hibernate db, the ref and ops would use stable MySQL deployments. I also used MBeans to configure various other services and rules. Now that I'm using Spring, I'd like the same functionality - deplo...

Get ahold of session in command object in Grails

How can I get the session from within a command object? I have tried: import org.springframework.security.context.SecurityContextHolder as SCH class MyCommand { def session = RCH.currentRequestAttributes().getSession() } This throws java.lang.IllegalStateException: No thread-bound request found: Are you referring to request att...

oracle clob insertion problem in spring

Hi, I want to insert CLOB value into my Oracle database and here is the what I could do. I got this exception while inserting operation "ORA-01461: can bind a LONG value only for insert into a LONG column". Would someone able to tell me what should I do? Thanks. List<Object> listObjects = dao.selectAll("TABLE NAME", new XRowMapper()); S...

DOJO file upload is not working in struts2.1.6

I have been workin on this for a while and I think I really need help! I am using struts 2.1.6 with struts2.1.6_dojo_plugin+ Spring. This is my Java Script code in the Page <%@ taglib prefix="sx" uri="/struts-dojo-tags"%><head> <sx:head cache="true" /> <link rel="stylesheet" href="/css/default.css" media="screen" type="text/css" /> <scr...

Spring maven error

I'm using spring MVC with maven to develop a web application, but when I update my dependencies I get this message: 5/6/10 10:09:50 AM CEST: Build errors for amundsen.web; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.4.1:resources (default-resources) on...

Spring and factory object

I have an abstract class with a static method that returns either one concrete subclass or another, depending on this static method's arguments. How do I define a bean in spring configuration file that will invoke this static method with the arguments? ...

What does "bean X is injected into bean Y" mean in context of Spring framework

Hello. Seems,that very basic question. Anyway can't get the meaning of next definition from Spring tutorials - "bean X is injected into bean Y" . Does it mean composition relation between classes(when one bean has reference to another)? Or it's something more? Thank you for answer or reference with explanation. ...

Spring 3 and a custom object wrapper for FreeMarker

How do you configure Spring 3 to use a custom object wrapper to use with FreeMarker? I've created a custom object wrapper for FreeMarker but I'm not sure how you configure Spring 3 to use the wrapper. The following has no effect: <bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarker...

@ContextConfiguration in Spring 3.0 give me No default constructor found

I have already do the test using AbstractDependencyInjectionSpringContextTests and it works but in spring 3 it is deprecated, so I decided to try @ContextConfiguration but spring say that default constructor is not found, I check and the class doesn't have any constructor. If I use this test spring give the object. package atoms.portal...

Get invalid user input with a Spring typeMismatch error

I've implemented a ReloadableResourceBundleMessageSource in my Spring MVC application which I use to display prettier error messages for binding exceptions. The problem I'm having is that, due to a company policy, these errors must be displayed in the following format: [inputData] is not a valid [fieldName]. The field name is accessibl...

sermyadmin 2.01

I am able to install sermyadmin 2.0.1 and got everything working. Only user registration is not working. When I register a user the entry goe sin DB etc find but the email is not send to the user. We are using our own smtp server with no authentication. And I am sure there is nothing wrong with the smtp server. I can see that it has rece...

Hibernate deletion issue

I'm trying to write a Java app that imports a data file. The process is as follows Create Transaction Delete all rows from datatable Load data file into datatable Commit OR Rollback if any errors were encountered. The data loaded in step 3 is mostly the same as the data deleted in step3. The deletion is performed using the followin...

How can I get real path for file in my WebContent folder?

I need to get real path for file in my WebContent directory, so that framework that I use can access that file. It only takes String file as attribute, so I need to get the real path to this file in WebContent directory. I use Spring Framework, so solution should be possible to make in Spring. ...

Best way to detect duplicates when using Spring Hibernate Template

We have an application which needs to detect duplicates in certain fields on create. We are using Hibernate as our persistence layer and using Spring's HibernateTemplate. My question is whether it is better to do so an upfront lookup for the item before creating, or to attempt to catch the DataIntegrityViolation exception and then chec...

Spring maven libraries

I would like to know why some of the libraries are not released during a normal release cycle. For example, from http://repo2.maven.org/maven2/org/springframework/ while spring-core have 3.0.3-RELEASE, spring-remoting and spring-jmx were released only in 2.0.8. Can someone tell me what this would mean? I agree that if there are no chang...

Spring bean initialization in a web app

We work with a web application and autowire beans using WebApplicationContextUtils in the init method. Could you clarify some details about bean initialization? The question rises from the static factory method. Suppose there's a bean that is created in a static factory method. As we can see, when the web app is deployed, the Contex...

Spring singleton lifecycle

Reading this When a bean is a singleton, only one shared instance of the bean will be managed and all requests for beans with an id or ids matching that bean definition will result in that one specific bean instance being returned. Will be managed... What does that mean? If there's only one object, than any modificat...

Beans... what is it actually

What is a bean in spring framework? What is the use of the bean? ...

Spring "session" scope of a bean

It seems to me that "session" scope is another means to keep objects in session as using setAttrubute / getAttribute Correct? You know, dont know why, it does not work for me. <bean id="sabreUser" class="util.MyUser" factory-method="getSomeUser" scope="session"> <const args...> What I see is that after the initialization and initi...