小编Cod*_*Med的帖子

org.springframework.orm.hibernate4.annotation.AnnotationSessionFactoryBean

我在使用hibernate的Spring-MVC应用程序中收到以下错误:

java.lang.ClassNotFoundException: 
org.springframework.orm.hibernate4.annotation.AnnotationSessionFactoryBean
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个错误?

pom.xml是:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>minimal.example</groupId>
<artifactId>SpringSecurityLoginDatabase</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>SpringSecurityLoginDatabase</name>
<packaging>war</packaging>

<properties>

    <!-- Generic properties -->
    <java.version>1.7</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <!-- Spring --><!-- 3.2.5.RELEASE worked -->
    <spring-framework.version>4.1.7.RELEASE</spring-framework.version>
    <spring-data-jpa.version>1.4.2.RELEASE</spring-data-jpa.version>


    <!-- Java EE / Java SE dependencies -->
    <jsp.version>2.2</jsp.version>
    <jstl.version>1.2</jstl.version>
    <servlet.version>2.5</servlet.version>
    <jaxb-impl.version>2.2.7</jaxb-impl.version>

    <!-- Hibernate / JPA -->
    <hibernate.version>4.2.1.Final</hibernate.version>

    <!-- Bean validation -->
    <hibernate-validator.version>4.3.1.Final</hibernate-validator.version>

    <!-- Database access -->
    <tomcat-jdbc.version>8.0.23</tomcat-jdbc.version>
    <ehcache.version>2.6.6</ehcache.version>
    <hsqldb.version>2.3.1</hsqldb.version>

    <!-- AOP -->
    <aspectj.version>1.7.4</aspectj.version>

    <!-- Logging -->
    <logback.version>1.0.13</logback.version>
    <slf4j.version>1.7.5</slf4j.version>

    <!-- RSS -->
    <rome.version>1.0</rome.version> …
Run Code Online (Sandbox Code Playgroud)

java spring hibernate maven

0
推荐指数
1
解决办法
2万
查看次数

Gradle不适用于spring boot示例应用程序.为什么不?

我正在使用这个春季启动教程来研究春季启动.我明确地遵循了这些步骤,但现在gradle无效.我记得在运行它的CentOS 7 devbox中安装gradle. 如何让gradle启动此示例应用程序?

这是从使用上面列出的教程中的确切步骤创建的应用程序的根目录中键入的终端日志:

[root@localhost gs-actuator-service]# ./gradlew bootRun --stacktrace
-bash: ./gradlew: No such file or directory
[root@localhost gs-actuator-service]# ./gradlew bootRun --debug --stacktrace
-bash: ./gradlew: No such file or directory
[root@localhost gs-actuator-service]# ./gradlew bootRun
-bash: ./gradlew: No such file or directory
[root@localhost gs-actuator-service]# 
Run Code Online (Sandbox Code Playgroud)

我还确认通过键入以下内容在计算机上安装了gradle:

[root@localhost gs-actuator-service]# gradle -v

------------------------------------------------------------
Gradle 2.10
------------------------------------------------------------

Build time:   2015-12-21 21:15:04 UTC
Build number: none
Revision:     276bdcded730f53aa8c11b479986aafa58e124a6

Groovy:       2.4.4
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.8.0_45 (Oracle Corporation 25.45-b02)
OS: …
Run Code Online (Sandbox Code Playgroud)

java spring gradle gradlew build.gradle

0
推荐指数
1
解决办法
804
查看次数

Why does UserDetailsService return null in Spring Boot app?

A simple spring boot app has a custom UserDetailsService. The Spring Boot Controller is called by an AngularJS app, and authentication requests from the AngularJS app are made to the backend at the /user url pattern. But login requests are causing the controller logs to indicate that the controller is not finding the /user url pattern, and that the UserDetailsService is thus returning null. What specific changes need to be made to the code below in order to enable client …

java spring spring-mvc spring-security spring-boot

0
推荐指数
1
解决办法
8762
查看次数

在Windows 7中设置JAVA_HOME

当我尝试在eclipse中运行ant buildfile时出现以下错误:

BUILD FAILED
C:\mypath\myapp\BuildWar.xml:16: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files\Java\jre7"  
Run Code Online (Sandbox Code Playgroud)

我将jdk放在C:\ mypath\Java\jdk1.7.0_17\bin\javac.exe

我使用此博客条目中的方法在Windows 7中创建一个名为JAVA_HOME的系统环境变量,并映射到C:\ mypath\Java\jdk1.7.0_17\bin\javac.exe.当错误持续存在时,我重新启动计算机,再次尝试,并得到相同的错误.然后我将JAVA_HOME的映射更改为C:\ mypath\Java\jdk1.7.0_17\bin \并仍然出现相同的错误.

谁能告诉我如何通过这个错误,以便我可以在eclipse中运行我的ant构建文件?


编辑:

今天当我尝试运行ant buildfile时,我再次收到相同的错误消息,即使根据下面的答案设置了JAVA_HOME,即使路径变量现在包含%JAVA_HOME%\ bin.我已经在windows控制面板部分检查了这些环境变量的值来设置环境变量,即使eclipse控制台给出了上述错误消息,说JAVA_HOME设置为jre.有没有人有任何关于如何解决这个反复出现的问题的建议?


第二次编辑:

在eclipse中更改Java Home修复了这个问题.eclipse Java Home与windows Java Home是分开的.

java eclipse ant

-1
推荐指数
1
解决办法
2820
查看次数