Search Results

Search found 2458 results on 99 pages for 'rafael spring'.

Page 44/99 | < Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >

  • JSR-303 dependency injection and Hibernate

    - by Jam
    Spring 3.0.2, Hibernate 3.5.0, Hibernate-Validator 4.0.2.GA I am trying to inject Spring dependencies into a ConstraintValidator using: @PersistenceContext private EntityManager entityManager; I have configured the application context with: <bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/> Which, according to the Spring documentation, should allow “custom ConstraintValidators to benefit from dependency injection like any other Spring bean” Within the debugger I can see Spring calling getBean to create the ConstraintValidator. Later when flush triggers the preInsert, a different ConstraintValidator is created and called. The problem is the EntityManager is null within this new ConstraintValidator. I’ve tried injecting other dependencies within the ConstraintValidator and these are always null. Does anyone know if it is possible to inject dependencies into a ConstraintValidator?

    Read the article

  • Doubts about several best practices for rest api + service layer

    - by TheBeefMightBeTough
    I'm going to be starting a project soon that exposes a restful api for business intelligence. It may not be limited to a restful api, so I plan to delegate requests to a service layer that then coordinates multiple domain objects (each of which have business logic local to the object). The api will likely have many calls as it is a long-term project. While thinking about the design, I recalled a few best practices. 1) Use command objects at the controller layer (I'm using Spring MVC). 2) Use DTOs at the service layer. 3) Validate in both the controller and service layer, though for different reasons. I have my doubts about these recommendations. 1) Using command objects adds a lot of extra single-purpose classes (potentially one per request). What exactly is the benefit? Annotation based validation can be done using this approach, sure. What if I have two requests that take the same parameters, but have different validation requirements? I would have to have two different classes with exactly the same members but different annotations? Bleh. 2) I have heard that using DTOs is preferable to parameters because it makes for more maintainable code down the road (say, e.g., requirements change and the service parameters need to be altered). I don't quite understand this. Shouldn't an api be more-or-less set in stone? I would understand that in the early phases of a project (or, especially, an entire company) the domain itself will not be well understood, and thus core domain objects may change along with the apis that manipulate these objects. At this point however the number of api methods should be small and their dependents few, so changes to the methods could easily be tolerated from a maintainability standpoint. In a large api with many methods and a substantial domain model, I would think having a DTO for potentially each domain object would become unwieldy. Am I misunderstanding something here? 3) I see validation in the controller and service layer as redundant in most cases. Why would I validate that parameters are not null and are in general well formed in the controller if the service is going to do exactly the same (and more). Couldn't I just do all the validation in the service and throw a runtime exception with a list of bad parameters then catch that in the controller to make the error messages more presentable? Better yet, couldn't I just make the error messages user-friendly in the service and let the exception trickle up to a global handler (ControllerAdvice in spring, for example)? Is there something wrong with either of these approaches? (I do see a use case for controller validation if the input does not map one-to-one with the service input, but since the controllers are for a rest api and not forms, the api parameters will probably map directly to service parameters.) I do also have a question about unchecked vs checked exceptions. Namely, I'm not really sure why I'd ever want to use a checked exception. Every time I have seen them used they just get wrapped into general exceptions (DomainException, SystemException, ApplicationException, w/e) to reduce the signature length of methods, or devs catch Exception rather than dealing with the App1Exception, App2Exception, Sys1Exception, Sys2Exception. I don't see how either of these practices is very useful. Why not just use unchecked exceptions always and catch the ones you actually do care about? You could just document what unchecked exceptions the method throws.

    Read the article

  • Eclipse: How to convert a web project into an AspectJ project and weave and run it using the AJDT pl

    - by Kent
    What I want to do: I want to use the @Configured annotation with Spring. It requires AspectJ to be enabled. I thought that using the AJDT plugin for compile time weaving would solve this problem. Before installing the plug in the dependencies which were supposed to be injected into my @Configured object remained null. What I have done: Installed the AJDT: AspectJ Development Tools plug in for Eclipse 3.4. Right clicked on my web project and converted it into a AspectJ project. Enabled compile time weaving. What doesn't work: When I start the Tomcat 6 server now, I get an exception*. Other information: I haven't configured anything in the AspectJ Build and AspectJ Compiler parts of the project properties. JDT Weaving under Preferences says weaving is enabled. I still have Java build path and Java Compiler under project properties. And they look like I previously configured them (while the above two new entries are not configured). The icon of my @Configured object file looks like any other file (i.e. no indication of any aspect or such, which I think there should be). The file name is MailNotification.java (and not .aj), but I guess it should still work as I'm using a Spring annotation for AspectJ? I haven't found any tutorial or similar which teaches: How to turn a Spring web application project into an AspectJ project and weave aspects into the files using the AJDT plugin, all within Eclipse 3.4. If there is anything like that out there I would be very interested in knowing about it. What I would like to know: Where to go from here? I just want to use the @Configured annotation of Spring. I'm also using @Transactional which I think also needs AspectJ. If it is possible I would like to study AspectJ as little as possible as long as my needs are met. The subject seems interesting, but huge, all I want to do is use the above two mentioned Spring annotations. *** Exception when Tomcat 6 is started: Caused by: java.lang.IllegalStateException: ClassLoader [org.apache.catalina.loader.WebappClassLoader] does NOT provide an 'addTransformer(ClassFileTransformer)' method. Specify a custom LoadTimeWeaver or start your Java virtual machine with Spring's agent: -javaagent:spring-agent.jar at org.springframework.context.weaving.DefaultContextLoadTimeWeaver.setBeanClassLoader(DefaultContextLoadTimeWeaver.java:82) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1322) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) ... 41 more

    Read the article

  • The 2010 JavaOne Java EE 6 Panel: Where We Are and Where We're Going

    - by janice.heiss(at)oracle.com
    An informative article, based on a 2010 JavaOne (San Francisco, California) panel session, surveys a variety of expert perspectives on Java EE 6.The panel, moderated by Oracle's Alexis Moussine-Pouchkine, consisted of:* Adam Bien, Consultant Author/ Speaker, adam-bien.com* Emmanuel Bernard, Principal Software Engineer, JBoss by Red Hat,* David Blevins, Senior Software Engineer, and co-founder of the OpenEJB project and a     founder of Apache Geronimo* Roberto Chinnici, Technical Staff Consulting Member, Oracle* Jim Knutson, Java EE Architect, IBM* Reza Rahman, Lead Engineer, Caucho Technology, Inc.,* Krasimir Semerdzhiev, Development Architect, SAP Labs BulgariaThe panel addressed such topics as Platform and API Adoption, Contexts and Dependency Injection (CDI), Java EE vs. Spring, the impact of Java EE 6 on tooling and testing, Java EE.next, along with a variety of audience questions. Read the entire article for the whole picture.

    Read the article

  • Is it possible to migrate struts/spring based application to GWT?

    - by Satish Pandey
    I am using the combination of spring, spring-security, struts and iBatis in my application. Now I am looking to migrate the struts UI to GWT. The new combination must be spring, spring-security, GWT and iBatis. I applied a layered approach to develop my application. In Controller/UI layer i am using Struts. I want to replace struts and use GWT in Controller/UI layer. Is is possible to use GWT without affecting another layers DAO/BL/SL?

    Read the article

  • RequestContextHolder.currentRequestAttributes() and accessing HTTP Session

    - by Umesh Awasthi
    Need to access HTTP session for fetching as well storing some information.I am using Spring-MVC for my application and i have 2 options here. User Request/ Session in my Controller method and do my work Use RequestContextHolde to access Session information. I am separating some calculation logic from Controller and want to access Session information in this new layer and for that i have 2 options Pass session or Request object to other method in other layer and perform my work. use RequestContextHolder.currentRequestAttributes() to access request/ session and perform my work. I am not sure which is right way to go? with second approach, i can see that method calling will be more clean and i need not to pass request/ session each time.

    Read the article

  • How to move to Java enterprise development after Python and Ruby?

    - by rdasxy
    I used to develop in Django/Python and Rails/Ruby (and before that C/C++ and C#), and I'm now at a job where we do enterprise Java development (Spring, Hibernate, RESTEasy, Maven, etc.) for web applications and web services. Coming from the Convention over Configuration world, what's the best way to get up to speed doing enterprise Java web services development? I know Java (the language) well, and I've written GUIs in Swing and basic JSP before, but nothing of the kind I'm doing now. Are there any recommended tutorials to get up to speed on popular Java enterprise development tutorials?

    Read the article

  • Execute a Managed bean from a JSF view in WEB-INF folder

    - by JonathanVila
    We are initiating in Spring + Primefaces development and the first problem we have encountered is about storing the xhtml pages into the WEB-INF folder. When we use a faces form in a view located inside the WEB-INF folder, then the commandButton does not execute the managed bean method. Our bean : In fact we think the problem is that with JSF , the pages are rendered using a link to the same page as the action of the form, so if the page is located in WEB-INF it is not public accessible. We know that having all our xhtml views in the web folder instead of WEB-INF actually solves the issue, but we would like to store that pages into WEB-INF. Thank you.

    Read the article

  • Integrating Java webapps with Adobe Professional: Resources?

    - by Steve
    I'm interested in learning what resources there are for integrating Java and Adobe Professional, in general. If it helps, my projects already use the Spring Framework. My boss is particularly interested in being able to fill out a PDF form from within a Java webapp and have that data go directly to our database. She mentioned that .net had a lot of bridges to Adobe Professional. I would rather new projects be in Java so I am eager to find if there are any easy bridges between Java and Adobe Professional. Thanks in advance for any information. So far a Google search on "Java Adobe Professional" didn't turn up anything, so I thought I would ask here. Thanks.

    Read the article

  • Pooling (Singleton) Objects Against Connection Pools

    - by kolossus
    Given the following scenario A canned enterprise application that maintains its own connection pool A homegrown client application to the enterprise app. This app is built using Spring framework, with the DAO pattern While I may have a simplistic view of this, I think the following line of thinking is sound: Having a fixed pool of DAO objects, holding on to connection objects from the pool. Clearly, the pool should be capable of scaling up (or down depending on need) and the connection objects must outnumber the DAOs by a healthy margin. Good Instantiating brand new DAOs for every request to access the enterprise app; each DAO will attempt to grab a connection from the pool and release it when it's done. Bad Since these are service objects, there will be no (mutable) state held by the objects (reduced risk of concurrency issues) I also think that with #1, there should be little to no resource contention, while in #2, there'll almost always be a DAO waiting to be serviced. Is my thinking correct and what could go wrong?

    Read the article

  • What would be the market life of a JVM based software framework?

    - by Nav
    I saw how Struts 1 lasted from 2000 to 2013. I hear that people are moving from Struts 2 to Spring. But for a project that may need to be maintained for a decade or two, would it be advisable to opt for a framework or directly code with servlets and jquery? Can a system architecture really be designed keeping in mind a particular framework? What really is the market life of a framework? Do the creators of the framework create it with the assumption that it would become obsolete in a decade?

    Read the article

  • Spring-mvc project can't select from a particular mysql table

    - by Dan Ray
    I'm building a Spring-mvc project (using JPA and Hibernate for DB access) that is running just great locally, on my dev box, with a local MySQL database. Now I'm trying to put a snapshot up on a staging server for my client to play with, and I'm having trouble. Tomcat (after some wrestling) deploys my war file without complaint, and I can get some response from the application over the browser. When I hit my main page, which is behind Spring Security authentication, it redirects me to the login page, which works perfectly. I have Security configured to query the database for user details, and that works fine. In fact, a change to a password in the database is reflected in the behavior of the login form, so I'm confident it IS reaching the database and querying the user table. Once authenticated, we go to the first "real" page of the app, and I get a "data access failure" error. The server's console log gets this line (redacted): ERROR org.hibernate.util.JDBCExceptionReporter - SELECT command denied to user 'myDbUser'@'localhost' for table 'asset' However, if I go to MySQL from the shell using exactly the same creds, I have no problem at all selecting from the asset table: [development@tomcat01stg]$ mysql -u myDbUser -pmyDbPwd dbName ... mysql> \s -------------- mysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (i686) using readline 5.1 Connection id: 199 Current database: dbName Current user: myDbUser@localhost ... UNIX socket: /var/lib/mysql/mysql.sock -------------- mysql> select count(*) from asset; +----------+ | count(*) | +----------+ | 19 | +----------+ 1 row in set (0.00 sec) I've broken down my MySQL access settings, cleaned out the user and re-run the grant commands, set up a version of the user from 'localhost' and another from '%', making sure to flush permissions.... Nothing is changing the behavior of this thing. What gives?

    Read the article

  • JMS messaging implementation

    - by Gandalf StormCrow
    I've been struggling with this "simple" task for more expirienced people, I'm stuck for 2 days now need help. I've changed things arround like zillion times now, finally I stumbled upon this spring JMS tutorial. What I want to do, Send a message and receive it. I've been also reading this book chapter 8 on messaging. It really nicely explains 2 type of messaging and there is nice example for publish-and-subscribe type but now example for point-to-point messaging( this is the one I need). I'm able to send message to the queue on my own, but don't have a clue how to receive thats why I tried with this spring tutorial here is what I've got so far : SENDER : package quartz.spring.com.example; import java.util.HashMap; import java.util.Map; import javax.jms.ConnectionFactory; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.Queue; import javax.jms.Session; import org.springframework.jms.core.MessageCreator; import org.springframework.jms.core.JmsTemplate; import org.springframework.jms.core.JmsTemplate102; import org.springframework.jms.core.MessagePostProcessor; public class JmsQueueSender { private JmsTemplate jmsTemplate; private Queue queue; public void setConnectionFactory(ConnectionFactory cf) { this.jmsTemplate = new JmsTemplate102(cf, false); } public void setQueue(Queue queue) { this.queue = queue; } public void simpleSend() { this.jmsTemplate.send(this.queue, new MessageCreator() { public Message createMessage(Session session) throws JMSException { return session.createTextMessage("hello queue world"); } }); } public void sendWithConversion() { Map map = new HashMap(); map.put("Name", "Mark"); map.put("Age", new Integer(47)); jmsTemplate.convertAndSend("testQueue", map, new MessagePostProcessor() { public Message postProcessMessage(Message message) throws JMSException { message.setIntProperty("AccountID", 1234); message.setJMSCorrelationID("123-00001"); return message; } }); } } RECEIVER : package quartz.spring.com.example; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageListener; import javax.jms.TextMessage; public class ExampleListener implements MessageListener { public void onMessage(Message message) { if (message instanceof TextMessage) { try { System.out.println(((TextMessage) message).getText()); } catch (JMSException ex) { throw new RuntimeException(ex); } } else { throw new IllegalArgumentException("Message must be of type TextMessage"); } } } applicationcontext.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jee="http://www.springframework.org/schema/jee" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd"> <bean id="sender" class="quartz.spring.com.example.JmsQueueSender" init-method="sendWithConversion" /> <bean id="receiver" class="quartz.spring.com.example.ExampleListener" init-method="onMessage" /> </beans> Didn't really know that learning curve for this is so long, I mean the idea is very simple: Send message to the destination queue Receive message from the destination queue To receive messages, you do the following(so does book say): 1 Locate a ConnectionFactory, typically using JNDI. 2 Use the ConnectionFactory to create a Connection. 3 Use the Connection to create a Session. 4 Locate a Destination, typically using JNDI. 5 Use the Session to create a MessageConsumer for that Destination. Once you’ve done this, methods on the MessageConsumer enable you to either query the Destination for messages or to register for message notification. Can somebody please direct me towards right direction, is there a tutorial which explains in details how to receive message from the queue?I have the working send message code, didn't post it here because this post is too long as it is.

    Read the article

  • Load balancing using Mina example with Java DSL

    - by Flame_Phoenix
    So, recently I started learning Camel. As part of the process I decided to go through all the examples (listed HERE and available when you DOWNLOAD the package with all the examples and docs) and to see what I could learn. One of the examples, Load Balancing using Mina caught my attention because it uses a Mina in different JVM's and it simulates a load balancer with round robin. I have a few problems with this example. First it uses the Spring DSL, instead of the Java DSL which my project uses and which I find a lot easier to understand now (mainly also because I am used to it). So the first question: is there a version of this example using only the Java DSL instead of the Spring DSL for the routes and the beans? My second questions is code related. The description states, and I quote: Within this demo every ten seconds, a Report object is created from the Camel load balancer server. This object is sent by the Camel load balancer to a MINA server where the object is then serialized. One of the two MINA servers (localhost:9991 and localhost:9992) receives the object and enriches the message by setting the field reply of the Report object. The reply is sent back by the MINA server to the client, which then logs the reply on the console. So, from what I read, I understand that the MINA server 1 (per example) receives a report from the loadbalancer, changes it, and then it sends that report back to some invisible client. Upon checking the code, I see no client java class or XML and when I run, the server simply posts the results on the command line. Where is the client ?? What is this client? In the MINA 1server code presented here: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/spring" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> <bean id="service" class="org.apache.camel.example.service.Reporting"/> <camelContext xmlns="http://camel.apache.org/schema/spring"> <route id="mina1"> <from uri="mina:tcp://localhost:9991"/> <setHeader headerName="minaServer"> <constant>localhost:9991</constant> </setHeader> <bean ref="service" method="updateReport"/> </route> </camelContext> </beans> I don't understand how the updateReport method magically prints the object on my console. What if I wanted to send message to a third MINA server? How would I do it? (I would have to add a new route, and send it to the URI of the 3rd server correct?) I know most of these questions may sound dumb, but I would appreciate if anyone could help me. A Java DSL version of this would really help me.

    Read the article

  • Redirect to show ModelAndView from another Controller - (Spring 3 MVC, Hibernate 3)???

    - by Mimi
    How exactly can I trigger display of a model and view from another model and view’s controller? [B][COLOR="Blue"]HTTP Request View -- HttpRequestController POST - new HttpResponse POJO and a string of the POJO in XML as an Http Response msg to be sent back to the Requestor --[/COLOR][/B] [B][COLOR="Red"][/COLOR][/B] I have HttpRequestController() to handle a POST message with data from an input Form and populated an HttpRequest POJO with it. An HttpResponse POJO is composed and persisted along with the HttpRequest to a Db. I made this HttResponse POJO an XML string as the @Responsebody to be sent back by the HttpRequestController() (as an actual HTTP Response message with header and body) and I want to present this HttpResponse POJO in a View. I tried different things, none worked and I could not find a similar example anywhere.

    Read the article

  • What is the equivalent of Struts ActionMessages in Spring MVC?

    - by Umar
    Please let me know if you have any idea about it. Thanks EDIT What ActionMessages is? ActionMessages is basically a class that holds messages that you want to display on a JSP page. Messages can be added in ActionMessages in an Action(controller) class. On the JSP, the position where the messages are intended to be displayed, is marked by <html:messages/> tag. Hence, all your messages are rendered automatically on that specific position. These messages are usually feedback texts that need to appear after some user actions. For example, if the user creates a new record, a feedback message could be "Record created successfully!".

    Read the article

  • what are good blogs to read relating java, spring, hibernate, maven?

    - by c0mrade
    To continue to question further I'm more interested in blogs, websites who once in a while release a tutorial, tip or best-practice on the topics I mentioned. For ex : http://net.tutsplus.com/ is very good website to follow if you wanna learn about or upgrade your knowledge about CSS, HTML, Javascript, PHP .. Is there a website like this for Java and related technologies?

    Read the article

  • How to pass SQLXML type to view in Spring MVC?

    - by Horacy Oliwka
    Hello! In my webapp controller I'm getting results from the db, which are of type SQLXML. I want to pass it to the view to be returned verbatim (as XML). The problem is, the data associated with SQLXML is released as soon as I leave JdbcTemplate call. How then should I pass the data to the view using a model? Best regards, ho.

    Read the article

  • Spring: Using "Lookup method injection" for my ThreadFactory looks not scalable.

    - by Michael Bavin
    Hi, We're building a ThreadFactory so everytime a singleton controller needs a new thread, i get a new instance everytime. Looking at Lookup method injection looks good but what if we have multiple threads. like: public abstract class ThreadManager { public abstract Thread createThreadDoA(); public abstract Thread createThreadDoB(); } and config: <bean id="threadManager" class="bla.ThreadManager" singleton="true"> <lookup-method name="createThreadA" bean="threadA" /> <lookup-method name="createThreadB" bean="threadB"/> </bean> <bean id="threadA" class="bla.ThreadA"> <bean id="threadB" class="bla.ThreadB"> and usage: threadManager.createThreadA(); I don't want to create an abstract "create" method for every new threadclass. Is it possible to make this generich like: threadManager.createThread(ThreadA.class); Thank you

    Read the article

  • How do you configure jax-ws to work with Spring using jax-ws commons?

    - by LES2
    In web.xml I have the following: <servlet> <description>JAX-WS endpoint - EARM</description> <display-name>jaxws-servlet</display-name> <servlet-name>jaxws-servlet</servlet-name> <servlet-class>com.sun.xml.ws.transport.http.servlet.WSSpringServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>jaxws-servlet</servlet-name> <url-pattern>/webServices/*</url-pattern> </servlet-mapping> In my application context I have the following definitions: <bean id="helloService" class="com.foo.HelloServiceImpl"> <property name="regularService" ref="regularService" /> </bean> <wss:binding url="/webServices/helloService" service="#helloService" /> I get a NullPointerException when trying to access the WSDL: java.lang.NullPointerException at com.sun.xml.ws.transport.http.HttpAdapter.<init>(HttpAdapter.java:145) at com.sun.xml.ws.transport.http.servlet.ServletAdapter.<init>(ServletAdapter.java:76) at com.sun.xml.ws.transport.http.servlet.ServletAdapterList.createHttpAdapter(ServletAdapterList.java:5 0) at com.sun.xml.ws.transport.http.servlet.ServletAdapterList.createHttpAdapter(ServletAdapterList.java:4 7) at com.sun.xml.ws.transport.http.HttpAdapterList.createAdapter(HttpAdapterList.java:73) at com.sun.xml.ws.transport.http.servlet.SpringBinding.create(SpringBinding.java:24) at com.sun.xml.ws.transport.http.servlet.WSSpringServlet.init(WSSpringServlet.java:46) Strange ... appears to be a configuration error but the darn thing just dies with a NullPointerException!!!!!!!! No logging is provided. Deployed in Resin.

    Read the article

  • How can I render a Batik SVG Java object in the view portion of a Spring MVC application?

    - by mattblang
    I am creating and manipulating a SVGOMDocument object in a controller method. How can I render this object in a JSP view? I get very close with the following controller method and <object> tag. @RequestMapping(value = "/seal") public ResponseEntity<SVGDocument> createSeal() throws IOException { InputStream file = new ClassPathResource("seal.svg").getInputStream(); String parser = XMLResourceDescriptor.getXMLParserClassName(); SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(parser); SVGDocument svg = (SVGDocument) factory.createDocument("http://www.w3.org/2000/svg", file); svg.getElementById("name").getFirstChild().setNodeValue("a test name"); return new ResponseEntity<SVGDocument>(svg, HttpStatus.OK); } <object data="/seal" type="image/svg+xml"></object> This displays a string of XML that is a SVG. The string is in quotes with every XML quote escaped.

    Read the article

  • How can I make properties files mandatory in Spring?

    - by Paulo Guedes
    I have an ApplicationContext.xml file with the following node: <context:property-placeholder location="classpath:hibernate.properties, classpath:pathConfiguration.properties" /> It specifies that both properties files will be used by my application. But if one of these files does not exist, no error ir thrown. How can I throw an exception for any of these files? They should me mandatory.

    Read the article

  • Why is the EntityManager in my GAE + Spring (+graniteds) project reset to null?

    - by prefabSOFT
    Hi all, I'm having a problem with autowiring my EntityManager. Actually at server startup I can see that the injection works ok, though when trying to use my EntityManager it appears to be null again. @Component public class DataDaoImpl { protected EntityManager entityManager; @Autowired public void setEntityManager(EntityManager entityManager) { System.out.println("Injecting "+entityManager); //works! this.entityManager = entityManager; } public void createData(String key, String value) { System.out.println("In createData entityManager is "+entityManager); //entityManager null!? ... Output: Injecting org.datanucleus.store.appengine.jpa.DatastoreEntityManager@a60d19 The server is running at http://localhost:8888/ In createData entityManager is null So somehow the autowired entityManager is reset to null when trying to use it. It's a graniteds powered project though I don't think this is graniteds related. Any ideas? Thanks a lot in advance, Jochen

    Read the article

  • How can I make properties in properties files mandatory in Spring?

    - by Paulo Guedes
    I have an ApplicationContext.xml file with the following node: <context:property-placeholder location="classpath:hibernate.properties, classpath:pathConfiguration.properties" /> It specifies that both properties files will be used by my application. Inside pathConfiguration.properties, some paths are defined, such as: PATH_ERROR=/xxx/yyy/error PATH_SUCCESS=/xxx/yyy/success A PathConfiguration bean has setters for each path. The problem is: when some of those mandatory paths are not defined, no error is thrown. How and where should I handle this problem?

    Read the article

< Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >