WSO2 Api Manager fails to show user roles - wso2

We recently upgraded from API Manager 1.90 to 1.10 using the instructions on the Wso2 website. When we load the carbon local admin console, most of the pages load just fine. However, when we load the user list, select a user and click either view or assign roles, this error occurs. I have not been able to find an issue tied to it on the JIRA boards. Does anyone know what I can do to fix this?
2016-08-23 09:26:05,638 [-] [http-nio-443-exec-2] ERROR JspTilesRequestContext JSPException while including path '/user/edit-user-roles.jsp'.
javax.servlet.jsp.JspException: ServletException while including page.
Caused by: org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.user.edit_002duser_002droles_jsp
Caused by: java.lang.ClassNotFoundException: org.apache.jsp.user.edit_002duser_002droles_jsp
at java.net.URLClassLoader.findClass(Unknown Source)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:121)
at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:172)

If you are running this as a Windows service, try adding below line to wrapper.conf
wrapper.java.additional.26 = -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false

Add this lines to wrapper.conf file:
wrapper.java.additional.18 = -Dcomponents.repo=${carbon_home}\\repository\\components
wrapper.java.additional.26 = -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false

Related

WSo2 Identity Server : User self-registration via my account

Source : https://lms.wso2.com/courses/take/wso2-identity-server-fundamentals-v5-11/pdfs/22647862-practical-exercise-user-management
After following "LAB02 : User self-registration via my account" as mentioned in the source, I get the error mentioned in the screenshot and also corresponding deployment.toml can be seen in the screenshot. How to fix this error?
As per the ERROR traces in your terminal, your deployment.toml file contains some keys more than once.
eg: ERROR {org.wso2.config.mapper.TomlParser} - server previously defined at line 1, column 1 (line 79, column 1) means [server] configs are in the deployment.toml at line 1 and line 79.
You can't define the same key (eg: [server]) more than once in the deployment.toml file.
Check other ERRORs and remove the redundant configs.
You can find more details about toml configs by:
https://www.youtube.com/watch?v=BRWvtcV1T94&t=695s
https://www.youtube.com/watch?v=-WqZhUoK77I
Thanks Anuradha.
The above error message comes from Docker.
To keep things simple :
Today, I installed WSO2 in Windows.
Disable two factor authentication in GMAIL.
Enabled less secure app in GMAIL.
The source documentation worked as it is.

RequestDumperValve breaks POST request

I have an historic ColdFusion 9 server running on top of JBoss 5.1 on Scientific Linux 6.2.
Every once in a while I see the error
2019-08-20 12:15:30,621 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/REDACTED].[CfmServlet]] (ajp-0.0.0.0-8009-8) Servlet.service() for servlet CfmServlet threw exception
javax.servlet.ServletException: ROOT CAUSE:
java.lang.IllegalArgumentException
at coldfusion.filter.FormScope.parseQueryString(FormScope.java:375)
at coldfusion.filter.FormScope.parsePostData(FormScope.java:346)
at coldfusion.filter.FormScope.fillForm(FormScope.java:296)
at coldfusion.filter.FusionContext.SymTab_initForRequest(FusionContext.java:377)
in the file /var/log/jboss/server.log
To find out what seems to be the problem I thought it's somehow possible to log the POST params JBoss received and is trying to prepare for ColdFusion to use. On the internet I read I should go to file /opt/jboss/server/default/deploy/jbossweb.sar/server.xml and uncomment the line <Valve className="org.apache.catalina.valves.RequestDumperValve" />.
Now, the params (cookie, header, POST etc.) are indeed logged into the server.log file. The ColdFusion server, however, does not do its task anymore. I open CFADMIN in the browser and enter the password. I'm not let in. I, again, see the log-on page. Same is true for my application. I see in the server.log file the parameters (username and password) are correct. They are logged in clear text.
There's a story on the internet that describes how the RequestDumperValve destroys a request by applying wrong encoding. Does something like this happen to me? Are there other possibilities to log the POST params in JBoss?

Pentaho Zimbra Web Service (zimbra.xsd not found)

I am trying to implement a database integration on a system that triggers, after a user creation, a account creation on Zimbra service through ZimbraAdminService.
The server version is 8.6
On Pentaho Web Service Lookup step, when I fill the URL field with https://example.com/service/wsdl/ZimbraAdminService.wsdl and hit "Load" button, I get the following error:
Could not load WSDL file: WSDLException (at /wsdl:definitions/wsdl:types/xsd:schema): faultCode=OTHER_ERROR: An error occurred trying to resolve schema referenced at 'zimbra.xsd'.: java.io.FileNotFoundException: This file was not found: file:/C:/Program Files/Pentaho/data-integration/zimbra.xsd
I already checked the documentation on https://wiki.zimbra.com/wiki/Wsdl
Anyone faced such problem and has a solution? Thanks.
To solve the problem above, I had to go to the browser, access the following addresses, load and save the XML generated of the xsd services as .xsd extension:
https://example.com/service/wsdl/zimbra.xsd
https://example.com/service/wsdl/zimbraAdmin.xsd
https://example.com/service/wsdl/zimbraAdminExt.xsd
https://example.com/service/wsdl/zimbraMail.xsd
https://example.com/service/wsdl/zimbraRepl.xsd
https://example.com/service/wsdl/zimbraSync.xsd
https://example.com/service/wsdl/zimbraVoice.xsd
Put this files on /your-program-install-folder/Pentaho/data-integration (on Windows - C:\Program Files\Pentaho\data-integration)
After doing that, the problem will be solved.

