Corda - Implicit Contract Upgrade Throws java.lang.NoSuchMethodError - corda

Any ideas why an implicit state/contract upgrade would throw this?
java.lang.NoSuchMethodError:
com.demo.DemoState.(Lnet/corda/core/identity/AbstractParty;Lnet/corda/core/identity/AbstractParty;Lnet/corda/core/contracts/Amount;Lnet/corda/core/contracts/Amount;Lnet/corda/core/contracts/UniqueIdentifier;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
Steps taken
Deploy nodes with state/contract version 1
Start all nodes
Issue new state from A to B
Stop nodes A & B
Replace version 1 state/contract in nodes A & B with version 2
Start nodes A & B
Issue new stateā€¦ throws error

The problem in my case was...foolishness!
I had added the upgraded contract JAR into nodes A and B, but I had omitted to add the new workflow JAR. The old JAR is therefore trying to construct com.demo.DemoState with the old definition of it's constructor, which of course no longer exists, and hence... java.lang.NoSuchMethodError.

Related

why sanity start failed to compile in my nextjs app?

as a beginner i'm trying to follow up with a tutorial that uses sanity for backend , the problem is that when it come to the step to start sanity , so many errors are showing up here is the first one that i think is the major one that blocks the compilation
Error in ./schemas/schema.js (part:#sanity/base/schema)
Module build failed: Error: [BABEL]: Cannot find module 'C:\Users\ghars\tiktik-a
pp\sanity-backend\node_modules\#babel\helper-plugin-utils\lib\index.js'. Please
verify that the package.json has a valid "main" entry (While processing: C:\User
s\ghars\tiktik-app\sanity-backend\node_modules\#babel\plugin-proposal-class-prop
erties\lib\index.js)
i've searched about this and i think that sanity have a problem when it comes to node version 17 that i'm using , is there any solution without passing back to node 16 ?

How to migrate data to new server? (Sequence generator issue)

What is the right way to backup and restore a MariaDB database that has sequence generation enabled (i.e. NOT autoincrement)? (This includes migrating to a new server.)
Is it possible to instruct the sequence generator to pick up indexing table data at a specific ID value? How?
Steps I take to create my issue
I wish to transfer an application to a new server:
Backup data on source server:
mysqldump --skip-opt --no-create-db --no-create-info --hex-blob [database-name] [...list of tables...] > data-backup.sql
On target server, create new empty database (same name)
Build/run JHipster Spring application on target server: java -jar myapp.jar (Running this application recreates/configures a new instance of the database on the target server.)
Restore data:
mysql [database-name] < data-backup.sql
All the above steps produce no errors (so far).
Problem
When I follow these steps, the database is restored (apparently perfectly). I can log in to the application and access all information. BUT when I attempt to create new entities (i.e. save something to the database), I get an ID 'Duplicate entry' error in the server logs:
2022-03-24 12:54:43.775 ERROR 11277 --- [ XNIO-1 task-1] o.h.e.jdbc.batch.internal.BatchingBatch : HHH000315: Exception executing batch [java.sql.BatchUpdateException: (conn=33) Duplicate entry '1001' for key 'PRIMARY'], SQL: insert into product (name, id) values (?, ?)
2022-03-24 12:54:43.776 WARN 11277 --- [ XNIO-1 task-1] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 1062, SQLState: 23000
2022-03-24 12:54:43.776 ERROR 11277 --- [ XNIO-1 task-1] o.h.engine.jdbc.spi.SqlExceptionHelper : (conn=33) Duplicate entry '1001' for key 'PRIMARY'
2022-03-24 12:54:43.779 ERROR 11277 --- [ XNIO-1 task-1] o.z.problem.spring.common.AdviceTraits : Internal Server Error
org.springframework.dao.DataIntegrityViolationException: could not execute batch; SQL [insert into product (name, id) values (?, ?)]; constraint [PRIMARY]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute batch
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:276)
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:233)
at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:566)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:743)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:711)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:654)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:407)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698)
at com.mycompany.app.web.rest.ProductResource$$EnhancerBySpringCGLIB$$84c14d6d.createProduct(<generated>)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
...
Clearly my backup/restore process is not accounting properly for the sequence generator, which generates ID values that conflict with the existing data.
What I am doing wrong? What is the right process of backing up/restoring such a database?
Environment: JHipster 7.7.0 (Angular, monolithic), MariaDB 10.4, OpenJDK 16.0.2_7, OS Windows 10 Pro and openSUSE 15.2, Firefox 98.0.2 and Chrome 99.0.4844.84.
PS: I previously reported this issue here, aimed at the JHipster community, but got limited response. I think I need a MySQL/MariaDB expert opinion on this.
(Apologies in advance: I'm not a database expert. The technique I outline above has served me well for years, but previously I was dealing with AUTO_INCREMENT. This sequence generator has me baffled.)
Ok! I have solutions.
[For the sake if these notes, let's call the database: mydata. Also, in JHipster, the MariaDB sequence generator is called: sequence_generator]
Let's consider two situations:
(1) Simple migration
If you are merely migrating the application to a new server, the process is straight forward:
Step 1: On the original server backup and secure your database: mysqldump -u root -p mydata > mydata.sql
Step 2: Transfer the SQL file to the new server, along with the JHipster JAR file
Step 3: On the new server, create an empty database with the same name, and restore the data: mysql -u root -p mydata < mydata.sql
Step 4: Now launch your JHipster application, and everything should work
(2) Model modification
The assumption is that you have modified your model in some way (e.g. added properties to one or more entities). This solution is fiddly, but it works (for me).
Step 1: Backup your database, and secure it (in case something goes wrong): mysqldump -u root -p mydata > mydata.sql
Step 2: Backup and secure the original JHipster JAR that works with the original database
Step 3: Duplicate your database (schema and data) in a new table: mydata_bk
Step 4: Drop your original database, and create a new empty database
Step 5: Launch your new JHipster JAR, and give it time to create the new database schema, then stop the application
Step 6: Use a tool (DataGrip, sqlYog, etc) to compare the old (mydata_bk) and new schema (mydata), and modify the old schema to match the new schema
Step 7: Restore/copy all data from mydata_bk to mydata, EXCEPT for the tables DATABASECHANGELOG, DATABASECHANGELOGLOCK and the special sequence_generator table
Step 8: Open the mydata.sql SQL file, and at the top, after initial comments, one of the first instructions will read:
--
-- Sequence structure for `sequence_generator`
--
DROP SEQUENCE IF EXISTS `sequence_generator`;
CREATE SEQUENCE `sequence_generator` start with 2000 minvalue 1 maxvalue 9223372036854775806 increment by 50 cache 1000 nocycle ENGINE=InnoDB;
SELECT SETVAL(`sequence_generator`, 201050, 0);
The specific numbers may vary, but the broad details will be similar. In a MariaDB SQL console type/execute each of those SQL statements: DROP SEQUENCE ...;, CREATE SEQUENCE ...;, and SELECT SETVAL(...);
Step 9: Launch your JHipster application.
Hope this helps others that run into similar issues. Let me know if you have a better approach!

Unable to make a Corda Testnet node issuable

I've successfully set up a Corda Open Source 4.3 Testnet node, and I can connect with the Node Explorer. However I'm having difficulty figuring out instructions 3 and 4 found here: https://docs.corda.net/head/testnet-explorer-corda.html
Considering the finance CorDapp has been split into 2 CorDapps, I have copied both of the jar files downloaded in step 3 into /opt/corda/cordapps, before trying step 4 and eventually running the node. Having done that I connected with the Node Explorer and found that I could only select "pay" in the new transaction modal. I have also tried creating 2 matching conf files for each of the CorDapps, with no luck.
I think that instruction #4 is not correct, the configuration file name must match the name of your CorDapp, so if your CorDapp jar is MyCorDapp.jar then the config file would be the same name but with .conf extension instead (i.e. MyCorDapp.conf).
So in your case you should have 2 conf files (one for workflows and one for contracts) with the same content:
- corda-finance-contracts-4.3-SNAPSHOT.conf
- corda-finance-workflows-4.3-SNAPSHOT.conf

Pintos - UserProg all tests fail is_kernel_vaddr()

I am doing the Pintos project on the side to learn more about operating systems. I had tons of devops trouble at first with it not running well on an 18.04 Ubuntu droplet. I am now running it on the VirtualBox image that UCCS tells students to download for pintos.
I finished project 1 and started to map out my solution to project 2. Following the instructions to create a file I ran
pintos-mkdisk filesys.dsk --filesys-size=2
pintos -- -f -q
but am getting error
Kernel PANIC at ../../threads/vaddr.h:87 in vtop(): assertion
`is_kernel_vaddr (vaddr)' failed.
I then tried running make check (all the tests). They are all failing for the same reason.
Am I missing something? Is there something I need to implement to fix this? I reread the instructions and didnt see anything?
Would appreciate help!
Thanks
I had a similar problem. My code for Project 1 ran fine, but I could not format the filesystem for Project 2.
The failure for me came from the following call chain:
thread_init() -> ... -> thread_schedule_tail() -> process_activate() -> pagedir_activate() -> vtop()
The problem is that init_page_dir is still NULL when pagedir_activate() is called. init_page_dir should have been initialized in paging_init() but this is called after thread_init().
The root cause was that my scheduler was being called too early, i.e. before the call to thread_start(). The reason for my problem was that I had built in a call to thread_yield() upon completion of every call to lock_release() which makes sense from a priority donation standpoint. Unfortunately, locks are used prior to the scheduler being ready! To fix this, I installed a flag called threading_started that bails in the first line of my thread_block() and thread_yield() functions if thread_start() has not yet been called.
Good luck!

Microsoft Dynamics compling Symmetry error

I have a problem with the compiler, it does not recognize symmetry classes:
for example if I open the class PayrollCalculatePayStatementBenefits and I type an empty space and save the compiler shows a syntax error on the line 12 (Class declaration).
Symmetry.taxEngine.BenefitInfo benefitInfo401_403;
But before doing this action the hole process of paystatements generation was working fine
after saving the same code it does pay statement generation process dons not work any more showing and error
"absence of an executable code in path of the class"
I think it's a server configuration problem because if create a job and type Symmetry the the compiler does not propose the Symmetry class in the suggestion list, but I used to work on an other server in an other machine and it does , I don't understand ...
I just got this problem on AX 2012 R3 CU8. 22 compile errors on a brand new and clean installation...
It can be solved by adding a reference to ste-net.dll in the AOT.
This DLL file can be found in the client bin folder.
I found the solution
here

Resources