spring-roo

Why do I get a NullPointerException when initializing Spring

[亡魂溺海] 提交于 2019-12-01 19:00:09
问题 I've got a problem running a batch job on my server, whereas it runs fine from Eclipse on my development workstation. I've got my Spring environment set up using Roo, made an entity, and make a batch that does some work, and test it well on my develompent box. I initialize my context and do the work, but when I run my batch on the server, the context isn't initialized properly. Here's the code: public class TestBatch { private static ApplicationContext context; @SuppressWarnings("unchecked")

No matching factory method found: factory method 'aspectOf()'

不羁岁月 提交于 2019-12-01 16:54:14
问题 I have the following aspect: package trc.suivi.aspects; import java.util.Date; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import trc.suivi.domain.EvenementPli; import trc.suivi.domain.Pli; import trc.suivi.domain.TypeEvenement; import trc.suivi.repository.EvenementPliRepository; public aspect PliEventManagerAspect { private static final Logger log = Logger.getLogger(PliEventManagerAspect.class); @Autowired private EvenementPliRepository

Jetty runs correctly via maven, but incorrectly as a jar

谁都会走 提交于 2019-12-01 12:27:36
(If my title is misleading/incorrect please suggest something more descriptive, that the best I could think of) I've created my own web app using spring roo and have yet to edit any of the code. I am building and running the web app with maven and jetty. When I execute the following everything works fine. mvn jetty:run However when I package and then run the jar directly, I come across some strange problems. mvn package java -jar target/dependency/jetty-runner.jar target/*.war (Same thing with "mvn jetty:run-exploded") The main page loads as it should, but when I click one of the navigation

Support both jsp and jspx in spring 3.0

与世无争的帅哥 提交于 2019-11-30 23:23:19
i've set up a roo application. The default view resolver built-in in roo is for jspx files. Is it possible to support also jsp files?. I tried configuring two viewResolvers but it seems that no urlBasedViewResolvers can coexist, its either one or the other. Changing the order does not affect the behaviour. If I set order =1 to the jspx then if i search for any .jsp file it gives me 404. The same if I search for jspx but jsp viewResolver is set with order =1. Is there anyway to do this? Thanks! here is my webmvc-config.xml <bean id="viewResolver" class="org.springframework.web.servlet.view

How to do a many-to-many relationship in spring Roo, with attributes within de relationship?

自作多情 提交于 2019-11-30 16:06:20
问题 i have been researching on this topic and havent found any answers yet. Im using spring roo and i would like to know if theres a way I can establish a many-to-many relationship with attributes within this relationship. For example i have two tables Employee and MedicalEquipment, Employees can reserve many equipments, and equipment could be reserved by many employee, however i want to store the date this reserve took place. If some one can help i would appreciate it. Thanks in advance! 回答1: In

Weblogic 10.3.3 trying to load org.eclipse.persistence.jpa.PersistenceProvider instead of configured Hibernate Provider

和自甴很熟 提交于 2019-11-30 15:45:09
Good Day all , I am having this problem since many days now , I was able to successfully deploy JPA2.0 appliaction on weblogic 10.3.3 , the application can run select queries using JPA. But when I try to run a create or update information on the same table I get below exception [code] java.lang.ClassCastException: org.eclipse.persistence.jpa.PersistenceProvider cannot be cast to javax.persistence.spi.PersistenceProvider [/code] This is very strange because in my persistence.xml I have provided hibernate as JPA provider , the persistence unit defined is like below [code] <persistence-unit name=

How to use JUnit tests with Spring Roo? (Problems with EntityManager)

北战南征 提交于 2019-11-30 14:34:16
I'm trying to write a JUnit test for a Spring Roo project. If my test requires use of the entity classes, I get the following Exception: java.lang.IllegalStateException: Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?) The Spring Aspects JAR looks to be configured correctly. In particular, I have the following in the pom.xml file: <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> <version>${spring.version}</version> </dependency> and <plugin> <configuration> <outxml>true</outxml>

Adding a custom page in spring roo

感情迁移 提交于 2019-11-30 09:58:40
I have a question about spring roo. How can you add a custom page to your web application? It seems really basic and easy if I'm using standard Servlet, but I'm totally confused to do this in Spring roo. All I want to have is a link in main page (with the menus etc) that links to my custom page. I have tried to add a new Servlet to the application, setting its path mapping to /custompage. but when I access http://localhost:8080/myapp/custompage , it shows that the resource is unavailable. I also can't add a link in the main page, I have tried to edit the menu.jspx directly and it fails. Can

How to use JUnit tests with Spring Roo? (Problems with EntityManager)

▼魔方 西西 提交于 2019-11-29 20:02:22
问题 I'm trying to write a JUnit test for a Spring Roo project. If my test requires use of the entity classes, I get the following Exception: java.lang.IllegalStateException: Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?) The Spring Aspects JAR looks to be configured correctly. In particular, I have the following in the pom.xml file: <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> <version>$

Spring-security cannot match “?parameter” format?

痞子三分冷 提交于 2019-11-29 10:34:06
I use spring-security to secure my web, when I'm learning it by spring-roo generated config file in applicationContext-security.xml, in <http> node: <intercept-url pattern="/userses?form" access="hasRole('ROLE_ADMIN')" /> It means when you want to create a Users object, firstly you need to login to get ADMIN permission. But actually it didn't work. Check the log: 2012-05-06 11:39:11,250 [http-8088-7] DEBUG org.springframework.security.web.util.AntPathRequestMatcher - Checking match of request : '/userses'; against '/userses?form' The framework use the /userses instead of /userses?form to