[URGENT] Solution cannot be activated with Git use

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.

[attachment=0]2015_03_11_12_48_03_Servoy_Design_Servoy_Developer.jpg[/attachment]

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

!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.(JSONObject.java:191)
at org.json.JSONTokener.nextValue(JSONTokener.java:319)
at org.json.JSONObject.(JSONObject.java:206)
at org.json.JSONObject.(JSONObject.java:327)
at com.servoy.j2db.util.ServoyJSONObject.(ServoyJSONObject.java:76)
at com.servoy.j2db.util.ServoyJSONObject.(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.

It seems that somehow in the serialized form there are two versions of onActionMethodID:

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

and

onActionMethodID:"-1",

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:

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

to

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.

I’ve found adding the following to the .gitattributes file for your project is invaluable:

*.frm -text
*.val -text
*.tbl -text
*.rel -text
*.obj -text
*.dbi -text
*.sec -text
*.css -text

Thanks for the suggestion.

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

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:

[attachment=1]GitError.png[/attachment]

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:

[attachment=0]GitError0002.png[/attachment]

And the gitignore file has the following entries:

# 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

Have you also tried the git attributes settings?

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

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.

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.

Thanks for your response.

Where should that file be?

jasantana:
Thanks for your response.

Where should that file be?

Who are you asking ? :)

ROCLASI:

jasantana:
Thanks for your response.

Where should that file be?

Who are you asking ? :)

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

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. :)

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

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.

Sorry Robert. I think that you’ve posted this while I was replying, that’s the reason for the missunderstanding. :D :lol:

they are the same Servoy Version 7.4.5

Yes, Git will not mess automatically with line endings (convert them between unix/win formats) so you won’t commit by mistake only changes to line endings that you didn’t want to commit. It happened to us a few times.

.gitattributes - http://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes

The autocrlf set to false did the trick. Thank you all