APIs & Integrations

ik96
Member

HUBL Local Server Set Up Issues

Hi 

I was following this documentation to set up a HUBL local server. I installed Java SE Development Kit 11 for MacOS (jdk-11.0.2_osx-x64_bin.dmg)

But I keep getting these warnings and errors.

MacBook-Pro:local-hubl-server $ ./bin/local-hubl-server
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.mockito.cglib.core.ReflectUtils$2 (file:/Users/Documents/Work/website/hubspot/local-hubl-server/lib/local-hubl-server-deps.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.mockito.cglib.core.ReflectUtils$2
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
ERROR [2019-03-20 14:52:35,119] jinjava: Error creating injected context function
! javassist.NotFoundException: com.hubspot.content.cyw
! at javassist.ClassPool.get(ClassPool.java:452)
! at com.hubspot.jinjava.lib.fn.InjectedContextFunctionProxy.defineProxy(InjectedContextFunctionProxy.java:31)
! at com.hubspot.content.cwf.a(Unknown Source)
! at com.hubspot.content.cwf$$FastClassByGuice$$38013f99.invoke(<generated>)
! at com.google.inject.internal.ProviderMethod$FastClassProviderMethod.doProvision(ProviderMethod.java:264)
! at com.google.inject.internal.ProviderMethod$Factory.provision(ProviderMethod.java:401)
! at com.google.inject.internal.ProviderMethod$Factory.get(ProviderMethod.java:376)
! at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
! at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
! at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
! at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194)
! at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
! at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
! at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
! at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:82)
! at com.google.inject.internal.InjectionRequestProcessor$StaticInjection$1.call(InjectionRequestProcessor.java:123)
! at com.google.inject.internal.InjectionRequestProcessor$StaticInjection$1.call(InjectionRequestProcessor.java:117)
! at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085)
! at com.google.inject.internal.InjectionRequestProcessor$StaticInjection.injectMembers(InjectionRequestProcessor.java:117)
! at com.google.inject.internal.InjectionRequestProcessor.injectMembers(InjectionRequestProcessor.java:79)
! at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:171)
! at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
! at com.google.inject.Guice.createInjector(Guice.java:99)
! at com.google.inject.Guice.createInjector(Guice.java:73)
! at com.hubspot.dropwizard.guice.InjectorFactoryImpl.create(Unknown Source)
! at com.hubspot.dropwizard.guice.GuiceBundle.initialize(Unknown Source)
! at com.yammer.dropwizard.config.Bootstrap.addBundle(Bootstrap.java:43)
! at com.hubspot.content.hubl.dev.LocalHubLDevService.initialize(Unknown Source)
! at com.yammer.dropwizard.Service.run(Service.java:59)
! at com.hubspot.content.hubl.dev.LocalHubLDevService.main(Unknown Source)
ERROR [2019-03-20 14:52:35,149] com.hubspot.dropwizard.guice.GuiceBundle: Exception occurred when creating Guice Injector - exiting
! com.google.inject.CreationException: Unable to create injector, see the following errors:

1) Error in custom provider, java.lang.RuntimeException: javassist.NotFoundException: com.hubspot.content.cyw
  at com.hubspot.content.cwf.a(Unknown Source) (via modules: com.hubspot.content.cxx -> com.hubspot.content.cwf)
  at com.hubspot.content.cwf.a(Unknown Source) (via modules: com.hubspot.content.cxx -> com.hubspot.content.cwf)
  while locating com.hubspot.jinjava.Jinjava
    for the 1st parameter of com.hubspot.content.hubl.util.snippets.Snippets.setJinjava(Unknown Source)
Caused by: java.lang.RuntimeException: javassist.NotFoundException: com.hubspot.content.cyw
	at com.google.common.base.Throwables.propagate(Throwables.java:241)
	at com.hubspot.jinjava.lib.fn.InjectedContextFunctionProxy.defineProxy(InjectedContextFunctionProxy.java:72)
	at com.hubspot.content.cwf.a(Unknown Source)
	at com.hubspot.content.cwf$$FastClassByGuice$$38013f99.invoke(<generated>)
	at com.google.inject.internal.ProviderMethod$FastClassProviderMethod.doProvision(ProviderMethod.java:264)
	at com.google.inject.internal.ProviderMethod$Factory.provision(ProviderMethod.java:401)
	at com.google.inject.internal.ProviderMethod$Factory.get(ProviderMethod.java:376)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
	at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
	at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
	at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:82)
	at com.google.inject.internal.InjectionRequestProcessor$StaticInjection$1.call(InjectionRequestProcessor.java:123)
	at com.google.inject.internal.InjectionRequestProcessor$StaticInjection$1.call(InjectionRequestProcessor.java:117)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085)
	at com.google.inject.internal.InjectionRequestProcessor$StaticInjection.injectMembers(InjectionRequestProcessor.java:117)
	at com.google.inject.internal.InjectionRequestProcessor.injectMembers(InjectionRequestProcessor.java:79)
	at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:171)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
	at com.google.inject.Guice.createInjector(Guice.java:99)
	at com.google.inject.Guice.createInjector(Guice.java:73)
	at com.hubspot.dropwizard.guice.InjectorFactoryImpl.create(Unknown Source)
	at com.hubspot.dropwizard.guice.GuiceBundle.initialize(Unknown Source)
	at com.yammer.dropwizard.config.Bootstrap.addBundle(Bootstrap.java:43)
	at com.hubspot.content.hubl.dev.LocalHubLDevService.initialize(Unknown Source)
	at com.yammer.dropwizard.Service.run(Service.java:59)
	at com.hubspot.content.hubl.dev.LocalHubLDevService.main(Unknown Source)
