CMDBuild Forum

Re: Help. I cannot make shark run with cmdbuild 2.2.1

Dear all,

I am using Tomcat 6 over JRE 1.6 on OSX. I have installed and deploy cmdbuild 2.2.1 with no problems so far. It runs ok, only I get the 'Class RequestForChange not found' error, I guess because the shark service is not yet installed. I installed cmdbuild with the Demo database.

Then I have downloaded shark-cmbuild-2.2.1. when deploying the shark.war on Tomcat6, even before configuring it, the functionality of the cmbuild gets affected. For example, I cannot access now the Administration module. It keeps showing the message 'waiting for Localhost'. After that, I cannot even reload the Tomcat6 manager. So usually what I do is to force a stop of the Tomcat, manually remove the shark.war and deployed shark, restart Tomcat6 and everything seems fine again. Cmdbuild works again and I can access the Administration module. It seems as it did not like the presence of 'shark' at all!

Anyway, I have tried again but now configuring the shark environment prior to relaunching cmdbuild, following step by step the instructions in the README file. First I stop both services (cmdbuild and shark). I left most of the settings as default, for testing purposes. Here it is how I configure it:

shark/conf/Shark.conf:

org.cmdbuild.ws.url=http://localhost:8080/cmdbuild/

org.cmdbuild.ws.username=workflow

org.cmdbuild.ws.password=changeme

 

Regarding that username and password, I have a cmdbuild user called 'workflow', defined already in the Demo database. I changed its password to 'changeme', from the Administration module. I am not sure if that user is the same one used in the Shark.conf. It is very confusing to me.

Then in 'cmdbuild/WEB-INF/conf/auth.conf:

auth.methods=DBAuthenticator

#serviceusers=portlet

serviceusers.privileged=workflow

#force.ws.password.digest=true

 

Then, in 'shark/META-INF/context.xml'

<Resource

name="sharkdb"

type="javax.sql.DataSource"

driverClassName="org.postgresql.Driver"

url="jdbc:postgresql://localhost/cmdbuild"

username="shark"

password="shark"

maxIdle="10"

maxActive="300"


maxWait="5000"

factory="org.enhydra.jndi.DataSourceFactory"/>

</Context>

 

 

Here I am not sure if the default 'shark' user created in the Postgres database has that password 'shark'. Also what does this 'name=sharkdb' refers to?? My cmdbuild postgres database is called 'cmdbuild', as I named it like that when performing the guided installation of cmdbuild 2.2.1. Should I change that to 'name=cmdbuild'. What about the password. Everything is superconfusing for me and neither the README file nor the Technical manual provide any light on this.

Anyway, I log in again into cmdbuild, and I keep getting the 'Class RequestForChange not found' error. Then I access the Administration module, and under 'Setup/Workflow':

I enable the workflow engine

Server URL : http://localhost:8080/shark

Then under 'Credentials'...more confusion! what should I put here?

username: workflow / password: changeme

or what? 

Then, I get the following errors registered in the logs:

shark.log:

"at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

2014-11-20 11:46:32,075: Problem while initializing caches !!!"

 

cmdbuild.log:

"ERROR 2014-11-20 11:48:08 [jsonrpc ] A java.lang.OutOfMemoryError occurred calling method class org.cmdbuild.servlets.json.schema.ModClass.getAllClasses: PermGen space"

 

catalina.out

"Shark -> shark engine initialization is finished, it lasted 1 [s]

Shark -> Shark ready and waiting ...

pre getConnection . . . . . .

pre commit . . . . . .

++++++++++++++++++++++++++++++++++++++ init - end

Nov 20, 2014 11:46:32 AM org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deploying web application directory docs

Nov 20, 2014 11:46:32 AM org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deploying web application directory examples

Nov 20, 2014 11:46:32 AM org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deploying web application directory ROOT

Nov 20, 2014 11:46:32 AM org.apache.coyote.http11.Http11Protocol start

INFO: Starting Coyote HTTP/1.1 on http-8080

Nov 20, 2014 11:46:32 AM org.apache.jk.common.ChannelSocket init

