无法为GlassFish 4.1.1创建JDBC连接池

时间:2015-10-17 18:05:51

标签: postgresql jdbc glassfish connection-pooling

我从官方网站下载了 GlassFish 4.1.1 ,并尝试在 Windows 8.1 上为 PostgreSQL 9.4 数据库创建JDBC连接池。所以我做了什么:

  1. postgresql-9.4-1200-jdbc41.jar复制到...\glassfish4\glassfish\lib\(我也尝试了...\glassfish4\glassfish\domains\domain1\lib\...\glassfish4\javadb\lib\
  2. 打开http://localhost:4848/并转到JDBC - > JDBC Connection Pools
  3. New,然后:

    Pool Name: PostgreSQLPool Resource Type: javax.sql.ConnectionPoolDataSource Database Driver Vendor: Postgresql

  4. Next

  5. 得到了:

    messageInternal Server Error
    descriptionThe server encountered an internal error that prevented it from fulfilling this request.
    exception
    java.lang.IllegalStateException: getOutputStream() has already been called for this response
    note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 4.1.1 logs.
    

    我安装了JDK 7& 8. JAVA_HOME指向java version "1.7.0_71"(当我将其更改为Java 8时,没有发生任何事情)。在Path变量中,我有两条到Java 7和...的路径。 Java 8.我发现建议从java.exejavax.exe删除Windows\System32Windows\SysWOW64等,但我没有这些文件。

    记录grom GlassFish日志文件:

    [2015-10-17T20:00:15.249+0200] [glassfish 4.1] [WARNING] [] [javax.enterprise.system.container.web.com.sun.web.security] [tid: _ThreadID=47 _ThreadName=admin-listener(2)] [timeMillis: 1445104815249] [levelValue: 900] [[
      Context path from ServletContext:  differs from path from bundle: /]]
    
    [2015-10-17T20:00:17.664+0200] [glassfish 4.1] [INFO] [] [org.glassfish.admingui] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1445104817664] [levelValue: 800] [[
      Redirecting to /common/index.jsf]]
    
    [2015-10-17T20:00:17.810+0200] [glassfish 4.1] [INFO] [] [org.glassfish.admingui] [tid: _ThreadID=48 _ThreadName=admin-listener(3)] [timeMillis: 1445104817810] [levelValue: 800] [[
      Admin Console: Initializing Session Attributes...]]
    
    [2015-10-17T20:01:19.134+0200] [glassfish 4.1] [INFO] [] [org.glassfish.admingui] [tid: _ThreadID=49 _ThreadName=admin-listener(4)] [timeMillis: 1445104879134] [levelValue: 800] [[
      Exception Occurred :null]]
    
    [2015-10-17T20:02:32.379+0200] [glassfish 4.1] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=106 _ThreadName=admin-listener(6)] [timeMillis: 1445104952379] [levelValue: 900] [[
      StandardWrapperValve[FacesServlet]: Servlet.service() for servlet FacesServlet threw exception
    java.lang.IllegalStateException: getOutputStream() has already been called for this response
        at org.apache.catalina.connector.Response.getWriter(Response.java:777)
        at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:224)
        at com.sun.faces.context.ExternalContextImpl.getResponseOutputWriter(ExternalContextImpl.java:851)
        at com.sun.faces.context.PartialViewContextImpl.createPartialResponseWriter(PartialViewContextImpl.java:504)
        at com.sun.faces.context.PartialViewContextImpl.access$300(PartialViewContextImpl.java:79)
        at com.sun.faces.context.PartialViewContextImpl$DelayedInitPartialResponseWriter.getWrapped(PartialViewContextImpl.java:642)
        at javax.faces.context.PartialResponseWriter.startDocument(PartialResponseWriter.java:120)
        at com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandlerImpl.java:202)
        at com.sun.faces.context.AjaxExceptionHandlerImpl.handle(AjaxExceptionHandlerImpl.java:127)
        at javax.faces.context.ExceptionHandlerWrapper.handle(ExceptionHandlerWrapper.java:100)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
        at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:233)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
        at org.apache.catalina.core.StandardPipeline.doChainInvoke(StandardPipeline.java:678)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283)
        at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
        at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
        at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
        at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
        at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)
        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
        at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)
        at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
        at java.lang.Thread.run(Thread.java:745)
    ]]
    

0 个答案:

没有答案