Page 1 of 1

WAR file does not deploy because of table without PK

PostPosted: Thu Dec 12, 2019 12:00 pm
by omar
Hi,

I am having trouble deploying a war file. In my solution I reference an external database in which there is a table without a primary key. In Servoy developer I put the row_ident mark on the first column which is unique. In developer this works fine and I can browse the data without any issues.

However, no matter what I try, I can't get the WAR file to successfully reference the same database on the server (the database is accessible from the server through dbVisualizer). I define my database properties using the servoy_server.properties file using DBI files.

If i include a dummy form with a reference to the table TOMCAT refuses to deploy my WAR file saying it can't find the database. If I don't include the form it will not add the database reference and I can add it manually in Servoy Server Admin console but then it will complain about the table not having a primary key... :cry: Any suggestions?

Re: WAR file does not deploy because of table without PK

PostPosted: Thu Dec 12, 2019 2:33 pm
by jcompagner
The question is more why doesn't tomcat deploy your war that has the dbi info of that server/table?

What is the exact error that you see in the tomcat logs or in the servoy log?

Re: WAR file does not deploy because of table without PK

PostPosted: Thu Dec 12, 2019 3:04 pm
by omar
Hi Johan,

Thanks for your response. If I include a dummy form with a reference to the table the error I get is that it cannot find the database server:

Caused by: com.servoy.j2db.persistence.RepositoryException: Cannot find database server "bronboek", import failed.

It looks like the server properties are automatically excluded from the servoy_server.properties file when exporting the war file?

Re: WAR file does not deploy because of table without PK

PostPosted: Thu Dec 12, 2019 3:56 pm
by omar
I think I may have to do a clean install. How can I remove any dependencies to previous versions of the application?

Re: WAR file does not deploy because of table without PK

PostPosted: Thu Dec 12, 2019 4:37 pm
by jcompagner
so you didn't add "bronboek" as a server definition when making the WAR?

What do you mean with "automatically excluded" we don't exclude anything, you have to say which servers we should export (from the developer the last export pages if you don't choose a external servoy.properties file)

Re: WAR file does not deploy because of table without PK

PostPosted: Thu Dec 12, 2019 4:49 pm
by omar
I have a servoy_server.properties file that includes a "bronboek" server definition. However, when I deploy the solution the connection seems to be missing or invalid??

Re: WAR file does not deploy because of table without PK

PostPosted: Thu Dec 12, 2019 6:37 pm
by jcompagner
You really see in the log an connection error?
It is invalid for a reason. It should be there.

What happens if you deploy that war without an active solution (but with your properties file) is it then listed on the admin page?

Re: WAR file does not deploy because of table without PK

PostPosted: Thu Dec 12, 2019 7:57 pm
by omar
Just tried that. It does not. I do get an error however. Does this ring any bells?

2019-12-12 18:45:01,454 WARN [http-nio-8080-exec-6] org.sablo.specification.WebObjectSpecification - Unknown type name 'array' encountered while parsing spec servoyextra-table [ ]

Re: WAR file does not deploy because of table without PK

PostPosted: Thu Dec 12, 2019 11:35 pm
by omar
Pfew, finally got it to work. What I basically did is:

1. Switched to a new workspace
2. As Johan suggested, I did a WAR export (named test.war) without the active solution (uncheck "include active solution and modules")
3. Instead of using the servoy_server.properties file I switched back to filling the tabs with database connections (maybe it contained properties that worked in 2019.6 but no longer did in 2019.9?, the connections were valid I checked them over and over)
4. Switched back to my normal workspace, did the same, this time with the active solution. NullPointer Error.
5. Checked DBI files checkbox, exported the WAR file and this time it worked.

Beats me. Main takeaway with deployment database connection problems: do step2 and take your solution out of the equation, it helps focus on what matters. Thanks Johan! I appreciate it.

Re: WAR file does not deploy because of table without PK

PostPosted: Fri Dec 13, 2019 11:45 am
by jcompagner
omar wrote:Just tried that. It does not. I do get an error however. Does this ring any bells?

2019-12-12 18:45:01,454 WARN [http-nio-8080-exec-6] org.sablo.specification.WebObjectSpecification - Unknown type name 'array' encountered while parsing spec servoyextra-table [ ]


this is just a problem of a wrong spec definition in our servoy-extra component, we will fix that shortly