INFO: JK: ajp13 listening on /0.0.0.0:8009

Nov 20, 2014 11:46:32 AM org.apache.jk.server.JkMain start

INFO: Jk running ID=0 time=0/14  config=null

Nov 20, 2014 11:46:32 AM org.apache.catalina.startup.Catalina start

INFO: Server startup in 12160 ms

Client Type is WS

XA UserTransaction lookup name is null

Client Type is WS

XA UserTransaction lookup name is null

Client Type is WS

XA UserTransaction lookup name is null

Client Type is WS

XA UserTransaction lookup name is null"

Thank you very much for any help!

Dear Javi,
 
we don't know why, after the first deploy of Shark, you cannot be able to go to the Administration module. We never encounter this error.
 
In the logs it says:
 
"ERROR 2014-11-20 11:48:08 [jsonrpc ] A java.lang.OutOfMemoryError occurred calling method class org.cmdbuild.servlets.json.schema.ModClass.getAllClasses: PermGen space"
 
already tried to tweak Tomcat memory settings? Try with these:
 
-Xms384M -Xmx1536M -XX:MaxPermSize=256M -server

 

Then, when you use a demo database, the error "Class RequestForChange not found" happens when xpdl is missing for the RequestForChange process. If you download the zip file (not only the war files), you should be able to find it inside.
 
Best regards.
 
-- CMDBuild Team
 
Previously Javi wrote:

Dear all,

I am using Tomcat 6 over JRE 1.6 on OSX. I have installed and deploy cmdbuild 2.2.1 with no problems so far. It runs ok, only I get the 'Class RequestForChange not found' error, I guess because the shark service is not yet installed. I installed cmdbuild with the Demo database.

Then I have downloaded shark-cmbuild-2.2.1. when deploying the shark.war on Tomcat6, even before configuring it, the functionality of the cmbuild gets affected. For example, I cannot access now the Administration module. It keeps showing the message 'waiting for Localhost'. After that, I cannot even reload the Tomcat6 manager. So usually what I do is to force a stop of the Tomcat, manually remove the shark.war and deployed shark, restart Tomcat6 and everything seems fine again. Cmdbuild works again and I can access the Administration module. It seems as it did not like the presence of 'shark' at all!

Anyway, I have tried again but now configuring the shark environment prior to relaunching cmdbuild, following step by step the instructions in the README file. First I stop both services (cmdbuild and shark). I left most of the settings as default, for testing purposes. Here it is how I configure it:

shark/conf/Shark.conf:

org.cmdbuild.ws.url=http://localhost:8080/cmdbuild/

org.cmdbuild.ws.username=workflow

org.cmdbuild.ws.password=changeme

 

Regarding that username and password, I have a cmdbuild user called 'workflow', defined already in the Demo database. I changed its password to 'changeme', from the Administration module. I am not sure if that user is the same one used in the Shark.conf. It is very confusing to me.

Then in 'cmdbuild/WEB-INF/conf/auth.conf:

auth.methods=DBAuthenticator

#serviceusers=portlet

serviceusers.privileged=workflow

#force.ws.password.digest=true

 

Then, in 'shark/META-INF/context.xml'

<Resource

name="sharkdb"

type="javax.sql.DataSource"

driverClassName="org.postgresql.Driver"

url="jdbc:postgresql://localhost/cmdbuild"

username="shark"

password="shark"

maxIdle="10"

maxActive="300"


maxWait="5000"

factory="org.enhydra.jndi.DataSourceFactory"/>

</Context>

 

 

Here I am not sure if the default 'shark' user created in the Postgres database has that password 'shark'. Also what does this 'name=sharkdb' refers to?? My cmdbuild postgres database is called 'cmdbuild', as I named it like that when performing the guided installation of cmdbuild 2.2.1. Should I change that to 'name=cmdbuild'. What about the password. Everything is superconfusing for me and neither the README file nor the Technical manual provide any light on this.

Anyway, I log in again into cmdbuild, and I keep getting the 'Class RequestForChange not found' error. Then I access the Administration module, and under 'Setup/Workflow':

I enable the workflow engine

