I created an UAA from Jhipster:
? (1/16) Which *type* of application would you like to create? [BETA] JHipster UAA server (for microservice OAuth2 authentication)
? (2/16) What is the base name of your application? uaa
? (3/16) As you are running in a microservice architecture, on which port would like your server to run? It should be unique to avoid port conflicts. 9999
? (4/16) What is your default Java package name? com.xxx.uaa
? (5/16) Do you want to use the JHipster Registry to configure, monitor and scale your microservices and gateways? Yes
? (6/16) Which *type* of database would you like to use? MongoDB
? (7/16) Would you like to use Maven or Gradle for building the backend? Gradle
? (8/16) Which other technologies would you like to use?
? (9/16) Would you like to enable internationalization support? Yes
? Please choose the native language of the application Spanish
? Please choose additional languages to install English
? (10/16) Besides JUnit and Karma, which testing frameworks would you like to use?
? (11/16) Would you like to install other generators from the JHipster Marketplace? No
And once I've created it execute:
./gradlew
And give me the following error
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongobee' defined in class path resource [com/abalia/uaa/config/DatabaseConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: com.google.common.collect.Sets$SetView.iterator()Lcom/google/common/collect/UnmodifiableIterator;
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at com.abalia.uaa.UaaApp.main(UaaApp.java:69)
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: java.lang.NoSuchMethodError: com.google.common.collect.Sets$SetView.iterator()Lcom/google/common/collect/UnmodifiableIterator;
at org.reflections.Reflections.expandSuperTypes(Reflections.java:380)
at org.reflections.Reflections.<init>(Reflections.java:126)
at org.reflections.Reflections.<init>(Reflections.java:168)
at org.reflections.Reflections.<init>(Reflections.java:141)
at com.github.mongobee.utils.ChangeService.fetchChangeLogs(ChangeService.java:43)
at com.github.mongobee.Mongobee.executeMigration(Mongobee.java:166)
at com.github.mongobee.Mongobee.execute(Mongobee.java:153)
at com.github.mongobee.Mongobee.afterPropertiesSet(Mongobee.java:123)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
... 19 common frames omitted
I do not know if I should configure something else in a file. Mongo is running.
The database I imagine will be created alone, I have already done monolithic projects with Mongo database and I have not had to do anything in the database.
The project is as generated by Jhipster without any change.
In fact the database is created.
Related
I am creating a monolith app with jhipster-native. I got the following error.
ERROR! contents.replaceAll is not a function
TypeError: contents.replaceAll is not a function
at file:///usr/local/lib/node_modules/generator-jhipster-native/generators/server/generator.mjs:311:57
at default.editFile (file:///usr/local/lib/node_modules/generator-jhipster-native/generators/server/generator.mjs:447:17)
at default.replaceUndertowWithTomcat (file:///usr/local/lib/node_modules/generator-jhipster-native/generators/server/generator.mjs:311:16)
at Object. (/usr/local/lib/node_modules/generator-jhipster-native/node_modules/yeoman-generator/lib/index.js:1097:23)
at /usr/local/lib/node_modules/generator-jhipster-native/node_modules/run-async/index.js:49:25
at new Promise ()
at /usr/local/lib/node_modules/generator-jhipster-native/node_modules/run-async/index.js:26:19
at /usr/local/lib/node_modules/generator-jhipster-native/node_modules/yeoman-generator/lib/index.js:1098:9
at new Promise ()
at default.executeTask (/usr/local/lib/node_modules/generator-jhipster-native/node_modules/yeoman-generator/lib/index.js:1069:12)
The jhipster-native options are below.
Thank you in advance!
===================== JHipster Native =====================
info Using blueprint generator-jhipster-native for app subgenerator
Application files will be generated in folder: /Users/albanomataj/Projects/amataj/jhipster-examples/spring-native
_______________________________________________________________________________________________________________
Documentation for creating an application is at https://www.jhipster.tech/creating-an-app/
If you find JHipster useful, consider sponsoring the project at https://opencollective.com/generator-jhipster
_______________________________________________________________________________________________________________
? Which *type* of application would you like to create? Monolithic application (recommended for simple projects)
? What is the base name of your application? jhipster
info Using blueprint generator-jhipster-native for server subgenerator
? Do you want to make it reactive with Spring WebFlux? No
? What is your default Java package name? com.mycompany.myapp
? Which *type* of authentication would you like to use? OAuth 2.0 / OIDC Authentication (stateful, works with Keycloak and Okta)
? Which *type* of database would you like to use? SQL (H2, PostgreSQL, MySQL, MariaDB, Oracle, MSSQL)
? Which *production* database would you like to use? PostgreSQL
? Which *development* database would you like to use? H2 with disk-based persistence
? Which cache do you want to use? (Spring cache abstraction) No cache - Warning, when using an SQL database, this will disable the Hibernate 2nd level cache!
? Would you like to use Maven or Gradle for building the backend? Maven
? Do you want to use the JHipster Registry to configure, monitor and scale your application? No
? Which other technologies would you like to use?
? Which *Framework* would you like to use for the client? Angular
? Do you want to generate the admin UI? Yes
? Would you like to use a Bootswatch theme (https://bootswatch.com/)? Default JHipster
? Would you like to enable internationalization support? No
? Please choose the native language of the application English
? Besides JUnit and Jest, which testing frameworks would you like to use?
? Would you like to install other generators from the JHipster Marketplace? No
I have loaded a sample application for SCP / S/4HANA Business Partner integration, did changes as documented in read.me, I also have comm. user/arrangement in S/4HANA for 0008.
When I try to build it,
I get error during integration test, the content of file com.sap.cloud.s4hana.examples.addressmgr.BusinessPartnerServletTest is:
<<< ERROR! org.jboss.arquillian.container.spi.client.container.DeploymentException: Unable to deploy
Caused by: org.apache.openejb.OpenEJBRuntimeException: org.apache.openejb.OpenEJBException: Creating application failed: /Users/d036682/Downloads/cloud_app/integration-tests/target/surefire-fork/1/arquillian-tomee-working-dir/0/292d95a8-4414-4535-846f-c8fae7dcd7e9: Cannot get Unsafe.defineClass
Caused by: org.apache.openejb.OpenEJBException: Creating application failed: /Users/d036682/Downloads/cloud_app/integration-tests/target/surefire-fork/1/arquillian-tomee-working-dir/0/292d95a8-4414-4535-846f-c8fae7dcd7e9: Cannot get Unsafe.defineClass
Caused by: java.lang.IllegalStateException: Cannot get Unsafe.defineClass
Caused by: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String,[B,int,int,java.lang.ClassLoader,java.security.ProtectionDomain)
Could you please help
Thanks,
Konstantin
Please make sure to use JDK 8 as documented until further notice. Various dependencies don't work in later versions as of now.
Kind regards
Florian
Very basic application generation failing with error mention in title. I have upgrading Node to latest version 8.11.3, npm to 6.1.0 and installed latest yarn and yo but still getting the same error.
Attaching complete console log for application generation:
? Which type of application would you like to create? Monolithic
application (recommended for simple projects)
? What is the base name of your application? automate
? What is your default Java package name? com.automate
? Do you want to use the JHipster Registry to configure, monitor and
scale your application? No
? Which type of authentication would you like to use? JWT
authentication (stateless, with a token)
? Which type of database would you like to use? SQL (H2, MySQL,
MariaDB, PostgreSQL, Oracle, MSSQL)
? Which production database would you like to use? MySQL
? Which development database would you like to use? MySQL
? Do you want to use the Spring cache abstraction? No - Warning, when
using an SQL database, this will disable the Hiber nate 2nd level
cache!
? Would you like to use Maven or Gradle for building the backend?
Maven
? Which other technologies would you like to use?
? Which Framework would you like to use for the client? Angular 6
? Would you like to enable SASS support using the LibSass
stylesheet preprocessor? No
? Would you like to enable internationalization support? No
? Besides JUnit and Jest, which testing frameworks would you like to
use?
? Would you like to install other generators from the JHipster
Marketplace? No
events.js:183
throw er; // Unhandled 'error' event
^
TypeError: Cannot read property 'addQmark' of undefined
at Compiler. (C:\Users\dellPC\AppData\Local\Yarn\Data\global\node_modules\nanomatch\lib\compilers.js:92:16)
at Compiler.visit (C:\Users\dellPC\AppData\Local\Yarn\Data\global\node_modules\snapdragon\lib\compiler.js:129:15)
at Compiler.mapVisit (C:\Users\dellPC\AppData\Local\Yarn\Data\global\node_modules\snapdragon\lib\compiler.js:143:12)
at Compiler.compile (C:\Users\dellPC\AppData\Local\Yarn\Data\global\node_modules\snapdragon\lib\compiler.js:168:10)
at Snapdragon.compile (C:\Users\dellPC\AppData\Local\Yarn\Data\global\node_modules\snapdragon\index.js:156:32)
at C:\Users\dellPC\AppData\Local\Yarn\Data\global\node_modules\micromatch\index.js:786:23
at memoize (C:\Users\dellPC\AppData\Local\Yarn\Data\global\node_modules\micromatch\index.js:859:13)
at Function.micromatch.compile (C:\Users\dellPC\AppData\Local\Yarn\Data\global\node_modules\micromatch\index.js:783:10)
I've managed to deploy a simple Web application to Websphere 8.5, but unable to start it. It throws an ArrayIndexOutofBoundsException while starting my application.
We have been using Tomcat7 so far for our web app. It's a simple web-app with JSPs, JSs and Servlets.
I've tried a lot of options to deploy the application on Websphere, but the latest hurdle i'm facing is the ArrayIndexOutofBoundsException.
I tried to deploy the same application (a mini version) which contained only one servlet, and it was successful. But when I have multiple servlets, I get this exception. Below is my stack trace
[8/12/14 12:15:55:463 IST] 00000046 BeansDeployer E BeansDeployer deploy
java.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException
at org.apache.webbeans.portable.AnnotatedElementFactory.newAnnotatedType(AnnotatedElementFactory.java:150)
at org.apache.webbeans.config.BeansDeployer.deployFromClassPath(BeansDeployer.java:484)
at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:171)
at org.apache.webbeans.lifecycle.AbstractLifeCycle.startApplication(AbstractLifeCycle.java:124)
at org.apache.webbeans.web.lifecycle.WebContainerLifecycle.startApplication(WebContainerLifecycle.java:78)
at com.ibm.ws.webbeans.common.CommonLifeCycle.startApplication(CommonLifeCycle.java:106)
at com.ibm.ws.webbeans.services.JCDIServletContainerInitializer.onStartup(JCDIServletContainerInitializer.java:85)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initializeServletContainerInitializers(WebAppImpl.java:613)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:409)
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:749)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:426)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1175)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:774)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2182)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445)
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:994)
at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:502)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862)
Caused by: java.lang.ArrayIndexOutOfBoundsException
at org.apache.webbeans.portable.AbstractAnnotatedCallable.setAnnotatedParameters(AbstractAnnotatedCallable.java:66)
at org.apache.webbeans.portable.AnnotatedConstructorImpl.<init>(AnnotatedConstructorImpl.java:56)
at org.apache.webbeans.portable.AnnotatedElementFactory.newAnnotatedType(AnnotatedElementFactory.java:117)
... 27 more
I read a couple of other posts from people who faced more or less the same problem, but they were talking about Spring or Guava, none of which I use here. As a result, the solutions I read there did not solve my problem.
Can any one throw light on a solution? It would be helpful to a very great extent.
Additional Info:
I'm developing my project on Eclipse Kepler and using the Webshpere 8.5 plugin to deploy on Websphere application server.
Thanks,
Sriram
Actually it turns out my project was indeed referencing to guava. It was using guava version 15.0. I changed the version to 16.0 and included then in my shared library.. and it solves the issue. Apologies for overlooking guava.. old have saved a lot of time !!
I have an application that runs just fine in a local tomcat instance - it's a cassandra client app that uses Hector as a client library for Cassandra. The application creates a keyspace and column family (if it doesn't already exist) using code like the following:
final ColumnFamilyDefinition cfDef = HFactory.createColumnFamilyDefinition(keySpaceName,
columnFamilyName, ComparatorType.BYTESTYPE);
cfDef.setKeyValidationClass(ComparatorType.LONGTYPE.getClassName());
cfDef.setComparatorType(ComparatorType.UTF8TYPE);
cfDef.addColumnDefinition(new BasicColumnDefinition() {{
setName(StringSerializer.get().toByteBuffer("id"));
setValidationClass(ComparatorType.LONGTYPE.getClassName());
}});
When I push this exact same application to cloud foundry (our own internal cloud where we have a simple cassandra service), the line above with "addColumnDefinition" results in an exception - here's the stack trace:
java.lang.UnsupportedOperationException
java.util.AbstractList.add(Unknown Source)
java.util.AbstractList.add(Unknown Source)
me.prettyprint.cassandra.service.ThriftCfDef.addColumnDefinition(ThriftCfDef.java:311)
org.pvtl.cassandra.HectorSample.createColumnFamily(HectorSample.java:94)
org.pvtl.cassandra.HectorSample.<init>(HectorSample.java:37)
org.apache.jsp.index_jsp._jspService(index_jsp.java:61)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
A bunch of googling and it looks like the trouble is that the Hector code is trying to add to an immutable list - the java.util.AbstractList. But again, that code runs fine on my local tomcat instance so I'm thinking a difference in the jdk? Maybe? I'm running java 7 (sun) locally and pushed choosing java 7. Anyone have any ideas?
Most probably you are using a different version of Hector in your local tomcat than the one in the server (i.e. server has older library) because the immutable list constrain was removed from newer Hector versions
See this pull request discussion
Edit
You might want to check your server configuration and make sure it has the latest hector library and/or check that hector-cor-xxx.jar does not exist under your tomcat/jetty libraries folder as it might cause dependency problem.