Caused by: javassist.NotFoundException: com.hubspot.content.cyw
	at javassist.ClassPool.get(ClassPool.java:452)
	at com.hubspot.jinjava.lib.fn.InjectedContextFunctionProxy.defineProxy(InjectedContextFunctionProxy.java:31)
	... 28 more

2) Error injecting method, java.lang.ExceptionInInitializerError
  at com.hubspot.content.hubl.util.snippets.Snippets.setEnvironment(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
	at com.hubspot.content.hubl.util.snippets.Snippets$$FastClassByGuice$$933d2e00.invoke(<generated>)
	at com.google.inject.internal.SingleMethodInjector$1.invoke(SingleMethodInjector.java:54)
	at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:89)
	at com.google.inject.internal.InjectionRequestProcessor$StaticInjection$1.call(InjectionRequestProcessor.java:123)
	at com.google.inject.internal.InjectionRequestProcessor$StaticInjection$1.call(InjectionRequestProcessor.java:117)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085)
	at com.google.inject.internal.InjectionRequestProcessor$StaticInjection.injectMembers(InjectionRequestProcessor.java:117)
	at com.google.inject.internal.InjectionRequestProcessor.injectMembers(InjectionRequestProcessor.java:79)
	at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:171)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
	at com.google.inject.Guice.createInjector(Guice.java:99)
	at com.google.inject.Guice.createInjector(Guice.java:73)
	at com.hubspot.dropwizard.guice.InjectorFactoryImpl.create(Unknown Source)
	at com.hubspot.dropwizard.guice.GuiceBundle.initialize(Unknown Source)
	at com.yammer.dropwizard.config.Bootstrap.addBundle(Bootstrap.java:43)
	at com.hubspot.content.hubl.dev.LocalHubLDevService.initialize(Unknown Source)
	at com.yammer.dropwizard.Service.run(Service.java:59)
	at com.hubspot.content.hubl.dev.LocalHubLDevService.main(Unknown Source)
Caused by: java.lang.RuntimeException: javassist.NotFoundException: com.hubspot.content.hubl.util.snippets.Template
	at com.hubspot.content.hubl.util.snippets.Snippets.load(Unknown Source)
	at com.hubspot.content.hubl.util.snippets.Snippets.<clinit>(Unknown Source)
	... 18 more
Caused by: javassist.NotFoundException: com.hubspot.content.hubl.util.snippets.Template
	at javassist.ClassPool.get(ClassPool.java:452)
	at com.hubspot.content.hubl.util.snippets.Snippets.loadSnippetTemplate(Unknown Source)
	at com.hubspot.content.hubl.util.snippets.Snippets.load(Unknown Source)
	... 19 more

2 errors
! at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:470)
! at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:176)
! at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
! at com.google.inject.Guice.createInjector(Guice.java:99)
! at com.google.inject.Guice.createInjector(Guice.java:73)
! at com.hubspot.dropwizard.guice.InjectorFactoryImpl.create(Unknown Source)
! at com.hubspot.dropwizard.guice.GuiceBundle.initialize(Unknown Source)
! at com.yammer.dropwizard.config.Bootstrap.addBundle(Bootstrap.java:43)
! at com.hubspot.content.hubl.dev.LocalHubLDevService.initialize(Unknown Source)
! at com.yammer.dropwizard.Service.run(Service.java:59)
! at com.hubspot.content.hubl.dev.LocalHubLDevService.main(Unknown Source)

Here is my Java Version

MacBook-Pro$ java --version
java 11.0.2 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)
0 Upvotes
4 Replies 4
tjoyce
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

HUBL Local Server Set Up Issues

For me, I had 2 versions of Java running and 12 is incompatible with the HUBL server. 

# java -v
    java version "12.0.1"
//Wrong version

//To fix
# cd /Library/Java/JavaVirtualMachines
# ls -al
    jdk-12.0.1.jdk
    jdk1.8.0_211.jdk

# sudo rm -rf jdk-12.0.1.jdk

# ls -al
    jdk1.8.0_211.jdk

#java -version
    java version "1.8.0_211"

-----

tim@belch.io

dsosborn
Participant

HUBL Local Server Set Up Issues

This worked, thank you!  More straightforward than using Docker IMHO. The pain was downloading the older Java version, which required creating a user account.

 

Furthermore, you don't have to delete your newer instance of java, you can choose which version you're running in terminal. 

https://stackoverflow.com/questions/21964709/how-to-set-or-change-the-default-java-jdk-version-on-os...

 

Just make sure you're using the right version.  Java 8 (v1.8.xxx) worked for me:

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
sylvain_pref
Contributor | Partner
Contributor | Partner

HUBL Local Server Set Up Issues

Thanks. It's a better solution than Docker's one. It works also for me. For Linux user, just change your default jdk version. On Debian Buster:

sudo update-alternatives --config java

And choose the version 8 of jdk ('/usr/lib/jvm/java-8-openjdk-amd64/...' for me).

 

If JDK 8 is not installed:

apt search openjdk

And install the JDK 8 package.

0 Upvotes
JasminLin
HubSpot Employee
HubSpot Employee

HUBL Local Server Set Up Issues

Hi @ik96 , a user encountered similar issue and shared the steps he took to resolve it here:  https://community.hubspot.com/t5/APIs-Integrations/HUBL-local-development-java-error/td-p/226210

You can give that a try! 

0 Upvotes