Unable to use the Java API to push resources to WSO2 API Manager v2.0.0 registry

Using the Java API to push resources to the registry of APIM 2.0.0 fails.
The same code used against APIM 1.10.0 succeeds.
Example code to reproduce is of the sort
String tenantDomain = “mytenant.com";
String url = "https://localhost:9443/t/"+tenantDomain+"/registry";
String userName = “admin#mytenant.com";
String password = “admin";
System.setProperty("carbon.repo.write.mode", "true");
//Get the file which needs to be added to the registry
File file = new File(“/home/bob/Desktop/myPayload.json");
RemoteRegistry remote_registry = new RemoteRegistry(new URL(url), userName, password);
//Import the file to config registry
RegistryClientUtils.importToRegistry(file ,"/_system/config" ,remote_registry);
//Export from registry
//RegistryClientUtils.exportFromRegistry(file ,"/_system/governance/SomePayload.json" ,remote_registry);
the call to RegistryClientUtils.importToRegistry(file ,"/_system/config" ,remote_registry); will fail. Same code run against APIM 1.10.0 works fine, as it has always done with other products like the ESB.
Typical exception is:
Caused by: org.wso2.carbon.registry.core.exceptions.RegistryException:
Add resource fail. Suggested Path:
/_system/governance/apimgt/applicationdata/customdata/somedata,
Response Status: 403, Response Type: CLIENT_ERROR at
org.wso2.carbon.registry.app.RemoteRegistry.put(RemoteRegistry.java:543)
at
org.wso2.carbon.registry.core.utils.RegistryClientUtils.processImport(RegistryClientUtils.java:113)
at
org.wso2.carbon.registry.core.utils.RegistryClientUtils.processImport(RegistryClientUtils.java:102)
at
org.wso2.carbon.registry.core.utils.RegistryClientUtils.processImport(RegistryClientUtils.java:102)
at
org.wso2.carbon.registry.core.utils.RegistryClientUtils.processImport(RegistryClientUtils.java:102)
at
org.wso2.carbon.registry.core.utils.RegistryClientUtils.importToRegistry(RegistryClientUtils.java:65)
And in the APIM 2.0.0 log we see typically
[2016-08-18 15:57:34,699] WARN - JavaLogger potential cross-site
request forgery (CSRF) attack thwarted (user:,
ip:127.0.0.1, method:POST,
uri:/registry/atom/_system/governance/apimgt/applicationdata/customdata/somedata,
error:required token is missing from the request)
APIM 2.0.0 is missing a line in the configuration of CSRF. The registry endpoint needs to be added to those configured for store and publisher. Add the end-point in the "Owasp.CsrfGuard.Carbon.properties" file found in the [APIM_HOME]/repository/conf/security directory.
At the end of this file, add the line given below.
org.owasp.csrfguard.unprotected.registry=%servletContext%/t/*
It seems the API call is blocked by the CSRF Filter. Can you open carbon.xml and white-list the URL you are using and check again.
Try adding below line at the end of <APIM_HOME>/repository/conf/security/Owasp.CsrfGuard.Carbon.properties file.
org.owasp.csrfguard.unprotected.reg=%servletContext%/registry/*
Update: The same error occurs due to a bug in JDK 1.8.0_151.
See wso2 api manger carbon page gives 403 Forbidden

WSO2 ESB: Getting Dead Pages When Running in Windows Service

I'm getting blank pages when navigating the WSO2 ESB-4.9.0 management console. For example, the registry, templates, endpoints, and local entries pages are all blank when navigating to them in the console UI.
I've found the following errors in the logs:
Error during rendering
IO Error executing tag: JSPException while including path '/templates/list_templates.jsp'. ServletException while including page.
The ESB is running in a YAJSW Windows Service. I should note that the ESB runs fine when running straight from the command line, it's just when using the service wrapper.
Strainy
Since you mentioned that the ESB starts as a window service, in carbon 4.4.x, default wrapper.conf file needs to be updated with following additional entries.
wrapper.java.additional.26 = -Dwso2.carbon.xml=${carbon_home}\\repository\\conf\\carbon.xml
wrapper.java.additional.27 = -Dwso2.registry.xml=${carbon_home}\\repository\\conf\\registry.xml
wrapper.java.additional.28 = -Dwso2.user.mgt.xml=${carbon_home}\\repository\\conf\\user-mgt.xml
wrapper.java.additional.29 = -Dwso2.transports.xml=${carbon_home}\\repository\\conf\\mgt-transports.xml
wrapper.java.additional.31 = -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false
wrapper.java.additional.33 = -Dfile.encoding=UTF8
You can verify these configurations in wrapper.conf and these configurations may help you to solve the jsp error.
Following link may help you if you need more information regarding this.
https://docs.wso2.com/display/ESB490/Installing+as+a+Windows+Service#InstallingasaWindowsService-SettinguptheYAJSWwrapperconfigurationfile
I just used the NSSM - the "Non-Sucking Service Manager".
It's actually amazingly simple to install a Service using this tool.
https://nssm.cc
Just set it up to point at the wso2server.bat file
Keeping an eye on this issue however: https://wso2.org/jira/browse/ESBJAVA-4342