小编use*_*833的帖子

无法获得System Java Compiler.请使用JDK,而不是JRE

我得到了无法获得系统Java编译器.请使用JDK,而不是JRE.当jsp文件在我的项目中时,我将它部署到Google App Engine.所以我尝试了以下方法来解决问题:

  1. 将-vm C:\ Program Files\Java\jdk1.6.0_43\bin\javaw.exe添加到我的eclipse.ini中.
  2. 确保JDK位于项目的构建路径中,而不是jre.
  3. 将C:\ Program Files\Java\jdk1.6.0_43\bin \添加到PATH for Environment Variable.

但这些都没有解决问题.我怎么解决这个问题?

java google-app-engine

33
推荐指数
5
解决办法
3万
查看次数

使用Play Framework获取请求参数?

我正在学习游戏框架,并了解我可以映射请求,例如/manager/user:

  GET      /manage/:user    Controllers.Application.some(user:String)
Run Code Online (Sandbox Code Playgroud)

我如何映射请求/play/video?video_id=1sh1

java playframework-2.0

25
推荐指数
3
解决办法
4万
查看次数

不支持的major.minor版本51.0(无法加载类org.postgresql.Driver)

使用maven创建了一个Web应用程序并将其部署在heroku上.一切正常,但当我调用一个使用postgresql-9.2-1002.jdbc4驱动程序的动作时,我得到:

java.lang.UnsupportedClassVersionError: org/postgresql/Driver : Unsupported major.minor version 51.0 (unable to load class org.postgresql.Driver)
Run Code Online (Sandbox Code Playgroud)

我知道问题是我在我的开发环境中使用jdk 7并且在heroku上运行了较低版本(至少我认为是这样).我的第一个问题是,为什么其他操作不会给出此错误,只有使用postqresql驱动程序的操作才会出现此问题,其余的应用程序工作正常?我做的另一件事是下载jdk 6,然后将其添加到我的项目构建路径,然后将eclipse编译器符合性配置为1.6,但即便如此,我也有同样的问题.我怎么解决这个问题?

java heroku

22
推荐指数
4
解决办法
3万
查看次数

发现了多个名称为[spring_web]的片段。相对顺序不合法

我有一个Spring Boot应用程序,当我使用来自Intellj的嵌入式服务器运行它时,它运行良好。但是,当我将其打包到.war文件并将其部署在tomcat上时,出现以下错误:

    org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/file-upload-0.0.1-SNAPSHOT]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
    at 

     org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:985)
    at 
   org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at  
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: More than one fragment with the name [spring_web] was found. This is not legal with relative ordering. See section 8.2.2 2c of the Servlet specification for details. Consider using absolute ordering.
    at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2200)
    at 
  org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2159)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1124)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:769)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
    at 

 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5176)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) …
Run Code Online (Sandbox Code Playgroud)

java spring-mvc tomcat8 spring-boot

11
推荐指数
8
解决办法
2万
查看次数

org.hibernate.service.UnknownServiceException:请求未知服务

我正在为我的AbstractHibernateRepository保存方法编写一个单元测试.我正在使用spring test runner但运行时遇到以下异常:

org.hibernate.service.UnknownServiceException: Unknown service requested [org.hibernate.engine.jdbc.connections.spi.ConnectionProvider]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:201)
Run Code Online (Sandbox Code Playgroud)

我的测试:

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("file:src/main/webapp/WEB-INF/spring/spring-hibernate.xml")
public class AbstractHibernateRepoTest extends AbstractHibernateRepo<Video> {
    @Autowired private SessionFactory sessionFactory;
    private Video video;

    public AbstractHibernateRepoTest() 
    {
        super(Video.class);
    }

    @Before
    public void setUp ()
    {
        video = new Video();
        video.setId("xyz");
        video.setName("Video Name");
        video.setSrc("Source");
        video.setThumbnail("Thumbnail");
        Session session = sessionFactory.openSession();
        session.beginTransaction();
        session.save(video) ;
        session.close();
    }

    @Test
    public void testSaveMethod ()
    {
        video.setId("asa");
        String id = (String) save(video);
        Assert.assertEquals(video.getId(), id);
    }

    @After
    public void breakDown ()
    {
        sessionFactory.close();
    }
}
Run Code Online (Sandbox Code Playgroud)

库: …

java spring hibernate spring-test hibernate-session

6
推荐指数
1
解决办法
3万
查看次数

org.postgresql.util.PSQLException:致命:主机没有pg_hba.conf条目

我正在编写一个使用Hibernate连接到Heroku Postresql的Web应用程序.当应用程序部署到Heroku时,一切正常,但是当我在本地运行应用程序时,我得到以下异常.

 org.hibernate.exception.GenericJDBCException: Could not open connection
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:304)
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:169)
at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.doBegin(JdbcTransaction.java:67)
at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.begin(AbstractTransactionImpl.java:160)
at org.hibernate.internal.SessionImpl.beginTransaction(SessionImpl.java:1395)
at com.kyrogaming.actions.HomeAction.execute(HomeAction.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252)
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:249)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:249)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73) …
Run Code Online (Sandbox Code Playgroud)

java postgresql hibernate

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

操作对象HTMLLIElement

我试图从ul元素中获取li标签然后隐藏它们但是当我调用hide函数时我得到了Object#没有方法'hide'

 var li = $(this).siblings("ul").children("li");
 li.get(0).hide ();
Run Code Online (Sandbox Code Playgroud)

我认为问题是我不能调用常规的jquery方法,除非它是一个对象,如果是这样我怎样才能得到对象而不是如果不是如何调用方法形式

javascript jquery dom

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

在本地连接到herokupostgresql时出错

我正在编写一个struts2应用程序并使用hibernate进行持久化.我在heroku上部署了app应用程序,一切正常,但是当我在本地运行时,我得到:

 org.postgresql.util.PSQLException: FATAL:no pg_hba.conf entry for host "xx.xx.xxx.xxx", user "someuser", database "somedatabase", SSL off
Run Code Online (Sandbox Code Playgroud)

我知道问题是我需要通过ssl连接到数据库但是如何在本地设置它?

java postgresql hibernate heroku

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

用于在eclipse中轻松进行依赖管理的Java工具

是否有任何java工具可用于自动下载我想要使用的框架的jar并管理Eclipse中的依赖项.我一直很羡慕Visual Studio,做这样的事情是多么容易,我想知道是否有像Eclipse这样的功能.

java

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