正如这里提到的,我有一点时间让我的小型Spring-Boot项目"正确"部署到Glassfish.它使用嵌入式Tomcat运行良好,但是一旦我尝试将其移动到我的组织环境(Glassfish 3.1.2)中,我就会遇到一些奇怪的行为.
认为这是我的代码,我回到了经过时间考验的"Hello World" - 方法,并在Spring的博客上建立了一个超级基本的应用程序.
当我一起去的时候,我确实做了一些非常小的偏差,但是根本没有任何应该影响这个应用程序的东西.
我发现的唯一一个主要偏差是我发现我无法从"spring-boot-starter-web"中排除"spring-boot-starter-tomcat" - 当我尝试这个时,我在STS中遇到了2个错误"Markers" "-标签:
The project was not built since its build path is incomplete. Cannot find the class file for javax.servlet.ServletContext. Fix the build path then try building this project
The type javax.servlet.ServletContext cannot be resolved. It is indirectly referenced from required .class files Application.java
Run Code Online (Sandbox Code Playgroud)
如果我清理了STS项目,然后运行Maven Clean,更新,安装Install目标会出现以下错误:
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project test: Compilation failure [ERROR] /Users/brandon_utah/Utah Development/sts_workspaces/NidTools Rebooted/test/src/main/java/test/Application.java:[13,8] cannot access javax.servlet.ServletException [ERROR] class file …Run Code Online (Sandbox Code Playgroud) 我有一个旧的Spring MVC项目,我曾经在JBoss上运行Eclipse,并使用JPA 2.0(我相信)一个PostgreSQL 9.1 DB.还使用Maven作为依赖项解析器.
我设法从硬盘崩溃中恢复了项目,但我无法使用Eclipse/Tomcat使其正常运行所以我想我可能会利用这个机会开始使用STS(Spring Tool Suite)并获得一个干净的项目 - 插入它所属的代码.
可悲的是,我一开始就陷入困境......我创建了一个支持Maven的Spring MVC项目,但无法设置JPA 2.0部分.
我转到Project> Properties> Project Facets,检查JPA并点击刚出现的链接"需要进一步配置......".
这让我进入了JPA Facet配置面板,我可以从两个平台"Generic 2.1"和"EclipseLink 2.5.x"中进行选择.我只能找到一些noSQL和Oracle支持EclipseLink所以我认为我会选择Generic 2.1(这是否意味着它是JPA 2.1?).
现在我可以选择JPA实现"用户库"或"禁用库配置".我尝试导入这个maven依赖项定义的.jar:
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
但它只是告诉我" 类'javax.persistence.Convert'需要在选定的库中 ".
也许Hibernate的JPA版本不符合"Generic 2.1"标准?我已经看过几次"你需要下载Hibernate工具",但这并没有改变任何东西.
此外,当我尝试使用PostgreSQL创建连接时,我没有任何驱动程序可供选择,如果我想添加一个,我唯一允许添加的是jdbc-postgres-8.x驱动程序.
我正在使用Spring Tool Suite 3.6.3和M2E eclipse插件1.4.1,当我从其中一个项目中打开POM文件时,我观察到并没有添加所有依赖项,我已经为jaxws-rt添加了版本的depnedecy配置2.2.8具有如下许多依赖关系
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>javax.xml.soap-api</artifactId>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</dependency>
<dependency>
<groupId>javax.jws</groupId>
<artifactId>jsr181-api</artifactId>
</dependency>
<!-- Provided dependencies -->
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>policy</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.gmbal</groupId>
<artifactId>gmbal-api-only</artifactId>
</dependency>
<dependency>
<groupId>org.jvnet.staxex</groupId>
<artifactId>stax-ex</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.stream.buffer</groupId>
<artifactId>streambuffer</artifactId>
</dependency>
<dependency>
<groupId>org.jvnet.mimepull</groupId>
<artifactId>mimepull</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.fastinfoset</groupId>
<artifactId>FastInfoset</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.ha</groupId>
<artifactId>ha-api</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.messaging.saaj</groupId>
<artifactId>saaj-impl</artifactId>
</dependency>
<dependency>
<artifactId>woodstox-core-asl</artifactId>
<groupId>org.codehaus.woodstox</groupId>
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>stax2-api</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId> …Run Code Online (Sandbox Code Playgroud) 我需要运行eclipse(java 1.7)和STS 3.8.1(java 1.8)但是如果我选择java 7作为默认值我在STS 3.8.1中遇到错误.我在用OS : ubuntu 14.10
Error : Version 1.7.0_80 of the JVM is not suitable for this product. Version: 1.8 or greater is required.
Run Code Online (Sandbox Code Playgroud)
或者我选择java 1.8默认日食不能正常工作.
我的要求是使用java 1.7 with STS. 最新版本3.8.1 构建项目,不支持java 1.7.
我尝试搜索哪个,version of STS support 1.7但我没有得到任何答案.
我正在尝试用Spring做一个简单的应用程序。我安装了用于Eclipse的插件spring(Spring Tool Suite(STS))。我在文件pom.xml中添加了Maven依赖项,但没有加载jar文件。我无法在类Produit中导入@Entity @Id,并且我不知道我的问题在哪里。
即时通讯收到此错误:
实体无法解析为类型。
<?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>org.sid</groupId>
<artifactId>ebotique</artifactId>
<name>EBotiqueV3</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.6</java-version>
<org.springframework-version>3.1.1.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId> …Run Code Online (Sandbox Code Playgroud) 我一直在寻找,但我找不到合适的解决方案,有没有办法在eclipse中显示GIT的作者姓名和修订号,就像我们在SVN中那样.
在标签装饰部分,我没有看到作者和修订的选项.
编辑:类似于Subclipse或Subversive的东西
非常奇怪,我第一次见到这个问题,在运行mac osSerria v10.12.3的Macbook Pro上安装STS版本3.8.3.这是我做的:
现在......问题...... 1.关闭笔记本电脑当天.这就是说我选择Apple-> Shut Down ..
2.第二天我进来,启动笔记本电脑.3.打开应用程序并选择STS并运行STS.
此时,我再次获得"选择默认工作区"弹出窗口...我的所有首选项和已安装的插件都被遗忘了,这就像我第一次再次运行应用程序一样?我安装的任何插件都被遗忘了,这一点特别奇怪?
我已经完全删除了STS,并重新安装了几次,它非常一致.此外,我已经在几个iMac台式机上安装了STS而没有问题.这有点像权限问题但不是错误...所有自定义的首选项都消失了.
任何想法将不胜感激.
每次我使用Spring Tool Suite启动新的Spring Boot项目时,Spring Starter Project我都可以使用GUI添加依赖项,如下面的屏幕截图所示.
在GUI中选择依赖项非常方便.但有时我会忘记添加一些依赖项并且必须pom.xml手动添加它们.
是否可以使用GUI以与Spring Starter Project项目创建后的配置相同的方式添加新的依赖项?
我必须创建一个Spring Boot WEB应用程序,但是JSP页面显示为纯文本,没有任何突出显示或标记。
如何配置STS以像Eclipse一样显示JSP文件?
使用STS 4.0.0.M12。
在STS 4中,我的Java 10 Spring Boot 2.1项目警告我:
未知的引用性质:org.springframework.ide.eclipse.core.springnature
我怎样才能解决这个问题?
eclipse ×6
java ×4
maven ×3
hibernate ×2
spring ×2
spring-boot ×2
egit ×1
git ×1
glassfish-3 ×1
jpa ×1
jsp ×1
macos ×1
postgresql ×1
ubuntu-14.10 ×1