Page 1 of 2

[URGENT] Solution cannot be activated with Git use

PostPosted: Wed Mar 11, 2015 12:59 pm
by gabid
Hi guys,

I'm using Servoy 7.4.3 build 2036

I've imported a solution, uploaded it to Git, worked on it, commit, push, etc, but after a merge I get an error saying that the solution cannot be activated. The Solution or some of its modules was created or updated by a newer version of Servoy. Either switch to a newer version of Servoy or rollback the changes made.

2015_03_11_12_48_03_Servoy_Design_Servoy_Developer.jpg
2015_03_11_12_48_03_Servoy_Design_Servoy_Developer.jpg (40.53 KiB) Viewed 10972 times


I have rolled back by checking out past commits but nothings works.

I haven't committed the .metadata folder because I believe that is specific to my Servoy install and should not be shared.

What am I doing wrong and what can I do to fix it?

Please give me any feedback as soon as possible, as I have lost all changes done before the merge!

Thanks
Gabriel

Re: [URGENT] Solution cannot be activated with Git use

PostPosted: Wed Mar 11, 2015 1:17 pm
by gabid
!ENTRY com.servoy.eclipse.model 4 0 2015-03-11 13:16:58.283
!MESSAGE Unexpected Exception
!STACK 0
com.servoy.j2db.persistence.RepositoryException: java.lang.RuntimeException: org.json.JSONException: Missing value at character 10 of {methods:{\nonActionMethodID:{\narguments:[\nnull,\n"'dev_development_list_frm_tbl'"\n]\n}\n}}
at com.servoy.eclipse.model.repository.SolutionDeserializer.updateSolution(SolutionDeserializer.java:294)
at com.servoy.eclipse.model.repository.SolutionDeserializer.readSolution(SolutionDeserializer.java:209)
at com.servoy.eclipse.model.repository.EclipseRepository.loadRootObject(EclipseRepository.java:218)
at com.servoy.j2db.persistence.RootObjectCache.getRootObject(RootObjectCache.java:236)
at com.servoy.j2db.persistence.RootObjectCache.getActiveRootObject(RootObjectCache.java:170)
at com.servoy.j2db.persistence.RootObjectCache.getActiveRootObject(RootObjectCache.java:178)
at com.servoy.j2db.persistence.AbstractRepository.getActiveRootObject(AbstractRepository.java:427)
at com.servoy.eclipse.model.nature.ServoyProject.getSolution(ServoyProject.java:128)
at com.servoy.eclipse.core.ServoyModel$9.run(ServoyModel.java:1114)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: java.lang.RuntimeException: org.json.JSONException: Missing value at character 10 of {methods:{\nonActionMethodID:{\narguments:[\nnull,\n"'dev_development_list_frm_tbl'"\n]\n}\n}}
at com.servoy.j2db.util.JSONWrapperMap.getJson(JSONWrapperMap.java:66)
at com.servoy.j2db.util.JSONWrapperMap.containsKey(JSONWrapperMap.java:104)
at com.servoy.j2db.persistence.AbstractBase.getCustomPropertyLocal(AbstractBase.java:878)
at com.servoy.j2db.persistence.AbstractBase.getCustomProperty(AbstractBase.java:846)
at com.servoy.j2db.persistence.AbstractBase.hasOverrideCustomProperty(AbstractBase.java:1118)
at com.servoy.eclipse.model.repository.SolutionDeserializer.completePersist(SolutionDeserializer.java:1829)
at com.servoy.eclipse.model.repository.SolutionDeserializer.updateSolution(SolutionDeserializer.java:263)
... 9 more
Caused by: org.json.JSONException: Missing value at character 10 of {methods:{\nonActionMethodID:{\narguments:[\nnull,\n"'dev_development_list_frm_tbl'"\n]\n}\n}}
at org.json.JSONTokener.syntaxError(JSONTokener.java:451)
at org.json.JSONTokener.nextValue(JSONTokener.java:349)
at org.json.JSONObject.<init>(JSONObject.java:191)
at org.json.JSONTokener.nextValue(JSONTokener.java:319)
at org.json.JSONObject.<init>(JSONObject.java:206)
at org.json.JSONObject.<init>(JSONObject.java:327)
at com.servoy.j2db.util.ServoyJSONObject.<init>(ServoyJSONObject.java:76)
at com.servoy.j2db.util.ServoyJSONObject.<init>(ServoyJSONObject.java:71)
at com.servoy.j2db.util.JSONWrapperMap.getJson(JSONWrapperMap.java:62)
... 15 more

!ENTRY com.servoy.eclipse.model 4 0 2015-03-11 13:16:58.285
!MESSAGE Error activating solution. It is not properly initialized. Please check for problems in the underlying file representation.

Re: [URGENT] Solution cannot be activated with Git use

PostPosted: Wed Mar 11, 2015 2:07 pm
by gabid
It seems that somehow in the serialized form there are two versions of onActionMethodID:

Code: Select all
customProperties:"methods:{\
onActionMethodID:{\
arguments:[\
null,\
\"'addrbk_addressbook_detail_frm'\"\
]\
}\
}",


and
Code: Select all
onActionMethodID:"-1",

