Not able to in initiating x11, java handling error - java

I have a Solaris-10 non global zone. I am using MobaXterm. I login on box with root and then "su - caddrd" and then "/usr/local/bin/sudo -u cadwebppc /cad/envs/qa-cm/cadwccDomain/ucm/cs/bin/UserAdmin". This is supposed to open a GUI console, but it is failing and I am not able to figure out. Can somebody help on this ?
It gives me error -
No X11 DISPLAY variable was set, but this program performed an operation which requires it
Update - I am refining this question more. I am able to run xclock via root, via caddrd and via cadwebppc also. But when I am using it with sudo, it is giving error. So it seems something like, having issue with passing variables.

Try to set DISPLAY variable. If you are on the main display this command should do:
export DISPLAY=:0.0

I found this link to be helpful:
http://www.snapdba.com/2013/02/ssh-x-11-forwarding-and-magic-cookies/
When switching to my oracle user (or in your case caddrd) the X11 forwarding information is lost. You can use xauth to copy it to the user's .Xauthority file
So, as root do:
echo xauth add xauth list ${DISPLAY#localhost}
copy this command, sudo to your user and execute this command there.

Related

Running example command for dcmqrscp in dcm4che, what file is not found?

I tried running the example command on Mac from the command line, but it fails to run. I'm wondering what file is not found. My desktop directory does, in fact, exist. Am I missing some configuration or something?
I just downloaded all the dcm4che-5.12.0 code and sample scripts and executed the command from the example when using the --help option.
The example command is what I tried, and is shown in the attached screenshot. I'm not sure what is missing, and it's not exactly clear.
Any guidance will be appreciated, thanks!
According to the documentation, you have to provide a file and not a directory name to the --dicomdir option (with two "-" by the way):
--dicomdir <file> specify path to a DICOMDIR file of
a DICOM File-set into which
received objects are stored and
from which requested objects are
retrieved
Actually, the example from the documentation reads as follows:
Example: dcmqrscp -b DCMQRSCP:11112 --dicomdir /media/cdrom/DICOMDIR
=> Starts server listening on port 11112, accepting association requests
with DCMQRSCP as called AE title.

websphere - CWWKE0054E error unable to open file

i am trying run the websphere liberty profile server from the command line. I am following the steps told here : https://developer.ibm.com/wasdev/downloads/liberty-profile-using-non-eclipse-environments/
I have created the server with the name server1.
But when the extraction completes and I try to start the server using the command : server start server1
the server throws an error : CWWKE0054E: Unable to open file C:\wlp\wlp\usr\servers\server1\logs\C:\Users\Furquan\AppData\Local\Temp\\ihp_custom_batches.log.. Now I know this cant be a valid path, but I dont know where and how to change it. Please help !!
This error is related to the LOG_FILE environment variable that you have defined in your environment by some other program. To solve that, you have the following opions:
Remove LOG_FILE env variable, if it is no longer needed by your system
If you cant do that, override it via server.env file, that you can create in the wlp\usr\servers\serverName directory with the following content:
LOG_FILE=console.log
As last resort (this is not recommended, will make your installation NOT SUPPORTED and in certain installations might get overwritten by updates) - modify the server.bat command line script - in the script find the following section:
if not defined LOG_FILE (
set X_LOG_FILE=console.log
) else (
set X_LOG_FILE=!LOG_FILE!
)
And after the line set X_LOG_FILE=!LOG_FILE! just add another line that will override it with the default like this set X_LOG_FILE=console.log
In general, I'd recommend second solution (with the server.env file), as it is the most portable and will work in any environment.
I have the similar problem for IBM Support Assistant V5. After I deleted %LOG_FILE% from Environment Variables, it worked.

Starting Mule for remote debugging without modifying wrapper.conf

I'm stuck on Mule version 3.4.0 due to requirements at work. I'm writing a service script to manage the service lifecycle of Mule and would really like to be able to have it hang and wait for a debugger to connect based on whether a certain option is present in the parameters.
I'm comfortable with Bash and implementing this, but I'm having an extremely hard time trying to get Mule to pass along the
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9989
to the underlying Java process, as it uses its own (stupid) wrapper to address Java.
I'm trying to modify the bin/mule script to have a mode called debug which will pass the above debugger options to the JVM when invoked with:
bin/mule debug
My current work can be found here on PasteBin, and here is the relevant part near line 511:
debug() {
echo "Debugging $APP_LONG_NAME..."
getpid
if [ "X$pid" = "X" ]
then
# The string passed to eval must handle spaces in paths correctly.
COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=$APP_NAME wrapper.pidfile=\"$PIDFILE\" $ANCHORPROP $LOCKPROP"
######################################################################
# Customized for Mule
######################################################################
echo "command line: $COMMAND_LINE"
echo "mule opts: $MULE_OPTS"
echo "JPDA_OPTS: $JPDA_OPTS"
eval $COMMAND_LINE $JPDA_OPTS $MULE_OPTS
######################################################################
else
echo "$APP_LONG_NAME is already running."
exit 1
fi
}
I cannot upgrade to a newer version of Mule. I need to find a way to modify this script to simply wait for a debugger when invoked with bin/mule debug. I've modified it enough to get into this debug function I've defined which is basically a copy of their own console function for starting in console mode. I can't seem to figure out how to get my debug opts passed to the JVM. Any ideas?
The parameter -debug, following documentation, was present in 3.4.x:
./mule -debug
Give it a try.

java.io.IOException: The system cannot find the path specified

On a particular server (Windows 2012 server R2) I am having trouble creating a temp file. I get the following error everytime I try.
java.io.IOException: The system cannot find the path specified
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createTempFile(Unknown Source)
etc..
The error happens everytime the following code is ran:
InputStream inputStream = portalBean.createPDF( sessionID, foCode );
Things I have tried
Changed the java.io.tmpdir variable on the fly. System.setProperty("java.io.tmpdir", "C:\\");
Added -Djava.io.tmpdir=c:\\temp to the webnetwork lax file to an unrestricted location.
I tried setting the webNetwork service to run as a specified user with rights to temp files e.g. the Administrator.
Made sure I have free disk space and I cleaned out the c:\windows\temp folder.
Made sure the tmp environment variables were set to their default values.
I also tried running the service from a command prompt which was opened with the Run As Administrator option.
And the IOException lingers still. I have another server running the same code without issue (Windows Server 2012).
Does anyone else have any Ideas of what else I can try to resolve this issue? And or any tips on how I can debug the issue more thoroughly to get a grasp of what is going on?
One tool you can use to debug this is process monitor from system internal tool kit. The step is: add a filter to only monitor your process (I think it is javaw.exe in your case), after the error happens, go through the file activities in the process monitor log, you can find how the process is finding files and which directories the process searched. If the process is searching in the wrong directory, you can find it from the log.
I just used this tool to figure out a JVM crash problem today.
Based on the description of your problem, I guess the path variable of the process is changed in the middle of your code, with another tool process explore you can view the path variable of the process, it might help.
Try and create instead a directory somewhere under your home directory:
final Path tmpdir = Paths.get(System.getProperty("user.home"), "tmp");
Files.createDirectories(tmpdir);
System.setProperty("java.io.tmpdir", tmpdir.toAbsolutePath().toString());
Then try and Files.createTempFile() in there.
Note that if Files.createDirectories() refers to an existing file which is not a directory, you'll get a FileAlreadyExistsException.

PHP - Error installing JavaBridge.war

I'm trying to install JavaBridge as I want to make connections between my php files and Java files.
I need my php request a GET method to Java file, and Java file will get the ID and run some script and return with an ARRAY.
I tried to install JavaBridge, but I get errors while trying to excess to localhost:8080/JavaBridge
javax.servlet.ServletException: php.java.bridge.http.FCGIConnectException: Could not connect to server
php.java.bridge.http.FCGIConnectException: Could not connect to server
java.io.IOException: File \\.\pipe\C:\apache-tomcat-7.0.39\temp\JavaBridge939398813756155712.socket not writable
java.io.IOException: PHP not found. Please install php-cgi. PHP test command was: [php-cgi, -v]
I didn't show out all the errors here, I showed only the first line of each root cause.
I will give more details in my setup.
I'm using XAMPP all the time, with PHP, MySQL in the XAMPP.
Then I just installed Tomcat inorder to install JavaBridge.
I copied JavaBridge.war into c:/tomcats/webapps, copied JavaBridge.jar and php-servlet.jar into c:/tomcats/lib
I assume the problems should lies with the PHP, but I don't know how to fix it as well.
Install PHP again? but I'm not sure too.
Whats the problem with my setup?
Or is there others way to make connections between PHP and Java as what I stated above?
Thank you.
Have you enabled php-cgi?
Here's how u can do it. Go to: xampp\apache\conf\extra\httpd-xampp.conf and uncomment this:
<FilesMatch "\.php$">
SetHandler application/x-httpd-php-cgi
</FilesMatch>
<IfModule actions_module>
Action application/x-httpd-php-cgi "/php-cgi/php-cgi.exe"
</IfModule>
Restart Apache & Tomcat.

Categories

Resources