spring

Hibernate Exception

org.hibernate.hql.ast.QuerySyntaxException: cannot dereference scalar collection element: cspName st.append("SELECT customers.name,sum(csp.cspValue) as TotalMoney "); st.append("from Account as account "); st.append("left join account.CSPFields as csp with ((account.accountID=csp.id) and (csp.cspName = 'Target')...

How to execute job just after spring load application context?

Hello, I want to run some job just after loading the Spring context but I do not know how to do this. have you any idea how to do that? thanks for your help ...

Java: Annotated Annotations (and passing values)

Hello, I have a annotation that does include several other annotations, pretty much like this one here: @Component // Spring Component @Interface OsgiService { boolean isFactory() } meaning that all classes annotated with @OsgiService shall automatically also be annotated as @Component. Which works fine. Now however, I'd like to a...

Problems with i18n

Hellos, all the information an pieces of code which follows, is what I am using. Hello, I am trying to internationalizate a web applicacion. For that, I set up: application-context.xml <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <property name="basename" value="m...

How can use Struts 2.0, Spring and Hibernate in my framework

Is it possible put these three framework Spring, Struts 2.0 and Hibernate in single application and how without using JPA? ...

Hibernate creates too many connections using @Transactional, how to prevent this?

Hello there, I'm fairly new to Hibernate and PostgreSQL, but so far it's going well, although I'm running into a problem now that I can't solve. I'm getting an error while filling the database on the very first operation (which is one transaction inserting or updating 1000 rows in the database). The error is: SQL Error: 0, SQLState: ...

dealing with paths that end the same and have a fixed set of path prefixes

My application has internationalization and the language code is in the first part of every path like "/en/dosomething" and "/de/dosomething" How do i make a single access rule for the "dosomething" resource instead of 2 and still check for "en" and "de"? ...

Does a document or guideline exist that covers the integration points required to add a framework to spring-js?

I've been looking into the spring-webflow/spring-js integration and can't seem to find a guide that describes what is required for implementing a js framework for spring. There is a default integration with dojo, but I'd like to see about integrating jQuery or Prototype and am unclear on what is needed to accomplish this. Thanks. ...

Spring, JPA (Hibernate) & Ehcache Poor Performance

Hi folks, I have what I would assume is a pretty standard setup...spring, jpa (hibernate) and I'm trying to add ehcache. I have it all configured and verified that it's working...I'm logging the hibernate sql statements and cache statements and can see that the cache is getting invoked and that once the object is in the cache, when I t...

Securing JMS message-driven-channel-adapter

I am using a message-driven-channel-adapter to read messages off MQ queue, and this has been working fine in development. Now, in preparation for the first production release, I have to read a secured queue instead. What do I need to do? I think I need to make sure the following are set as system properties, but with what values? jav...

Java/Spring: Beans for the View

I have a dilemma and I'm not sure about the best way to start solving it. I'm working with an old code base at work. Some of the domain objects (and db tables behind them) don't make a lot of sense. eg, deleted is stored as a long, age is stored as a String, etc. Which I've been able to work with fine. In the view I can say if (deleted ...

How can I run my Spring apps offline?

I have a Spring application (not a web app) that should be possible to run offline. However, when I try to do that, it crashes with this error message: - Loading XML bean definitions from class path resource [applicationContext.xml] 21220 [main] WARN org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Ignored XML validati...

JQuery/Spring: How to POST JSON but return html

When I post a JSON to the server and return a normal View string from the Spring controller, my jQuery is not hitting the "success" function. My Controller: @RequestMapping(value = MappingConstants.RULE_ASSIGNMENT, method = RequestMethod.POST) public String saveRuleAssignment(@RequestBody RuleAssignmentCO ruleAssignment) { // Some con...

jboss5 class loader problem with spring and hibernate trying to parse applicationContext.xml

I am using Jboss5 and I'm trying to utilize Hibernate and Spring to load in a spring dao. I'm getting an exception which seems to point to an incompatibility in jars but I'm not quite sure what is going on. I've done quite a bit of searching and I can't seem to find something specific to this besides change JBOSS versions. I am wanting t...

Finding Locale from Controller in Spring MVC

I'm using Sprinng 3.0. How do I find the current locale set by a LocaleResolver within an annotation-based controller? Thanks. ...

Spring + Tomcat URL white list to prevent command injection

Hi all, I currently have a webapp that consists of ~100 unique URLs + ~75 pages. The application uses Spring for security and Tomcat to host. My question is how do I prevent the following from happening: http://localhost/myApp/myPage;rollback; If that's not clear, what I am trying to prevent is my application from processing anythin...

Spring config string format

Hi, A stupid question on formatting but not able to figure out the correct negate parameter. I've the following string value which needs to be passed as a constructor arg through spring. private final static String STRING_PATTERN = "\\<.*?>"; In spring config, <bean class="com.test.TestBean"> <constructor-arg value="\\<.*?>" /> </be...

Can Spring's ObjectFactoryCreatingFactoryBean work with generics that refer to interfaces?

I'm using Spring's ObjectFactoryCreatingFactoryBean to retrieve a prototype scoped bean, as described in the Spring Documentation. Below is my applicationContext. <bean id="exportFactory" class="org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean"> <property name="targetBeanName"> <idref local="export" ...

ClassCastException running Spring app on Weblogic 9.2

I'm trying to deploy a Spring 3 application to Weblogic 9.2. The JDK is JRockit 1.5. I'm using jaxb 2.1 and am including those jars in the war. I've tried adding this to weblogic.xml thinking I've got a conflict between what I'm including and the environment I'm running it in. <wls:container-descriptor> <wls:prefer-web-inf-classes>tr...

Spring 3 how to set a property when the setter method is overloaded

class SomeoneElsesAPI { void setDirectory(File dir){...} void setDirectory(String dir){...} } <bean id="someoneElsesAPI" class="com.someone.SomeoneElsesAPI"> <property name="directory"> <value type="java.lang.String">/etc</value> </property> </bean> I have a case similar to the above example, Spring is throwing an Il...