Error declaring <ehcache:annotation-driven cache-manager="ehCacheManager" /> bean - pom.xml

At work we use the Spring (or rather Google) ehcache manager. Oddly, I'm getting an error in Spring STS that my coworkers, also using Spring STS and using the exact same code, do not get. The following line in my pom.xml file is marked as an error (or a "problem" according to Spring STS).
<ehcache:annotation-driven cache-manager="ehCacheManager" />
The reason given is this:
The matching wildcard is strict, but no declaration can be found for element 'ehcache:annotation-driven'.
In case it might be helpful, here are the schema declarations at the top of my pom.xml file.
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:ehcache="http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd
http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.1.xsd">
Both Spring STS and my specific project/workspace are using Java 8 as a compiler and runtime environment. So I don't think that's an issue. I also did a project refresh, a Maven update, and a mvn clean install.
I did some research and looked at this question as well as this one. The conclusion seems to be that one of my schemas is no longer hosted and so it cannot figure out what <ehcache:annotation-driven cache-manager="ehCacheManager"/> means. It seems that the http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.1.xsd schema is missing, which can be confirmed if you simply try to visit the URL.
The comments on this question suggest that I avoid the Google ehcache and use the Spring one instead. How should I go about this? Ideally I would like to avoid changing the schemas that we use, since after all it works for my co-workers. But maybe that's because they were able to pull from the Google ehcache schema while it was still being hosted. Is it really necessary to change from the Google schema to the Spring schema, and if so how should I implement this in my POM file?

Try this
<cache:annotation-driven cache-manager="ehCacheManager" />

Related

Neo4j2 and Rexster?

This feels like a really basic, stupid question.
I've got a graph in Neo4j 2.1.5. It's a toy graph, so it was created with the defaults.
I built the Neo4j2 version of Blueprints, as instructed. I can get Rexster to start with this configuration:
<graph>
<graph-name>graph.db</graph-name>
<graph-type>com.tinkerpop.blueprints.impls.neo4j2.rexster.Neo4j2GraphConfiguration</graph-type>
<graph-location>/usr/local/Cellar/neo4j/2.1.5/libexec/data</graph-location>
<properties>
...
</properties>
<extensions>
<allows>
<allow>tp:gremlin</allow>
</allows>
</extensions>
</graph>
When I open the Rexster web interface, it says the graph is there, but when I try to browse it, no dice. I have no trouble browsing my graph from the Neo4j web interface. What am I missing?

vaadin 7 missing web.xml file change default page

im new to vaadin but noticed that you can in vaadin 6 set the default page in the web.xml file but in vaadin 7 this has been done away with.
how do i change the default page ?
Thanks
I am not quite sure what you mean by "default page", so I have to make some guesses.
As you say that you are missing the web.xml, you probably mean a project created by Vaadin Plugin for Eclipse or the Maven archetype. By default, the wizard (or Maven archetype) creates a project stub that uses Servlet API 3.0 deployment with #WebServlet annotation for the servlet class, which is a static class nested in the UI class. It can also be a regular (non-nested and non-static) class, but that's how it is in the application stub.
If you choose Servlet API 2.4 for the new Vaadin 7 Eclipse project, it will use web.xml to define the servlet and UI class, as well as their parameters.
You can mix #WebServlet and web.xml deployment, in which case settings done in web.xml override the ones given with #WebServlet annotation.
Default page to serve is not actually a need to be defined since the framwork handles everything, especially with 3.0 servlet implementation.
But sometimes one may need such file (like, for example, to add context listeners for Spring).
So you can either select the option to generate it during project creation or just make a blank web.xml file in WebContent/WEB-INF.
The autogenerated plugin file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>YOUR_APP_NAME</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>

How to install JV Twitter module on Joomla 1.5?

