PWC1231 and PWC6344 - java

I have two servers running on Glassfish 2.1 both have the same web app.
Two times this error occurred: Some jsp pages stop displaying only showing a blank page, and the following errors are printed in the logs...
PWC1231: Servlet.service() for servlet jsp threw exception
java.io.FileNotFoundException: /path/to/jsp/file/jsp_file.jsp.java
(Permission denied) at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(FileOutputStream.java:179) at
java.io.FileOutputStream.(FileOutputStream.java:70) at
org.apache.jasper.compiler.AntJavaCompiler.getJavaWriter(AntJavaCompiler.java:213)
at
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:173)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:409) at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:344)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) at
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at
org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:855)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056)
at
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:261)
at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:388)
at
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:316)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:831) at
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at
com.my.app.filtro.FiltroCallcenter.doFilter(FiltroCallcenter.java:90)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94) at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
at
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Followed by this:
PWC6344: Unable to create output writer for file /path/to/jsp/file/jsp_file.jsp.java|#]
Sometimes only the PWC6344 error is printed and sometimes both, the PWC1231 error is always followed by PWC6344 (which somewhat makes sense, because that exception is thrown when an IOException occurs).
Well, both times this errors happened, the only thing I did was stop and start the instance, and everything was alright again, also this error has only occurred in one of the servers.
Whats is happening ?... Or how can I diagnose what is causing this so I can fix the problem instead of stopping and re starting for eternity...
UPDATES:
I was looking into the possibility of this been a file descriptor problem, as suggested by sbridges but!, the maximum number of file handlers is 811975 with 4520 opened files in one server and 359532 with only 6894 in the other.
So, I guess its safe to say this is not the problem!
Does someone have another theory?

It looks like the permissions are set incorrectly and you can't write the compiled jsp page to disk,
/path/to/jsp/file/jsp_file.jsp.java (Permission denied)
Are the permissions correct on that directory/file?

Rename jsp_file.jsp.java to jsp_file.jsp.

PWC6344: Unable to create output writer for file /path/to/jsp/file/jsp_file.jsp.java|#]
This can also happen if the underlying operating system has run out of file handlers/descriptors which are required in order to open a file for reading or writing. I'm not closely familiar with CentOS, but Google hints that it has a "relatively low" limit of 1024 given the lot of problems related to it in the search results. Among the results you'll see a lot of questions/answers as to how to increase it, such as the following blog:
Increase the number of file descriptors on Centos and Fedora Linux
Raising the number of file descriptors for a regular user on CentOS/Fedora/Redhat is surprisingly difficult to learn how to do. There are lots of incomplete walk throughs on the web, some with typos and other problems.
Here are the steps that worked for me to raise the open file descriptor limit from 1024 (the default) to 65535:
As root, edit /etc/sysctl.conf and add the line:
fs.file-max = 512000
At the bash prompt, run:
$ sysctl -p
That will cause the settings to take effect. You can also cat 512000 > /proc/sys/fs/file-max but that may reset on reboot.
Edit /etc/security/limits.conf and add the following:
* - nofile 65535
See the inline comments for more details on what that does and how to make it more restrictive if you prefer.
As root, run
$ ulimit -n 65535
and make sure you have no errors. To double check, run ulimit -n and make sure the response is 65535.
Ensure that PAM authentication is turned on for SSH, or else when you try to connect as a regular user, you won’t see the new limits. Edit /etc/ssh/sshd_config and make sure you have:
UsePAM yes
Restart SSH /sbin/service sshd restart if you made any changes.
Login as a regular user with a new SSH session & shell and run:
$ ulimit -n 65535
Run ulimit -n again to check and good luck!

Related

Streamsets Error - Bad File Descriptor

