JHipster version 6.8.0
jdk1.8.0_131
Running with Spring Boot v2.2.5.RELEASE, Spring v5.2.4.RELEASE
Ubuntu 16.04 LTS
Intellij IDEA Community Edition(latest)
Video link: https://www.youtube.com/watch?v=uQqlO3IGpTU&feature=emb_logo
I generated a project using JHipster version 6.8.0 offline by watching above video link. But I am getting below error while running the app first time itself.
Log:
2020-03-11 16:46:22.577 WARN 31369 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'h2TCPServer' defined in class path resource [com/apprik/myapp/config/DatabaseConfiguration.class]: Invocation of init method failed; nested exception is org.h2.jdbc.JdbcSQLNonTransientException: IO Exception: "java.net.UnknownHostException: gopal: gopal: Name or service not known" [90028-200]
2020-03-11 16:46:22.616 DEBUG 31369 --- [ restartedMain] c.e.c.E.apprik.myapp.domain.Authority : Close successful.
2020-03-11 16:46:22.618 DEBUG 31369 --- [ restartedMain] c.e.c.E.a.myapp.domain.User.authorities : Close successful.
2020-03-11 16:46:22.619 DEBUG 31369 --- [ restartedMain] c.e.c.E.apprik.myapp.domain.User : Close successful.
2020-03-11 16:46:22.622 DEBUG 31369 --- [ restartedMain] c.ehcache.core.Ehcache-usersByEmail : Close successful.
2020-03-11 16:46:22.623 DEBUG 31369 --- [ restartedMain] c.ehcache.core.Ehcache-usersByLogin : Close successful.
2020-03-11 16:46:22.781 ERROR 31369 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'h2TCPServer' defined in class path resource [com/apprik/myapp/config/DatabaseConfiguration.class]: Invocation of init method failed; nested exception is org.h2.jdbc.JdbcSQLNonTransientException: IO Exception: "java.net.UnknownHostException: gopal: gopal: Name or service not known" [90028-200]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at com.apprik.myapp.MyappApp.main(MyappApp.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: org.h2.jdbc.JdbcSQLNonTransientException: IO Exception: "java.net.UnknownHostException: gopal: gopal: Name or service not known" [90028-200]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:505)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:429)
at org.h2.message.DbException.get(DbException.java:194)
at org.h2.message.DbException.convert(DbException.java:339)
at org.h2.util.NetUtils.getLocalAddress(NetUtils.java:254)
at org.h2.server.TcpServer.getURL(TcpServer.java:204)
at org.h2.tools.Server.start(Server.java:512)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1922)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1864)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792)
... 19 common frames omitted
Caused by: java.net.UnknownHostException: gopal: gopal: Name or service not known
at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
at org.h2.util.NetUtils.getLocalAddress(NetUtils.java:252)
... 28 common frames omitted
Caused by: java.net.UnknownHostException: gopal: Name or service not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getLocalHost(InetAddress.java:1500)
... 29 common frames omitted
Process finished with exit code 0
Seems to me that the application cannot connect to the h2 database. But to recreate your problem we need more information. Could you please complete the issue template and provide any .yo-rc.json and JDL files that you used to generate this application. 馃槃
Thank you so much @SudharakaP for kind response.
Please check below for .yo-rc.json. Also please let me know where will I get JDL files. I am new to JHipster.
.yo-rc.json
{
"generator-jhipster": {
"promptValues": {
"packageName": "com.apprik.myapp",
"nativeLanguage": "en"
},
"jhipsterVersion": "6.8.0",
"applicationType": "monolith",
"baseName": "myapp",
"packageName": "com.apprik.myapp",
"packageFolder": "com/apprik/myapp",
"serverPort": "8080",
"authenticationType": "jwt",
"cacheProvider": "ehcache",
"enableHibernateCache": true,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "postgresql",
"searchEngine": false,
"messageBroker": false,
"serviceDiscoveryType": false,
"buildTool": "maven",
"enableSwaggerCodegen": false,
"jwtSecretKey": "***********************************************",
"embeddableLaunchScript": false,
"useSass": true,
"clientPackageManager": "npm",
"clientFramework": "angularX",
"clientTheme": "none",
"clientThemeVariant": "",
"creationTimestamp": 1583838194504,
"testFrameworks": ["protractor"],
"jhiPrefix": "jhi",
"entitySuffix": "",
"dtoSuffix": "DTO",
"otherModules": [],
"enableTranslation": true,
"nativeLanguage": "en",
"languages": ["en", "hi"],
"blueprints": []
}
}
I think this won't be a JHipster issue.
What does the ping command says?
ping gopal
What your /etc/hosts looks like?
cat /etc/hosts
What does the hostname command print?
hostname
Or
Telnet?
pc@gopal:~/Gopal/jhipster/myApp$ ping gopal
ping: unknown host gopal
pc@gopal:~/Gopal/jhipster/myApp$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 pc-0000000000
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
pc@gopal:~/Gopal/jhipster/myApp$ hostname
gopal
pc@gopal:~/Gopal/jhipster/myApp$ ping localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.039 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.080 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.077 ms
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.078 ms
64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.088 ms
64 bytes from localhost (127.0.0.1): icmp_seq=6 ttl=64 time=0.074 ms
64 bytes from localhost (127.0.0.1): icmp_seq=7 ttl=64 time=0.079 ms
64 bytes from localhost (127.0.0.1): icmp_seq=8 ttl=64 time=0.080 ms
64 bytes from localhost (127.0.0.1): icmp_seq=9 ttl=64 time=0.078 ms
64 bytes from localhost (127.0.0.1): icmp_seq=10 ttl=64 time=0.081 ms
64 bytes from localhost (127.0.0.1): icmp_seq=11 ttl=64 time=0.078 ms
^C
--- localhost ping statistics ---
11 packets transmitted, 11 received, 0% packet loss, time 10238ms
rtt min/avg/max/mdev = 0.039/0.075/0.088/0.015 ms
pc@gopal:~/Gopal/jhipster/myApp$
pc@gopal:~/Gopal/jhipster/myApp$ ping gopal
ping: unknown host gopal
Here is the problem.
try adding a DNS entry for gopal.
sudo echo "127.0.0.1 gopal" >> /etc/hosts,
This might fix your issue.
It's solved, Thank you for your kind support. @pmverma @SudharakaP
@thinkgopal : You are welcome :smile:
Most helpful comment
Here is the problem.
try adding a DNS entry for
gopal.sudo echo "127.0.0.1 gopal" >> /etc/hosts,This might fix your issue.