It is said elsewhere, that JV Twitter module is compatible with Joomla 1.5.
Unfortunately, the archive I got does not install.
The archive content is follows:
And the error message is "Error! Could not find a Joomla! XML setup file in the package.":
The content of XML file starts with:
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="2.5" method="upgrade">
<name>JV Twitter</name>
<author>JoomlaVi! Project</author>
<creationDate>May 2014</creationDate>
<copyright>Copyright (C) JoomlaVi. All rights reserved</copyright>
<license>http://www.gnu.org/licenseses/gpl-2.0.html GNU/GPL or later</license>
<authorEmail>info#joomlavi.com</authorEmail>
<authorUrl>www.joomlavi.com</authorUrl>
<version>4.0.8</version>
<description>JV Twitter</description>
<files>
<filename module="mod_jvtwitter">mod_jvtwitter.php</filename>
<filename>helpers.php</filename>
<filename>jvtwitter.php</filename>
<filename>index.html</filename>
<folder>assets</folder>
<folder>libs</folder>
<folder>tmpl</folder>
<folder>fields</folder>
<folder>languages</folder>
</files>
<languages folder="languages">
<language tag="en-GB">en-GB.mod_jvtwitter.ini</language>
<language tag="en-GB">en-GB.mod_jvtwitter.sys.ini</language>
</languages>
<config>
and so on.
Does this mean that actually package is not compatible with 1.5? Or it is still possible to do something?
I've looked at the developer website and this module is only compatible with Joomla 2.5 and 3.x. It will not work for Joomla 1.5 as the XML structure and content is different in the 2 versions, so you will need to find an alternative.
I would strong suggest you think about migrating to Joomla 3.x very soon. It's more secure and has more features. You may have already noticed that not many developers still support Joomla 1.5

spring security 3: sick and tired. can anyone copy a simple project including JARS

I have wasted more than 5 hours in analyzing the error Configuration problem: You cannot use a spring-security-2.0.xsd schema with Spring Security 3.0. Please update your schema declarations to the 3.0 schema.
tried so many different versions of jars
nothing worked out
I am literally helpless..
PLS CAN ANYONE COPY A SAMPLE SPRING SECURITY 3 PROJECT including the jars??
i thank you
The error suggests that you have mess in your jars and xml configuration. I bet you have something like
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.0.3.xsd
">
<!-- stuff here -->
</beans:beans>
in your security-context.xml, and you are using older version of Spring Security (i.e. 3.0) while the above configuration requires version 3.0.3. Please be sure, that all spring-security-XXX-YYY.jars are in the same version (especially check the presense of spring-security-config), and update your schema to appropriate version, which you define in this line:
http://www.springframework.org/schema/security/spring-security-3.0.xsd
http://www.springframework.org/schema/security/spring-security-3.0.xsd solved same problem I was facing in my code. +1 #Xaerxess.

JSF 2 Access on Facelet Files

I am starting to explore JSF 2 facelet and I would like to test this in a simple project.
I just have some query regarding the file structure in JSF 2. When I was using Spring,
I use to put all my pages under WEB-INF so that they wont be accessible to the browser.
I notice in JSF 2, you should put your *.xhtml outside of WEB-INF and allow access to them thru
the Faces Servlet.
Question, does this mean that all enterprise application that utilizes JSF always put
a security constraint in their web.xml?
<security-constraint>
<web-resource-collection>
<web-resource-name>XHTML files</web-resource-name>
<url-pattern>*.xhtml</url-pattern>
</web-resource-collection>
<auth-constraint />
</security-constraint>
Or they are using some sort of a filter, that traps all incoming request and then reject request
that has *.xhtml?
Is my understanding correct and if so which one is more apt to be used?
Thanks
A third alternative in JSF 2.x is to map the FacesServlet just straight on *.xhtml instead of *.jsf or whatever. This way you don't need to cobble with security constraints or filters to prevent endusers from directly accessing *.xhtml files. It has the only disadvantage that you cannot serve "plain vanilla" XHTML files without invoking the FacesServlet, but that would in turn already not make much sense, because such files should technically have the *.html extension.
Please note that this doesn't work in old JSF 1.x. The FacesServlet would run in an infinite loop invoking itself again and again.

Resources