Closed rfikki closed 7 years ago
Can you describe how you started the application? Which method and command line/configuration options if any?
Downloaded windows version to my Windows 10 home machine. Started for the first time waited a little then exited the app. Started the app again. Still no issues. @rfikki Can you please provide full log as well the command you've started cakeshop with? Also, could you provide your version of java? My steps were pretty simple Downloaded war into directory where my user can execute files. Ran java -jar cakeshop-0.9.0-x86_64-windows.war
Please paste the full console output as a gist and paste the link here. I think the root cause may lie elsewhere
So, steps to reproduce are I have a running completely synced latest version of geth 1.5.6 develop branch that I attach with. I first run "java -jar cakeshop.war example" command to create the initial files as stated in your wiki. After the directory has been created I open the application.property file per your wiki and change the rpc port to 8545 and make all the stated needed changes per the wiki. The application starts up and I can visit the application at the localhost location in the browser. However browser application does not display any of the data except for the incoming block numbers. Looking at the terminal the error provided in the original post above repeats itself over and over again.
So by 'completely synced' do you mean against the public Ethereum chain? This isn't really a use case we've tested in a while as we primarily target the local development of smart contracts (i.e., develop the contract locally and then take it and deploy it on some other chain). That said, I'll give it a try and see if I can reproduce that error.
It is a running testnet ropsten geth that performs well with other smart contracts. Nothing wrong and it is fully synced when latest block is compared to etherscan.io, I run other smart contracts on it using truffle and know it is not a problem with my chain. Again as I have stated I am running your "java -jar cakeshop.war example" command. I then run "java --jar cakeshop which seems to find the running geth but outputs the error message as stated above. Java version is 8.
This is the command I use to start geth:
"C:\projects\ethereum_develop_ropsten\geth.exe" --testnet --networkid 3 --identity "GETH DEVELOP ROPSTEN" --datadir C:\projects\ethereum_develop_ropsten\testnet_data --fast --jspath "c:\projects\ethereum_develop_ropsten\javascript" --unlock "0, 1" --shh --rpc --rpcaddr=127.0.0.1 --rpcapi "eth,net,web3,shh" --ipcapi "admin,debug,eth,miner,net,personal,shh,txpool,web3" --rpcport=8545 --verbosity=3 --minerthreads "2" --rpccorsdomain="*" --solc "C:\projects\solc\solc.exe" console 2>> C:\projects\ethereum_develop_ropsten\GETH_DEVELOP_ROPSTEN_CONSOLE.log 2^&1
I'm concerned about this --rpcport=8545. Shouldn't it be --rpcport 8545? Can you verify that rpc is actually up and listening on port 8545. Also, please use all rpc api endpoints points, which are in application.properties. For instance I do not see admin endpoint in your geth startup command.
@rfikki I think changing your startup command to the following should fix it:
"C:\projects\ethereum_develop_ropsten\geth.exe" --testnet --networkid 3 --identity "GETH DEVELOP ROPSTEN" --datadir C:\projects\ethereum_develop_ropsten\testnet_data --fast --jspath "c:\projects\ethereum_develop_ropsten\javascript" --unlock "0, 1" --shh --rpc --rpcaddr=127.0.0.1 --rpcapi "admin,debug,eth,miner,net,personal,shh,txpool,web3" --ipcapi "admin,debug,eth,miner,net,personal,shh,txpool,web3" --rpcport=8545 --verbosity=3 --minerthreads "2" --rpccorsdomain="*" --solc "C:\projects\solc\solc.exe" console 2>> C:\projects\ethereum_develop_ropsten\GETH_DEVELOP_ROPSTEN_CONSOLE.log 2^&1
Note the updated list passed to --rpcapi
. I'll be updating the docs soon to clarify the settings we need enabled in geth for this scenario.
Thanks @chetan, will give that a shot.
I changed the --rpciapi flags as you have suggested to --rpcapi "admin,debug,eth,miner,net,personal,shh,txpool,web3" and got the following error, note I included a copy of application.properties at the end of the gist: https://gist.github.com/rfikki/b7f067b59d105a315ebb9efb5540c30b
In addition to the above gist I want to let you know that running java -jar cakeshop.war spawns a running node.js server that does not get terminated when you exit the cakeshop inside the terminal. I have to manually go to the running applications in windows and terminate it before I can restart cakeshop. Just wanted to let you know this.
Ok, looks like geth is returning that 403 Forbidden
when trying to call eth_sendTransaction
for some reason. Are you still trying to connect to the public testnet? Was there any error output in the window where you ran geth?
In general, I would suggest running on an offline/private chain instead. I'll have to try connecting to testnet and see if I can reproduce myself (@mikkazan also reported having some issues with testnet).
re: node process -could be an issue cleaning it up on Windows. I'll open a separate issue to track that. Thanks!
I am running the ropsten public ethereum testnet. and have no problem connecting to my running geth node with other applications.
I see no errors at all in the terminal for my running geth ropsten node. My geth node runs like a charm. The issue is with cakeshop.
I am a bit confused because when running geth --help these are the flags, they seem more limited then the flags you are using for --rpcapi.
API AND CONSOLE OPTIONS: --rpc Enable the HTTP-RPC server --rpcaddr value HTTP-RPC server listening interface (default: "localhost") --rpcport value HTTP-RPC server listening port (default: 8545) --rpcapi value API's offered over the HTTP-RPC interface (default: "eth,net,web3") --ws Enable the WS-RPC server --wsaddr value WS-RPC server listening interface (default: "localhost") --wsport value WS-RPC server listening port (default: 8546) --wsapi value API's offered over the WS-RPC interface (default: "eth,net,web3") --wsorigins value Origins from which to accept websockets requests --ipcdisable Disable the IPC-RPC server --ipcapi value APIs offered over the IPC-RPC interface (default: "admin,debug,eth,miner,net,personal,shh,txpool,web3") --ipcpath "geth.ipc" Filename for IPC socket/pipe within the datadir (explicit paths escape it) --rpccorsdomain value Comma separated list of domains from which to accept cross origin requests (browser enforced) --jspath loadScript JavaScript root path for loadScript (default: ".") --exec value Execute JavaScript statement (only in combination with console/attach) --preload value Comma separated list of JavaScript files to preload into the console
I guess you will update your docs to reflect that you cannot run --rpcapi with the default flags.
I do have one more question when I attach to my local running testnet with cakeshop, do I need to change the datadir flag to the location of my running geth's datadir inside the application.properties file?
I had this error, for me went away with
geth --datadir datadir --networkid 3 --rpc --rpcapi admin,db,eth,debug,miner,net,shh,txpool,personal,web3 --rpccorsdomain "*"
for connecting to Ropsten
Hey @ice09 what changes did you make to your applications.properties file? Can you share the settings?
Sure, but as I understand, these settings have no effect due to geth.auto.start=false
and the geth.url? This is quite confusing, because in the webapp, eg. the network-id is shown from the settings, but it is 3 for Ropsten in fact.
cakeshop.database.vendor=hsqldb cakeshop.hibernate.hbm2ddl.auto=update cakeshop.hibernate.jdbc.batch_size=20 cakeshop.jdbc.pass=sdk cakeshop.jdbc.user=sdk cakeshop.mvc.async.pool.queue.max=2000 cakeshop.mvc.async.pool.threads.core=250 cakeshop.mvc.async.pool.threads.max=1000 contract.poll.delay.millis=5000 contract.registry.addr=0x410b933e62e43e994030a776e49e06d74faded1f endpoints.actuator.enabled=true geth.auto.start=false geth.auto.stop=false geth.cors.enabled=true geth.cors.url= geth.datadir=/home/radgon/.ethereum geth.db.enabled=true geth.identity=radgon geth.log=/logs geth.mining=true geth.networkid=1006 geth.node.port=30303 geth.params.extra= geth.rpcapi.list=admin,db,eth,debug,miner,net,shh,txpool,personal,web3 geth.url=http\://localhost\:8545 geth.verbosity= management.context-path=/manage server.compression.enabled=true server.compression.mime-types=application/json,application/xml,text/html,text/xml,text/plain spring.main.banner-mode=off spring.mvc.view.prefix=/WEB-INF/jsp/ spring.mvc.view.suffix=.jsp
You are on ubuntu? I am pretty sure this might be an issue with running on windows.
yes, Ubuntu 16.04 LTS
Ok, will give it a try in my 16.04 virtual machine when I get a chance.
ok, but as I said, I don't have this error anymore, with the settings I git rid of it, I am sure that it was due to some missing rpcapi params, that's why I posted it here.
sorry, now I get it, you wanted to reproduce without the error :) I have a different error (https://github.com/jpmorganchase/cakeshop/issues/4), but not this one anymore. I am pretty sure that it was about the rpcapi params.
Okay, was able to get a bit further along by making a few adjustments. Cakeshop is now connecting to the local geth, but after a few seconds still crashes. At least I can see it creating the contracts and connecting to my local node running ropsten testnet now. Now to figure out what is causing it to crash here is the latest error: c:\projects\cakeshop>java -jar cakeshop.war Defaulting to spring profile: local Extracting geth to C:\projects\cakeshop\data\geth INFO 2016-12-19 15:17:37,390 [main] (StartupInfoLogger.java:48 ) Starting SpringBootApplication on ASUS with PID 16248 (started by Rocky in c:\projects\cakeshop) INFO 2016-12-19 15:17:37,393 [main] (SpringApplication.java:670) The following profiles are active: container,spring-boot,local WARN 2016-12-19 15:17:40,328 [main] (ConfigurationClassEnhancer.java:347) @Bean method AppConfig.propertySourcesPlaceholderConfigurer is non-static and returns an object assignable to Spring's BeanFactoryPostProcessor interface. This will result in a failure to process annotations such as @Autowired, @Resource and @PostConstruct within the method's declaring @Configuration class. Add the 'static' modifier to this method to avoid these container lifecycle issues; see @Bean javadoc for complete details. INFO 2016-12-19 15:22:21,748 [main] (AppConfig.java:144) eth.environment=StandardServletEnvironment {activeProfiles=[container, spring-boot, local], defaultProfiles=[default], propertySources=[servletConfigInitParams,servletContextInitParams,jndiProperties,systemProperties,systemEnvironment,random,applicationConfig: [classpath:/config/application-local.properties],applicationConfig: [classpath:/config/application.properties]]} INFO 2016-12-19 15:22:21,749 [main] (AppConfig.java:145) eth.config.dir=C:\projects\cakeshop\data\local
Running pre-flight checks...
Testing ethereum data dir path C:\projects\cakeshop\data\local\ethereum OK
Testing db path C:\projects\cakeshop\data\local\db OK
Testing geth server binary OK
Testing solc compiler binary OK
ALL TESTS PASSED!
INFO 2016-12-19 15:22:32,568 [main] (BlockchainInitializerTask.java:144) Initializing empty blockchain INFO 2016-12-19 15:22:32,569 [main] (BlockchainInitializerTask.java:148) Deploying ContractRegistry to chain INFO 2016-12-19 15:23:20,157 [main] (BlockchainInitializerTask.java:156) Deploying sample contract (SimpleStorage) to chain INFO 2016-12-19 15:23:24,135 [cake-1] (ContractRegistrationTask.java:69 ) Registering newly mined contract at address 0x54d8dde01c725eb72fe253dd0bf65c42b1cf67dd INFO 2016-12-19 15:26:45,856 [main] (BlockchainInitializerTask.java:92 ) Storing existing wallet accounts INFO 2016-12-19 15:26:47,532 [cake-2] (ContractRegistrationTask.java:69 ) Registering newly mined contract at address 0x5832317e28f6f28b9685ef09c0192366d6f427d2
,%%%%%%%%,
,%%/\%%%%/\%%
,%%%\c "" J/%%% ,,,,,,,
%. %%%%/ 6 6 \%%% |||||||
`%%. %%%% _ |%%% @@@@@@@@@@@
`%% `%%%%(__Y__)%%' {~*~*~*~*~}
// ;%%%%`\-/%%%' @@@@@@@@@@@@@@@@
(( / `%%%%%%%' {~* CAKESHOP *~}
\\ .' | { OPEN }
\\ / \ | | {~~*~~*~~*~~*~~}
\\/ ) | | @@@@@@@@@@@@@@@
\ /_ | |__ __) (__
(___________))))))) /_______\
CAKESHOP
version: 0.9.0
build id: 7e4942a7ba0b32c63e147031675d92434952ff5d
build date: 2016-12-13T15:11:21.169-0500
url: http://192.168.1.8:8080/cakeshop/
INFO 2016-12-19 15:26:58,048 [main] (StartupInfoLogger.java:57 ) Started SpringBootApplication in 561.402 seconds (JVM running for 566.089)
ERROR 2016-12-19 15:27:54,284 [BlockSaver-43] (SavingBlockListener.java:53 ) BlockSaverThread died
org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.service.UnknownServiceException: Unknown service requested [org.hibernate.cache.spi.RegionFactory]
at org.springframework.orm.hibernate5.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:541)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:427)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:276)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
at com.jpmorgan.cakeshop.dao.BlockDAO$$EnhancerBySpringCGLIB$$480d1e3f.save(
@ice09 wrote:
Sure, but as I understand, these settings have no effect due to geth.auto.start=false and the geth.url? This is quite confusing, because in the webapp, eg. the network-id is shown from the settings, but it is 3 for Ropsten in fact.
It is indeed a bit confusing at present. Cakeshop was originally developed under the premise of using an internally bundled version of geth to make it easier for first-time developers to bootstrap the environment. The geth.auto.start/stop
settings were added as a sort of escape hatch for working with an "unmanaged" version of geth and thus the UI isn't entirely consistent when in this mode.
Ok, I have it running on Windows, but it is throwing a bunch of warnings in the terminal. At least I can check it out in the browser: These are the warnings that keep repeating: WARN 2016-12-19 15:38:15,274 [BlockSaver-42] (SavingBlockListener.java:118) Failed to load transaction details for tx com.jpmorgan.cakeshop.error.APIException: Contract does not exist at 0xc47aa6c1987ec4737b40a327620c31fd1995602f at com.jpmorgan.cakeshop.service.impl.ContractServiceImpl.get(ContractServiceImpl.java:228) at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.cache.interceptor.CacheInterceptor$1.invoke(CacheInterceptor.java:52) at org.springframework.cache.interceptor.CacheAspectSupport.invokeOperation(CacheAspectSupport.java:320) at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:353) at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:302) at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) at com.sun.proxy.$Proxy98.get(Unknown Source) at com.jpmorgan.cakeshop.service.impl.EventServiceImpl.processEvents(EventServiceImpl.java:86) at com.jpmorgan.cakeshop.service.impl.TransactionServiceImpl.processTx(TransactionServiceImpl.java:137) at com.jpmorgan.cakeshop.service.impl.TransactionServiceImpl.get(TransactionServiceImpl.java:202) at com.jpmorgan.cakeshop.db.SavingBlockListener.saveBlock(SavingBlockListener.java:115) at com.jpmorgan.cakeshop.db.SavingBlockListener$BlockSaverThread.run(SavingBlockListener.java:48)
I also see this error in the browser API documentation window inside cakeshop: {"schemaValidationMessages":[{"level":"error","message":"Can't read from file http://192.168.1.8:8080/cakeshop/api/swagger.json"}]}
I also see this error in the browser API documentation window inside cakeshop: {"schemaValidationMessages":[{"level":"error","message":"Can't read from file http://192.168.1.8:8080/cakeshop/api/swagger.json"}]}
This was fixed in #3
These are generated in the terminal window, is this normal output?
DEBUG 2016-12-19 16:00:10,595 /cakeshop/api/contract/list DEBUG 2016-12-19 16:00:20,597 /cakeshop/api/contract/list DEBUG 2016-12-19 16:00:40,609 /cakeshop/api/contract/list DEBUG 2016-12-19 16:01:15,628 /cakeshop/api/contract/list DEBUG 2016-12-19 16:01:25,636 /cakeshop/api/contract/list DEBUG 2016-12-19 16:01:40,642 /cakeshop/api/contract/list DEBUG 2016-12-19 16:02:30,671 /cakeshop/api/contract/list DEBUG 2016-12-19 16:02:40,676 /cakeshop/api/contract/list DEBUG 2016-12-19 16:03:05,693 /cakeshop/api/contract/list DEBUG 2016-12-19 16:03:55,722 /cakeshop/api/contract/list DEBUG 2016-12-19 16:04:10,727 /cakeshop/api/contract/list DEBUG 2016-12-19 16:04:30,736 /cakeshop/api/contract/list DEBUG 2016-12-19 16:04:40,745 /cakeshop/api/contract/list DEBUG 2016-12-19 16:04:45,746 /cakeshop/api/contract/list DEBUG 2016-12-19 16:05:25,771 /cakeshop/api/contract/list DEBUG 2016-12-19 16:06:00,803 /cakeshop/api/contract/list DEBUG 2016-12-19 16:06:05,789 /cakeshop/api/contract/list DEBUG 2016-12-19 16:06:35,811 /cakeshop/api/contract/list DEBUG 2016-12-19 16:06:40,810 /cakeshop/api/contract/list DEBUG 2016-12-19 16:06:50,814 /cakeshop/api/contract/list DEBUG 2016-12-19 16:07:04,505 /cakeshop/api/node/peers DEBUG 2016-12-19 16:07:19,544 /cakeshop/api/node/peers DEBUG 2016-12-19 16:07:24,558 /cakeshop/api/node/peers DEBUG 2016-12-19 16:07:46,443 /cakeshop/api/contract/list DEBUG 2016-12-19 16:07:46,504 /cakeshop/ws/info DEBUG 2016-12-19 16:07:46,512 /cakeshop/ws/543/rfnxdgpu/websocket DEBUG 2016-12-19 16:07:46,678 /cakeshop/api/wallet/list DEBUG 2016-12-19 16:07:47,265 /cakeshop/api/contract/compile DEBUG 2016-12-19 16:07:50,848 /cakeshop/api/contract/list DEBUG 2016-12-19 16:07:58,912 /cakeshop/api/block/get DEBUG 2016-12-19 16:07:59,650 /cakeshop/api/node/peers DEBUG 2016-12-19 16:08:01,476 /cakeshop/api/block/get DEBUG 2016-12-19 16:08:03,876 /cakeshop/api/block/get DEBUG 2016-12-19 16:08:10,857 /cakeshop/api/contract/list DEBUG 2016-12-19 16:08:35,875 /cakeshop/api/contract/list DEBUG 2016-12-19 16:08:40,873 /cakeshop/api/contract/list DEBUG 2016-12-19 16:08:55,882 /cakeshop/api/contract/list
These are generated in the terminal window, is this normal output?
DEBUG 2016-12-19 16:00:10,595 /cakeshop/api/contract/list DEBUG 2016-12-19 16:00:20,597 /cakeshop/api/contract/list
Yes, those are just 'access log' messages from the web server
@rfikki FYI, I just cut 0.9.1. Please give it a try and let me know how it goes. I also updated the configuration documentation at https://github.com/jpmorganchase/cakeshop/blob/master/docs/configuration.md
System information
Win10 64bit Cakeshop version or commit hash:
Geth/Quorum version testing against:
geth version
OS & Version: Windows/Linux/OSX Windows 10
Expected behavior
The application should run error free
Actual behavior
ERROR 2016-12-16 20:40:35,304 [BlockSaver-38] (SavingBlockListener.java:53 ) BlockSaverThread died org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.service.UnknownServiceException: Unknown service requested [org.hibernate.cache.spi.RegionFactory] at org.springframework.orm.hibernate5.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:541) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:427) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:276) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655) at com.jpmorgan.cakeshop.dao.BlockDAO$$EnhancerBySpringCGLIB$$480d1e3f.save()
at com.jpmorgan.cakeshop.db.SavingBlockListener.saveBlock(SavingBlockListener.java:109)
at com.jpmorgan.cakeshop.db.SavingBlockListener$BlockSaverThread.run(SavingBlockListener.java:48)
Caused by: org.hibernate.service.UnknownServiceException: Unknown service requested [org.hibernate.cache.spi.RegionFactory]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:184)
at org.hibernate.cfg.Settings.getRegionFactory(Settings.java:300)
at org.hibernate.internal.SessionFactoryImpl$SessionBuilderImpl.openSession(SessionFactoryImpl.java:1322)
at org.hibernate.internal.SessionFactoryImpl.openSession(SessionFactoryImpl.java:672)
at org.springframework.orm.hibernate5.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:433)
... 9 more
Steps to reproduce the behavior
Backtrace/logs