Server URL : http://localhost:8080/shark

Then under 'Credentials'...more confusion! what should I put here?

username: workflow / password: changeme

or what? 

Then, I get the following errors registered in the logs:

shark.log:

"at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

2014-11-20 11:46:32,075: Problem while initializing caches !!!"

 

cmdbuild.log:

"ERROR 2014-11-20 11:48:08 [jsonrpc ] A java.lang.OutOfMemoryError occurred calling method class org.cmdbuild.servlets.json.schema.ModClass.getAllClasses: PermGen space"

 

catalina.out

"Shark -> shark engine initialization is finished, it lasted 1 [s]

Shark -> Shark ready and waiting ...

pre getConnection . . . . . .

pre commit . . . . . .

++++++++++++++++++++++++++++++++++++++ init - end

Nov 20, 2014 11:46:32 AM org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deploying web application directory docs

Nov 20, 2014 11:46:32 AM org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deploying web application directory examples

Nov 20, 2014 11:46:32 AM org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deploying web application directory ROOT

Nov 20, 2014 11:46:32 AM org.apache.coyote.http11.Http11Protocol start

INFO: Starting Coyote HTTP/1.1 on http-8080

Nov 20, 2014 11:46:32 AM org.apache.jk.common.ChannelSocket init

INFO: JK: ajp13 listening on /0.0.0.0:8009

Nov 20, 2014 11:46:32 AM org.apache.jk.server.JkMain start

INFO: Jk running ID=0 time=0/14  config=null

Nov 20, 2014 11:46:32 AM org.apache.catalina.startup.Catalina start

INFO: Server startup in 12160 ms

Client Type is WS

XA UserTransaction lookup name is null

Client Type is WS

XA UserTransaction lookup name is null

Client Type is WS

XA UserTransaction lookup name is null

Client Type is WS

XA UserTransaction lookup name is null"

Thank you very much for any help!

 

Thanks for your reply, in the end I manage to have it running. I had to do:

 
- Run tomcat6 as 'root'
- In PostgreSQL, change the owner of the 'shark' schema to 'shark' instead of 'postgres'
- Apart from the 'webapps/cmdbuild-shark/META-INF/context.xml'  file, I also had to edit the 'conf/Catalina/localhost/cmdbuild-shark.xml' file, and change:
 
url="jdbc:postgresql://localhost/${cmdbuild]"  

to

url="jdbc:postgresql://localhost/cmdbuild"
 
I installed the 'Demo' database, and then under 'Processes' proceeded to upload the 'RequestForChange.xpdl' file. This also seemed to work fine and the 'Class RequestForChange' error disappeared.
 
But now I'm facing a new problem. I try to create a new Request For Change. I managed to record one, but if I try to edit the 'Advance' properties, or even try to add an additional request, I keep getting memory related errors and the tomcat process starts eating CPU like crazy and stops to respond. I have to force quit in order to stop it. I paste below some of this errors:
 
Initially I got just this error:
 
Call: services/json/workflow/saveactivity
------------------------------------------
Error: java.lang.OutOfMemoryError: PermGen space
 
But future errors gave more detail. I just paste fragments, in order not to bloat the forum: 
 
Call: services/json/workflow/saveactivity
------------------------------------------
Error: java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)...
 
Also this error:
 
Call: services/json/workflow/saveactivity
------------------------------------------
Error: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userWorkflowLogicBuilder' defined in class path resource [org/cmdbuild/spring/configuration/User.class]: Instantiation of bean failed; nested exception is java.lang.OutOfMemoryError: PermGen space
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581)
at ...
 
What do you think it could be the cause? Thanks for any advice and your quick reply!

Hi there!

 
I finally fixed the memory problem giving tomcat like a tone of memory under the CATALINA_OPTS
 
CATALINA_OPTS="-Xmx1024m -XX:MaxPermSize=256M -Djava.awt.headless=true "
 
For people using Tomcat under OSX, I added that at the beginning of the 'bin/catalina.sh' script.
 
So now everything runs superfine, including the Request For Change workflow. I'm now so happy that I'm going to drink a pack of beers or two at once.