I was attempting to use Streamsets to query an Oracle database and publish the data into Kafka. I downloaded Streamsets' tarball on my Mac and unzipped it into my home directory. Running $HOME/streamsets-datacollector-2.1.0.2/bin/streamsets dc started up on my first try, then I followed the instructions here to add the jdbc driver, then the instructions here to configure my streamsets job. However, I got an error: JDBC_00 - Cannot connect to specified database: com.streamsets.pipeline.api.StageException: JDBC_06 - Failed to initialize connection pool: java.sql.SQLRecoverableException: IO Error: Bad file descriptor.
This wound up having something to do with the limit on the number of files a process can have open. When I ran ulimit -n on the laptop, it showed 4864, then I set it to 10,000 via ulimit -n 10000, restarted the streamsets server, and it worked! If I need to keep running this, I will find a more procedural way of setting the ulimit for this process to work around this issue.
you definitely want need increase ulimit -n. To permanently change for all users in Ubuntu try the following:
echo "* soft nofile 60000" > /etc/security/limits.d/*_limits.conf && echo "* hard nofile 60000" >> /etc/security/limits.d/*_limits.conf
substitute 60000 with whatever number you want. I've never had a problem in streamsets using 60k. you should be able to do something similar in bsd.

Metamap run local raise "Error when querying Prolog Server: Connection refused"

I follow this steps to run the Metamap Java API 2014 on Linux platform
(Main page from metamap)
After start Metamap server, I run some main class in Metamap JavaAPI pakages, but it raises Error when querying Prolog Server: Connection refused
Then I check if the Metamap server is running on port 8066 by using the command:
sudo netstat -tulpn | grep 8066
but I receive nothing.
Did anyone had the same problem before and knows solution for this?
After running skrmedpostctl (and the optional word sense diambiguation server wsdserverctl), you need to run the mmserver executable in order to use the Java API for Metamap. This can be run by running the command
./bin/mmserver{two-digit-year}
Also, be sure to include the two jar files for metamap and prolog-beans in your classpath (in your IDE, this can be done by adding a dependency to these jars).
The issue may reside with the timeout: when the timeout parameter is not specified for the MetaMapImpl, it is set to 0, so the instance interprets any latency as failure and reports an error.
Increase the timeout to a reasonable value (for me 500 msec was enough).
I was getting this error after getting error SPIO_E_TOO_MANY_OPEN_FILES and losing the connection to the mmserver. I was tryig to construct instances of MetaMapApiImpl in a loop and calling processCitationsFromString for thousands of times. Therefore, I was getting error SPIO_E_TOO_MANY_OPEN_FILES after around a hundred repeats.
What I did to fix this error was to simply disconnect the api at the end of the loop, by calling the function disconnect().

Too many open files even after setting kern.maxfiles

I have set the
kern.maxfiles=65536
kern.maxfilesperproc=65536
After this, I put the following command in my .zshrc file
ulimit -n 30000
However, if I try to run a netty based application from eclipse, only 10k sockets open and then java IO exception "too many open files" occurs. Folowing is the stacktrace.
java.io.IOException: Too many open files
at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:422)
at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:250)
at io.netty.channel.socket.nio.NioServerSocketChannel.doReadMessages(NioServerSocketChannel.java:135)
at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:68)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:510)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:467)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:381)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:834)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
at java.lang.Thread.run(Thread.java:745)
I use the following command to check the number of open files/sockets being used by my server and it always shows a value slightly more that 10k when the exception occurs.
lsof -p <pid> | wc -l
Increase your file descriptor value to achieve. You are setting values to "65536" but invoking only 30000 by adding in your shell
Please change the values then reload the bash, either by su - in current session or open the new terminal/session, then restart your application. It must work
You can set the ulimit with the help of following link.
https://vasnlinux.wordpress.com/2015/05/01/linux-server-hardening/

Websphere won't start

I keep getting the following error on my IBM Websphere server
[4/22/15 16:20:35:203 EDT] 00000000 AdminTool A ADMU0111E: Program exiting with error: java.lang.NullPointerException
at com.ibm.ws.management.launcher.LaunchCommand.processDefaultJvmOptions(LaunchCommand.java:1246)
at com.ibm.ws.management.launcher.LaunchCommand.setParamsFromJavaProcessDef(LaunchCommand.java:1200)
at com.ibm.ws.management.launcher.LaunchCommand.setParamsFromProcessDef(LaunchCommand.java:617)
at com.ibm.ws.management.launcher.LaunchCommand.init(LaunchCommand.java:362)
at com.ibm.ws.management.launcher.LaunchCommand.<init>(LaunchCommand.java:262)
at com.ibm.ws.management.tools.WsServerLauncher.initializeRepositoryAndLauncher(WsServerLauncher.java:424)
at com.ibm.ws.management.tools.WsServerLauncher.runTool(WsServerLauncher.java:279)
at com.ibm.ws.management.tools.AdminTool.executeUtility(AdminTool.java:269)
at com.ibm.ws.management.tools.WsServerController.executeUtilityOnWindows(WsServerController.java:136)
at com.ibm.ws.management.tools.WsServerLauncher.main(WsServerLauncher.java:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:274)
I have been to numerous forums and cannot seem to find an up to date answer.
I know I have to run some sort of command. I am on Windows 7 so what is the command I am supposed to run to fix this and can I run this command in the Windows command prompt.
This exception is sometimes caused by corrupt serverindex.xml or server.xml files. Check for any of them that may be 0 bytes and restore from backup. If you don't have a backup creating a new profile will restore them.
If you find the serverindex.xml is having some size for it, check if the serverindex.xml file is corrupted by opening it using Notepad ++ or similar tool. The file you need to refer is: \config\cells\Node01Cell\nodes\Node01.
If there are no backups, it is possible to use one of the temp file from \wstemp\anonymous1493784328013\workspace\cells\Node01Cell\nodes\Node01
Hope it helps anyone having similar issues.

WSO2 Governance Registry lock error

After installation of WSO2 Governance Registry and starting it I get the following errors in wso2carbon.log:
TID: [0] [Greg] [2014-01-08 10:39:08,625] WARN {java.util.prefs.FileSystemPreferences} - Could not lock System prefs.Unix error code 0. {java.util.prefs.FileSystemPreferences}
TID: [0] [Greg] [2014-01-08 10:39:08,625] WARN {java.util.prefs.FileSystemPreferences} - Couldn't flush system prefs: java.util.prefs.BackingStoreException: Couldn't get file lock. {java.util.prefs.FileSystemPreferences}
These errors get repeated every 30s. Unfortunately the log does not specify which file it's trying to lock.
I tried finding all files on the filesystem with exclusive locks on them using find /opt/wso2 -type f -exec lsof {} \; | grep W but I couldn't find any. Also I tried grepping through the WSO2 GR source code, but no where I could find a reference to this error. There is a bug reported on the WSO2 Jira (https://wso2.org/jira/browse/REGISTRY-1863), but that wasn't helpful either.
Can anyone point me in the right direction or give any clues as to where to get more information?
We found that this is a bug in the Java installation manual. It seems the JVM needs write access to the /etc/.java/.systemPrefs directory, which it cannot access when run as a non-root user, see: http://bugs.java.com/view_bug.do?bug_id=4838770
I solved this problem by changing ownership of the /etc/.java/.systemPrefs directory to wso2:wso2 using
sudo chown -R wso2:wso2 /etc/.java/.systemPrefs
The file will still be writable by root (as root can write to any file), but if you need multiple users to be able to write to this file you might set up a file ACL as well using:
sudo setfacl -R -m u:wso2:rw /etc/.java/.systemPrefs
Or see the following link:
https://groups.google.com/forum/#!topic/xnat_discussion/uOd-YyuBhCQ
and set up the files with root user just once...

Categories