Re: [URGENT] Solution cannot be activated with Git use

PostPosted: Wed Mar 11, 2015 4:44 pm
by gabid
Forget the last comment.
I have fixed it. It was due to the way the line endings were configured.

I had to update the *.frm code from:
Code: Select all
customProperties:"methods:{\
onActionMethodID:{\
arguments:[\
null,\
\"'addrbk_addressbook_detail_frm'\"\
]\
}\
}",


to

Code: Select all
customProperties:"methods:{onActionMethodID:{arguments:[null, \"'addrbk_addressbook_detail_frm'\"]}}",


I believe it was caused by the way the line endings were initially generated in the source file, then when pushed to git they were converted to unix format and when pulled from the repository were somehow converted to Windows, but the \ were left there.

I hope it's helpful for people struggling with this error. I've spent quite some time on it.

Re: [URGENT] Solution cannot be activated with Git use

PostPosted: Wed Mar 11, 2015 7:46 pm
by jgarfield
I've found adding the following to the .gitattributes file for your project is invaluable:

Code: Select all
*.frm -text
*.val -text
*.tbl -text
*.rel -text
*.obj -text
*.dbi -text
*.sec -text
*.css -text

Re: [URGENT] Solution cannot be activated with Git use

PostPosted: Thu Mar 12, 2015 10:24 am
by gabid
Thanks for the suggestion.

I've added them as so I won't hit the same problem again.

Re: [URGENT] Solution cannot be activated with Git use

PostPosted: Mon Feb 22, 2016 3:34 pm
by jasantana
Hi all.

I'm having the same issues but only with solutions I have not created from within this Servoy installation.

I'm moving my solution from my old SVN repository to a GIT repository. What I've done is in a clean new installation of Servoy I have checkd out the solutions from the SVN repository. Then I have disconnected them and share them on my GIT repository. So far so good but when I try to switch between solutions I got the error:

GitError.png
GitError.png (39.37 KiB) Viewed 10532 times


The weird thing is that I have no problems with a solution that I have created in that new installation.

My configuration is as follows:

GitError0002.png
GitError0002.png (31.32 KiB) Viewed 10532 times


And the gitignore file has the following entries:
Code: Select all
# Compiled Source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.gitignore_global

# Servoy Metadata #
###################
*/.metadata/
.metadata/
.metadata\
*metadata/
*metadata\
*\.metadata\

# Packages #
############
*.7z
*.dmg
*.gz
*.iso
*.jar
*.tar

# Logs and databases #
######################
*.log

# OS Generated Files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-v100
.Trashes
ehthumbs.db
Thumbs.db


Any one can help please? Thanks in advance

Re: [URGENT] Solution cannot be activated with Git use

PostPosted: Mon Feb 22, 2016 4:22 pm
by gabid
Have you also tried the git attributes settings?

https://www.servoy.com/forum/viewtopic.php?f=8&t=20818#p111752

Re: [URGENT] Solution cannot be activated with Git use

PostPosted: Mon Feb 22, 2016 4:26 pm
by gabid
If setting the .gitattributes still does not work, try creating a new project, import/checkout files from cvs and make sure that switching between solutions work before pushing to git.

Then push to git and check out from git in another blank project. This way you know for sure that it will work on another installation.

Re: [URGENT] Solution cannot be activated with Git use

PostPosted: Mon Feb 22, 2016 4:31 pm
by ROCLASI
Hi Juan Antonio,

It usually means your fileVersion is newer than what your current Servoy version is using. Did you check out solutions from a newer version?
Check what the fileVersion properties of the different solution/modules are. You find it in the root level of the solution/module directory in the rootmetadata.obj file (which is plain text). Each 'project' directory has one.
I actually keep a list with what version is using what fileVersion.

Re: [URGENT] Solution cannot be activated with Git use

PostPosted: Mon Feb 22, 2016 4:33 pm
by jasantana
Thanks for your response.

Where should that file be?

Re: [URGENT] Solution cannot be activated with Git use

PostPosted: Mon Feb 22, 2016 4:35 pm
by ROCLASI
jasantana wrote:Thanks for your response.

Where should that file be?


Who are you asking ? :)

Re: [URGENT] Solution cannot be activated with Git use

PostPosted: Mon Feb 22, 2016 4:50 pm
by jasantana
ROCLASI wrote:
jasantana wrote:Thanks for your response.

Where should that file be?


Who are you asking ? :)


Nope, where. Which folder has to contain that file?

Re: [URGENT] Solution cannot be activated with Git use

PostPosted: Mon Feb 22, 2016 5:01 pm
by Andrei Costescu
The fileVersion thing is in [yourSolutionDir]/rootmetadata.obj.

We found that disabling autocrlf on windows can spare you a lot of trouble with Git. It depends I guess on what you need.
You can set that globally to false - even at the system settings level. See the screenshot above that has it listed and set to true.

Just in case you are not talking about the git attributes file. :)

Re: [URGENT] Solution cannot be activated with Git use

PostPosted: Mon Feb 22, 2016 5:08 pm
by jasantana
Thanks Andrei.

I've got some Macs in my team as well. Will it make any difference?

And yes, I was talking about the git attributes file