0
votes

Consecutively to WSO2 API Manager 2.0.0 : white screens after installing https certificate, I've just installed a fresh new WSO2 API Manager (single node) from the 2.0.0 zip distribution using MySQL Database to try to avoid problems related to H2 database.

After the install is complete, it starts with no warning and no error (after a few tries to get all things right in master-datasources.xml).

In publisher, I can log in as admin, create a new API, import swagger json contract, finalize API with no problem.

In store, I can log in as admin, view the API I've just created, create a new application via the right-side drop down menu, subscribe to it.

BUT when I try to open an application in order to generate keys and token, I just get a white empty screen. Nothing can help me in the logs :

[29/Nov/2016:16:17:33 +0100] "GET /store/site/pages/application.jag?name=MyNewApp&tenant=carbon.super HTTP/1.1" 200 3 "https://10.22.106.101:9443/store/site/pages/applications.jag?tenant=carbon.super" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0"

EDIT : A few minutes after I get the page crash (maybe not related ?) I have this printing repeatedly in wso2carbon.log :

WARN {sun.rmi.transport.tcp.TCPTransport$AcceptLoop} -  RMI TCP Accept-11111: accept loop for ServerSocket[addr=0.0.0.0/0.0.0.0,localport=11111] throws {sun.rmi.transport.tcp.TCPTransport$AcceptLoop}
java.lang.OutOfMemoryError: unable to create new native thread

Again, this is a basic installation (unzip) plugged into MySQL database with no customization/configuration.

EDIT 2 : So I think I have found the cause, but not the solution. This problem does not occur when I launch via direct command line, it occurs only when I launch through systemd service :

sudo sytemctl start wso2am.service

/etc/systemd/system/wso2am.service :

[Unit]
Description=WSO2 API Manager

[Service]
User=linc

ExecStart=/bin/bash -c ". /etc/profile.d/setenv.sh; /home/linc/wso2am-2.0.0/bin/wso2server.sh start"
Type=forking

[Install]
WantedBy=multi-user.target

So is WSO2 not compatible with systemd launching ? or am I missing some parameter ?

2
Nothing on wso2carbon.log? or in browser console?Bee
Exactly. What can I do to make some logs appear somewhere ? What does this "application.jag" try to call ? Can I call it in an other way ?Tristan
To debug, you can put some logs in repository/deployment/server/jaggeryapps/store/site/blocks/application/application-view/block.jag and see where it fails. Put new Log().info("This line is reached"); in few places, and see where it breaks.Bee
Ok, I've put loggers everywhere in block.jag and now I can tell "grant_types = mod.getAllowedGrantTypes();" crashes the page silently. I can log something just before and nothing is logged after this statement. What should I do from now ?Tristan
getAllowedGrantTypes() is in repository/deployment/server/jaggeryapps/store/modules/application/list.jag. Please put some logs there too.Bee

2 Answers

1
votes

I have followed this blog post to run APIM as a Linux service. Please have a look. It should work without a problem. (Make sure to add #!bin/sh at the top of myService.sh)

0
votes

Finally I have WSO2 API manager running as a Systemd service.

This is my 'wso2apim.service' file


[Unit]
Description=WSO2 API Manager

[Service]
Environment= JAVA_HOME=/usr/lib/jvm/java-8-oracle
WorkingDirectory=/opt/wso2/wso2am-2.0.0
User=wso2
ExecStart=/bin/bash /opt/wso2/wso2am-2.0.0/bin/wso2server.sh
ExecStop= /bin/bash -c '/opt/wso2/wso2am-2.0.0/bin/wso2server.sh stop'
ExecReload=/bin/bash -c '/opt/wso2/wso2am-2.0.0/bin/wso2server.sh restart'

[Install]
WantedBy=multi-user.target

It's simple, but tricky

  1. The service type is simple (not fork or either). (Default value)
  2. The ExecStart has not to include the 'start' option. With the start option, it tries a nohup, that is not working
  3. But, the stop has to include the stop options

Hope it helps