Closed d33tah closed 8 years ago
Jestem jak najbardziej za.
@SebastianCelejewski: OK, jesteś w stanie pomóc mi to stworzyć? Umiesz odpalić ten projekt na swoim komputerze? Używasz może Linuksa?
Pytam, bo próbuję ustalić, jaki kontener ustawić jako bazowy (która dystrybucja i wersja).
Ubuntu 14.04.2 LTS U siebie na komputerze jeszcze projektu nie odpaliłem. Jesteś może zapisany do list mailingowych open-pkw? Bo tam ludzie mogą udzielić wszystkich informacji.
Póki co mam tyle:
FROM debian:sid
RUN apt-get update
RUN apt-get install -y maven2
RUN apt-get install -y openjdk-8-jdk
RUN echo 'export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64' >> /etc/profile
ADD . /root/openpkw-weryfikator
RUN . /etc/profile && echo $JAVA_HOME && cd /root/openpkw-weryfikator && mvn install -e
Trzeba to uruchomić w głównym katalogu tego repozytorium, w ten sposób:
git clone https://github.com/openpkw/openpkw-weryfikator.git
cd openpkw-weryfikator.git
cp /tmp/sciezka-do/Dockerfile .
sudo docker build -t openpkw-weryfikator .
sudo docker run -ti openpkw-weryfikator
W tym momencie mam już build success, ale nie mam pojęcia jak właściwie uruchomić ten program.
Należy wykonać dwa kroki:
Oba kroki są mniej więcej opisane w technical readme.
Szczerze mówiąc, jestem totalnie zagubiony już na pierwszym kroku. Możesz mi zacytować fragment który opisuje jak utworzyć bazę danych?
Ja tutaj widzę już teraz 2 instancje docker'a. Jedna dla kontenera JEE (WildFly) i kolejną dla bazy danych. Dodam, że w ramach OPW prezydent2015 zrezygnowaliśmy z pomysłu bazy w dockerze na korzyść prawdziwego klastra Postgres'ów.
Czemu te dwa pomysły się wykluczają? Poza tym, jak ciężko byłoby stworzyć te dwa obrazy dockera póki co jako jeden i potem je oddzielić?
| Czemu te dwa pomysły się wykluczają? Nie powiedziałem, że się wykluczają. | póki co jako jeden i potem je oddzielić? Powodzenia, trzymam kciuki.
W takim razie póki co chciałbym poprosić o pomoc w wykonaniu kroku pierwszego - utworzenia bazy danych. @SebastianCelejewski - nie mam wystarczającego doświadczenia z technologiami, których używa ten projekt - mogę poprosić o wskazanie, które fragmenty technical readme dotyczą tego kroku?
U siebie mam tak (wszystko pod Windows):
Aby utworzyć bazę danych na serwerze należy:
Jak sprawdzić czy się powiodło.
W przypadku uruchomienia WildFly należy zobaczyć co wyświetlił w konsoli. Nie powinno tam być żadnych błędów ani ostrzeżeń. W szczególności trzeba sprawdzić czy nie było żadnych zajętych portów http. Wyjątkiem jest ostrzeżenie "Server VM warning: ignoring option MaxPermSize=256M", ono nie przeszkadza. Na końcu informacji wypisywanych w konsoli powinien być komunikat "WildFly (...) started in (...) ms''.
W przypadku odpalenia h2_database.cli do konsoli powinien być wypisany komunikat {"outcome" => "success"}.
OK, zainstalowałem WildFly, utworzyłem użytkownika, z sukcesem odpaliłem h2_database i chciałem odpalić deploy. Za pierwszym razem narzekał, że na porcie 3306 nic nie słucha, doinstalowałem mysql-server i powtórzyłem deploy, dostałem taki błąd:
<incomplete log removed by Adam>
Eksperymentuję z w tym forku: https://github.com/openpkw/openpkw-weryfikator/compare/openpkw:master...d33tah:master
A gdzie tu błąd?
Dnia 27 września 2015 22:12:19 CEST, Jacek Wielemborek notifications@github.com napisał(a):
OK, zainstalowałem WildFly, utworzyłem użytkownika, z sukcesem odpaliłem h2_database i chciałem odpalić deploy. Za pierwszym razem narzekał, że na porcie 3306 nic nie słucha, doinstalowałem mysql-server i powtórzyłem deploy, dostałem taki błąd:
root@1a8490ae6996:/# /wildfly-9.0.1.Final/bin/jboss-cli.sh --connect --command="deploy --force /root/openpkw-weryfikator/openpkw-rest/target/openpkw.war" 20:05:55,279 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 69) WFLYUT0022: Unregistered web context: /openpkw 20:05:55,284 INFO [io.undertow.servlet] (ServerService Thread Pool -- 69) Destroying Spring FrameworkServlet 'dispatcher' 20:05:55,296 INFO [org.springframework.web.context.support.AnnotationConfigWebApplicationContext] (ServerService Thread Pool -- 69) Closing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Sun Sep 27 20:01:06 UTC 2015]; parent: Root WebApplicationContext 20:05:55,306 INFO [io.undertow.servlet] (ServerService Thread Pool -- 69) Closing Spring root WebApplicationContext 20:05:55,307 INFO [org.springframework.web.context.support.AnnotationConfigWebApplicationContext] (ServerService Thread Pool -- 69) Closing Root WebApplicationContext: startup date [Sun Sep 27 20:01:03 UTC 2015]; root of context hierarchy 20:05:55,354 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 74) WFLYJPA0011: Stopping Persistence Unit (phase 2 of 2) Service 'openpkw.war#org.openpkw' 20:05:55,386 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 73) WFLYJPA0011: Stopping Persistence Unit (phase 1 of 2) Service 'openpkw.war#org.openpkw' 20:05:55,442 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0028: Stopped deployment openpkw.war (runtime-name: openpkw.war) in 167ms 20:05:55,444 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0027: Starting deployment of "openpkw.war" (runtime-name: "openpkw.war") 20:05:57,160 INFO [org.jboss.as.jpa] (MSC service thread 1-1) WFLYJPA0002: Read persistence.xml for org.openpkw 20:05:57,247 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 73) WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'openpkw.war#org.openpkw' 20:05:57,248 INFO [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 73) HHH000204: Processing PersistenceUnitInfo [ name: org.openpkw ...] 20:05:57,404 WARN [org.jboss.as.ee] (MSC service thread 1-3) WFLYEE0007: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to an exception (enable DEBUG log level to see the cause) 20:05:57,408 WARN [org.jboss.as.ee] (MSC service thread 1-3) WFLYEE0007: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to an exception (enable DEBUG log level to see the cause) 20:05:57,469 WARN [org.jboss.weld.deployer] (MSC service thread 1-3) WFLYWELD0013: Deployment deployment "openpkw.war" contains CDI annotations but no bean archive was not found. (No beans.xml nor class with bean defining annotations) 20:05:57,484 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 73) WFLYJPA0010: Starting Persistence Unit (phase 2 of 2) Service 'openpkw.war#org.openpkw' 20:05:57,525 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (ServerService Thread Pool -- 73) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: IJ031084: Unable to create connection Caused by: org.h2.jdbc.JdbcSQLException: Connection is broken: "unexpected status 1275068416" [90067-173] 20:05:57,541 WARN [org.hibernate.engine.jdbc.internal.JdbcServicesImpl] (ServerService Thread Pool -- 73) HHH000342: Could not obtain connection to query metadata : javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/jboss/databases/openpkw 20:05:57,542 INFO [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 73) HHH000400: Using dialect: org.hibernate.dialect.H2Dialect 20:05:57,548 WARN [org.hibernate.dialect.H2Dialect] (ServerService Thread Pool -- 73) HHH000431: Unable to determine H2 database version, certain features may not work 20:05:57,549 INFO [org.hibernate.engine.jdbc.internal.LobCreatorBuilder] (ServerService Thread Pool -- 73) HHH000422: Disabling contextual LOB creation as connection was null 20:05:57,606 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (ServerService Thread Pool -- 73) HHH000397: Using ASTQueryTranslatorFactory 20:05:57,834 INFO [io.undertow.servlet] (ServerService Thread Pool -- 73) Spring WebApplicationInitializers detected on classpath: [org.openpkw.web.configuration.AppInitializer@c127fc0] 20:05:57,900 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 73) Initializing Mojarra 2.2.11-jbossorg-1 20150505-1501 for context '/openpkw' 20:05:59,094 INFO [io.undertow.servlet] (ServerService Thread Pool -- 73) Initializing Spring root WebApplicationContext 20:05:59,104 INFO [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 73) Root WebApplicationContext: initialization started 20:05:59,229 INFO [org.springframework.web.context.support.AnnotationConfigWebApplicationContext] (ServerService Thread Pool -- 73) Refreshing Root WebApplicationContext: startup date [Sun Sep 27 20:05:59 UTC 2015]; root of context hierarchy 20:05:59,297 INFO [org.springframework.web.context.support.AnnotationConfigWebApplicationContext] (ServerService Thread Pool -- 73) Registering annotated classes: [class org.openpkw.web.configuration.AppConfig] 20:05:59,712 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (ServerService Thread Pool -- 73) Loading XML bean definitions from "/content/openpkw.war/WEB-INF/classes/META-INF/spring/openpkw-context.xml" 20:05:59,799 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (ServerService Thread Pool -- 73) Loading XML bean definitions from "/content/openpkw.war/WEB-INF/lib/openpkw-repositories-0.1.0-SNAPSHOT.jar/META-INF/spring/openpkw-local.xml" 20:05:59,864 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (ServerService Thread Pool -- 73) Loading XML bean definitions from "/content/openpkw.war/WEB-INF/lib/openpkw-repositories-0.1.0-SNAPSHOT.jar/META-INF/spring/openpkw-repos.xml" 20:06:00,197 INFO [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor] (ServerService Thread Pool -- 73) JSR-330 'javax.inject.Inject' annotation found and supported for autowiring 20:06:00,851 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 73) Mapped "{[/test/echo],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.util.Map org.openpkw.web.controllers.EchoController.echo(java.util.Map) 20:06:00,854 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 73) Mapped "{[/vote],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.openpkw.model.voting.VoteResponse org.openpkw.web.controllers.VoteController.vote(org.openpkw.model.voting.VoteRequest) 20:06:00,857 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 73) Mapped "{[/user],methods=[POST],params=[],headers=[],consumes=[application/json],produces=[application/json],custom=[]}" onto org.springframework.http.ResponseEntity<java.lang.Object> org.openpkw.web.controllers.registering.RegistrationController.registerUser(org.springframework.http.RequestEntity<org.openpkw.model.entity.User>) 20:06:00,860 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 73) Mapped "{[/result],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.openpkw.model.dto.ResultDTO org.openpkw.web.controllers.ResultController.Result() 20:06:00,922 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] (ServerService Thread Pool -- 73) Mapped URL path [/resources/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 20:06:00,928 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] (ServerService Thread Pool -- 73) Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler] 20:06:01,011 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter] (ServerService Thread Pool -- 73) Looking for @ControllerAdvice: Root WebApplicationContext: startup date [Sun Sep 27 20:05:59 UTC 2015]; root of context hierarchy 20:06:01,206 INFO [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 73) Root WebApplicationContext: initialization completed in 2101 ms 20:06:01,210 INFO [io.undertow.servlet] (ServerService Thread Pool -- 73) Initializing Spring FrameworkServlet 'dispatcher' 20:06:01,212 INFO [org.springframework.web.servlet.DispatcherServlet] (ServerService Thread Pool -- 73) FrameworkServlet 'dispatcher': initialization started 20:06:01,237 INFO [org.springframework.web.context.support.AnnotationConfigWebApplicationContext] (ServerService Thread Pool -- 73) Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Sun Sep 27 20:06:01 UTC 2015]; parent: Root WebApplicationContext 20:06:01,240 INFO [org.springframework.web.context.support.AnnotationConfigWebApplicationContext] (ServerService Thread Pool -- 73) Registering annotated classes: [class org.openpkw.web.configuration.MVCConfig] 20:06:01,316 INFO [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor] (ServerService Thread Pool -- 73) JSR-330 'javax.inject.Inject' annotation found and supported for autowiring 20:06:01,368 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 73) Mapped "{[/test/echo],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.util.Map org.openpkw.web.controllers.EchoController.echo(java.util.Map) 20:06:01,372 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 73) Mapped "{[/vote],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.openpkw.model.voting.VoteResponse org.openpkw.web.controllers.VoteController.vote(org.openpkw.model.voting.VoteRequest) 20:06:01,374 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 73) Mapped "{[/user],methods=[POST],params=[],headers=[],consumes=[application/json],produces=[application/json],custom=[]}" onto org.springframework.http.ResponseEntity<java.lang.Object> org.openpkw.web.controllers.registering.RegistrationController.registerUser(org.springframework.http.RequestEntity<org.openpkw.model.entity.User>) 20:06:01,376 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 73) Mapped "{[/result],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.openpkw.model.dto.ResultDTO org.openpkw.web.controllers.ResultController.Result() 20:06:01,396 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] (ServerService Thread Pool -- 73) Mapped URL path [/resources/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 20:06:01,400 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] (ServerService Thread Pool -- 73) Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler] 20:06:01,415 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter] (ServerService Thread Pool -- 73) Looking for @ControllerAdvice: WebApplicationContext for namespace 'dispatcher-servlet': startup date [Sun Sep 27 20:06:01 UTC 2015]; parent: Root WebApplicationContext 20:06:01,467 INFO [org.springframework.web.servlet.DispatcherServlet] (ServerService Thread Pool -- 73) FrameworkServlet 'dispatcher': initialization completed in 254 ms 20:06:01,469 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 73) WFLYUT0021: Registered web context: /openpkw 20:06:01,925 INFO [org.jboss.as.server] (management-handler-thread - 10) WFLYSRV0016: Replaced deployment "openpkw.war" with deployment "openpkw.war"
Eksperymentuję z w tym forku: https://github.com/openpkw/openpkw-weryfikator/compare/openpkw:master...d33tah:master
Reply to this email directly or view it on GitHub: https://github.com/openpkw/openpkw-weryfikator/issues/1#issuecomment-143591548
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Sorki, mój terminal upiera się, żeby nie kopiować kolorowego tekstu. Log wygląda tak:
[0m[0m20:50:06,169 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 72) WFLYUT0022: Unregistered web context: /openpkw
[0m[0m20:50:06,174 INFO [io.undertow.servlet] (ServerService Thread Pool -- 72) Destroying Spring FrameworkServlet 'dispatcher'
[0m[0m20:50:06,175 INFO [org.springframework.web.context.support.AnnotationConfigWebApplicationContext] (ServerService Thread Pool -- 72) Closing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Sun Sep 27 20:40:55 UTC 2015]; parent: Root WebApplicationContext
[0m[0m20:50:06,179 INFO [io.undertow.servlet] (ServerService Thread Pool -- 72) Closing Spring root WebApplicationContext
[0m[0m20:50:06,180 INFO [org.springframework.web.context.support.AnnotationConfigWebApplicationContext] (ServerService Thread Pool -- 72) Closing Root WebApplicationContext: startup date [Sun Sep 27 20:40:51 UTC 2015]; root of context hierarchy
[0m[0m20:50:06,241 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 77) WFLYJPA0011: Stopping Persistence Unit (phase 2 of 2) Service 'openpkw.war#org.openpkw'
[0m[0m20:50:06,253 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 80) WFLYJPA0011: Stopping Persistence Unit (phase 1 of 2) Service 'openpkw.war#org.openpkw'
[0m[0m20:50:06,322 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0028: Stopped deployment openpkw.war (runtime-name: openpkw.war) in 161ms
[0m[0m20:50:06,328 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0027: Starting deployment of "openpkw.war" (runtime-name: "openpkw.war")
[0m[0m20:50:07,396 INFO [org.jboss.as.jpa] (MSC service thread 1-2) WFLYJPA0002: Read persistence.xml for org.openpkw
[0m[0m20:50:07,509 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 77) WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'openpkw.war#org.openpkw'
[0m[0m20:50:07,510 INFO [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 77) HHH000204: Processing PersistenceUnitInfo [
name: org.openpkw
...]
[0m[33m20:50:07,738 WARN [org.jboss.as.ee] (MSC service thread 1-1) WFLYEE0007: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to an exception (enable DEBUG log level to see the cause)
[0m[33m20:50:07,749 WARN [org.jboss.as.ee] (MSC service thread 1-1) WFLYEE0007: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to an exception (enable DEBUG log level to see the cause)
[0m[33m20:50:07,874 WARN [org.jboss.weld.deployer] (MSC service thread 1-1) WFLYWELD0013: Deployment deployment "openpkw.war" contains CDI annotations but no bean archive was not found. (No beans.xml nor class with bean defining annotations)
[0m[0m20:50:07,886 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 77) WFLYJPA0010: Starting Persistence Unit (phase 2 of 2) Service 'openpkw.war#org.openpkw'
[0m[33m20:50:08,109 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (ServerService Thread Pool -- 77) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: IJ031084: Unable to create connection
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:336)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:343)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:278)
at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:1224)
at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:484)
at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:622)
at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:594)
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:579)
at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:430)
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:737)
at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:138)
at org.jboss.as.connector.subsystems.datasources.WildFlyDataSource.getConnection(WildFlyDataSource.java:67)
at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:139)
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcServicesImpl.java:279)
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:124)
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)
at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1887)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1845)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:857)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:425)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:849)
at org.jboss.as.jpa.hibernate4.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117)
at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:665)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: org.h2.jdbc.JdbcSQLException: Connection is broken: "unexpected status 1275068416" [90067-173]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:331)
at org.h2.message.DbException.get(DbException.java:171)
at org.h2.message.DbException.get(DbException.java:148)
at org.h2.engine.SessionRemote.done(SessionRemote.java:594)
at org.h2.engine.SessionRemote.initTransfer(SessionRemote.java:113)
at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:403)
at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:295)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:105)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:90)
at org.h2.Driver.connect(Driver.java:73)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:312)
... 32 more
[0m[33m20:50:08,112 WARN [org.hibernate.engine.jdbc.internal.JdbcServicesImpl] (ServerService Thread Pool -- 77) HHH000342: Could not obtain connection to query metadata : javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/jboss/databases/openpkw
[0m[0m20:50:08,117 INFO [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 77) HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
[0m[33m20:50:08,122 WARN [org.hibernate.dialect.H2Dialect] (ServerService Thread Pool -- 77) HHH000431: Unable to determine H2 database version, certain features may not work
[0m[0m20:50:08,122 INFO [org.hibernate.engine.jdbc.internal.LobCreatorBuilder] (ServerService Thread Pool -- 77) HHH000422: Disabling contextual LOB creation as connection was null
[0m[0m20:50:08,169 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (ServerService Thread Pool -- 77) HHH000397: Using ASTQueryTranslatorFactory
[0m[0m20:50:08,478 INFO [io.undertow.servlet] (ServerService Thread Pool -- 77) Spring WebApplicationInitializers detected on classpath: [org.openpkw.web.configuration.AppInitializer@6ec5bbfe]
[0m[0m20:50:08,588 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 77) Initializing Mojarra 2.2.11-jbossorg-1 20150505-1501 for context '/openpkw'
[0m[0m20:50:09,552 INFO [io.undertow.servlet] (ServerService Thread Pool -- 77) Initializing Spring root WebApplicationContext
[0m[0m20:50:09,558 INFO [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 77) Root WebApplicationContext: initialization started
[0m[0m20:50:09,623 INFO [org.springframework.web.context.support.AnnotationConfigWebApplicationContext] (ServerService Thread Pool -- 77) Refreshing Root WebApplicationContext: startup date [Sun Sep 27 20:50:09 UTC 2015]; root of context hierarchy
[0m[0m20:50:09,687 INFO [org.springframework.web.context.support.AnnotationConfigWebApplicationContext] (ServerService Thread Pool -- 77) Registering annotated classes: [class org.openpkw.web.configuration.AppConfig]
[0m
Trudno mi powiedzieć w czym tkwi błąd. Zastanawia mnie jedna sprawa - instalowałeś mysql. Ja eksperymentując z vagrantem nie musiałem instalować mysql.
Wychodzi na to, że w kodzie wspomniany jest MySQL:
(virtualenv)[0/1][18:27:13][~/workspace/openpkw/openpkw-weryfikator]$ grep '3306' * -r
log:Caused by: org.h2.jdbc.JdbcSQLException: Connection is broken: "java.net.ConnectException: Connection refused: localhost:3306" [90067-173]
openpkw-etc/src/main/etc/wildfly/h2_database.cli:/subsystem=datasources/data-source=OpenPKWDS/:add(user-name=sa, jndi-name=java:/jboss/databases/openpkw,driver-name=h2,connection-url=jdbc:h2:tcp://localhost:3306/openpkw_1,max-pool-size=20,track-statements=NOWARN,flush-strategy=FailingConnectionOnly,min-pool-size=0)
(virtualenv)[0/1][18:27:16][~/workspace/openpkw/openpkw-weryfikator]$ grep 'mysql' * -r
openpkw-rest/src/main/resources/jdbc.properties:jdbc.driverClassName = com.mysql.jdbc.Driver
openpkw-rest/src/main/resources/jdbc.properties:jdbc.url = jdbc:mysql://localhost/spring?characterEncoding=UTF-8
setup-wildfly.sh:/etc/init.d/mysql start
Dobra, po dzisiejszym spotkaniu Javowców chyba wiemy co to jest. Data source jest zdefiniowany w WildFly, więc aplikacja jest usatysfakcjonowana i wstaje gładko. Natomiast sam WildFly się burzy, że baza danych nie istnieje.
W najbliższym czasie uporządkujemy sprawę bazy danych, to problem zniknie. Na razie niech wisi jako issue.
Dostęp do bazy danych już jest uporządkowany. Musi tylko przejść code review i trafi do mastera. Wtedy można odblokować ten wątek i dokończyć tworzenie obrazów Dockera.
Nowa implementacja dostępu do bazy danych jest już w masterze, więc d33tah - jeśli masz czas i ochotę - możesz wrócić do tematu.
Nie jestem programistą Javy, ale chciałbym zobaczyć, jak aktualnie wygląda projekt. Co Wy na stworzenie projektu kontenera Dockera, który budowałby ten projekt z Gita i pozwolił jedną komendą go odpalić? Znam w miarę Dockera, ale w razie Waszego zainteresowania potrzebowałbym prawdopodobnie pomocy w kwestii budowania projektu.