FitNesse throws FileNotFoundException - java

I have downloaded fitnesse-standalone.jar, and tried to run using below command
java -jar fitnesse-standalone.jar
Unfortunately I am getting below exception,
C:\Program Files (x86)\Java\jdk1.6.0_14\bin>java -jar fitnesse-standalone.jar
Mar 18, 2014 4:16:54 PM fitnesse.ConfigurationParameter loadProperties
INFO: No configuration file found (C:\Program Files (x86)\Java\jdk1.6.0_14\bin\p
lugins.properties)
root page: fitnesse.wiki.fs.FileSystemPage at ./FitNesseRoot
logger: none
authenticator: fitnesse.authentication.PromiscuousAuthenticator
page factory: fitnesse.html.template.PageFactory
page theme: fitnesse_straight
Starting FitNesse on port: 80
Exception in thread "main" java.io.FileNotFoundException: .\FitNesseRoot\updateL
ist (The system cannot find the path specified)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
at fitnesse.updates.FileUpdate.copyResource(FileUpdate.java:45)
at fitnesse.updates.FileUpdate.doUpdate(FileUpdate.java:31)
at fitnesse.updates.UpdaterImplementation.getUpdateFilesFromJarFile(Upda
terImplementation.java:71)
at fitnesse.updates.UpdaterImplementation.createUpdateAndDoNotCopyOverLi
sts(UpdaterImplementation.java:62)
at fitnesse.updates.UpdaterImplementation.<init>(UpdaterImplementation.j
ava:21)
at fitnesseMain.FitNesseMain.update(FitNesseMain.java:66)
at fitnesseMain.FitNesseMain.launchFitNesse(FitNesseMain.java:59)
at fitnesseMain.FitNesseMain.launchFitNesse(FitNesseMain.java:48)
at fitnesseMain.FitNesseMain.main(FitNesseMain.java:32)
Please help!
Regards
Rajib

You need to point to the directory where the fitnesse-standalone jar is located in. Also, there's is a good chance that port 80 is already being used. Therefore, try using a different port using the -p option in that case.
Example: -jar C:/fitnesse-standalone.jar -p 8081

You may want to run java -jar fitnesse-standalone.jar from the directory where you copied a file fitnesse-standalone.jar.
To avoid an error of running java you need to add java folder to the environment variables.

Related

Netbeans set root as author

I'm running Linux Mint 18.3 cinnamon 64 bits
I just downloaded Apache NetBeans IDE 9.0
It wasn't necessary to run any script to install it, i just had to run the following command to launch it: sudo /opt/netbeans/bin/netbeans
Then enter my password and netbeans opens.
Then i made a launcher for the program because i didn't want to type the command and my password every time i open netbeans.
But the launcher didn't worked.
I realize that i didn't put "sudo" in the command that the launcher would execute so i put it. And didn't work.
I thought that it wasn't working because the launcher executes sudo /opt/netbeans/bin/netbeans but don't put the password.
After some research i end up adding star_man ALL=(ALL) NOPASSWD: /opt/netbeans/bin/netbeans at the end of /etc/sudoers and it finally works. But when i create a new project Netbeans sets root as the author of every file it creates.
For example, when i type ls -l in my project directory it outputs this:
-rw-r--r-- 1 root root 3527 sep 15 20:01 build.xml
-rw-r--r-- 1 root root 82 sep 15 20:01 manifest.mf
drwxr-xr-x 3 root root 4096 sep 15 20:01 nbproject
drwxr-xr-x 3 root root 4096 sep 15 20:01 src
Root is the group and the owner of every file an directory.
This causes that when Netbeans generates documentation files it put "root" instead my username.
Update:
I only can start neatbeans as root (sudo ./netbeans).
when i run neatbean without sudo from the terminal it looks like it's starting:screen shot
but then it closes.
This is the output:
>Log Session: Sunday, September 16, 2018 at 12:58:20 PM Eastern Daylight Time
>System Info:
Product Version = Apache NetBeans IDE 9.0 (Build incubator-netbeans-release-334-on-20180708)
Operating System = Linux version 4.15.0-34-generic running on amd64
Java; VM; Vendor = 10.0.1; Java HotSpot(TM) 64-Bit Server VM 10.0.1+10; Oracle Corporation
Runtime = Java(TM) SE Runtime Environment 10.0.1+10
Java Home = /opt/java/jdk-10.0.1
System Locale; Encoding = es_DO (nb); UTF-8
Home Directory = /home/star_man
Current Directory = /opt/netbeans
User Directory = /home/star_man/.netbeans/9.0
Cache Directory = /home/star_man/.cache/netbeans/9.0
Installation = /opt/netbeans/nb
/opt/netbeans/ide
/opt/netbeans/extide
/opt/netbeans/java
/opt/netbeans/apisupport
/opt/netbeans/websvccommon
/opt/netbeans/profiler
/opt/netbeans/harness
/opt/netbeans/javafx
/opt/netbeans/platform
Boot & Ext. Classpath =
Application Classpath = /opt/netbeans/platform/lib/boot.jar:/opt/netbeans/platform/lib/org-openide-modules.jar:/opt/netbeans/platform/lib/org-openide-util.jar:/opt/netbeans/platform/lib/org-openide-util-lookup.jar:/opt/netbeans/platform/lib/org-openide-util-ui.jar
Startup Classpath = /opt/netbeans/platform/core/core-base.jar:/opt/netbeans/platform/core/org-netbeans-libs-asm.jar:/opt/netbeans/platform/core/asm-all-5.0.1.jar:/opt/netbeans/platform/core/org-openide-filesystems.jar:/opt/netbeans/platform/core/org-openide-filesystems-compat8.jar:/opt/netbeans/platform/core/core.jar:/opt/netbeans/nb/core/org-netbeans-upgrader.jar:/opt/netbeans/nb/core/locale/core_nb.jar
-------------------------------------------------------------------------------
INFO [org.netbeans.modules.netbinox]: Install area set to file:/opt/netbeans/
!SESSION 2018-09-16 12:58:21.698 -----------------------------------------------
eclipse.buildId=unknown
java.version=10.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=es_DO
!ENTRY org.eclipse.osgi 4 0 2018-09-16 12:58:21.706
!MESSAGE Error reading configuration: Permission denied
!STACK 0
java.io.IOException: Permission denied
at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.base/java.io.File.createTempFile(File.java:2090)
at org.eclipse.osgi.storagemanager.StorageManager.initializeInstanceFile(StorageManager.java:188)
at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:708)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initFileManager(BaseStorage.java:226)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initialize(BaseStorage.java:160)
at org.eclipse.osgi.baseadaptor.BaseAdaptor.initializeStorage(BaseAdaptor.java:123)
at org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:192)
at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.internalInit(EquinoxLauncher.java:67)
at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.init(EquinoxLauncher.java:37)
at org.eclipse.osgi.launch.Equinox.init(Equinox.java:178)
at org.netbeans.modules.netbinox.Netbinox.init(Netbinox.java:61)
at org.netbeans.core.netigso.Netigso.prepare(Netigso.java:145)
at org.netbeans.NetigsoHandle.turnOn(NetigsoHandle.java:115)
at org.netbeans.ModuleManager.enable(ModuleManager.java:1331)
at org.netbeans.ModuleManager.enable(ModuleManager.java:1148)
at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:315)
at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:251)
at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:276)
at org.netbeans.core.startup.Main.getModuleSystem(Main.java:156)
at org.netbeans.core.startup.Main.getModuleSystem(Main.java:125)
at org.netbeans.core.startup.Main.start(Main.java:282)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
at java.base/java.lang.Thread.run(Thread.java:844)
java.lang.RuntimeException: Permission denied
at org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:194)
at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.internalInit(EquinoxLauncher.java:67)
at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.init(EquinoxLauncher.java:37)
at org.eclipse.osgi.launch.Equinox.init(Equinox.java:178)
at org.netbeans.modules.netbinox.Netbinox.init(Netbinox.java:61)
at org.netbeans.core.netigso.Netigso.prepare(Netigso.java:145)
at org.netbeans.NetigsoHandle.turnOn(NetigsoHandle.java:115)
at org.netbeans.ModuleManager.enable(ModuleManager.java:1331)
at org.netbeans.ModuleManager.enable(ModuleManager.java:1148)
at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:315)
at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:251)
at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:276)
at org.netbeans.core.startup.Main.getModuleSystem(Main.java:156)
at org.netbeans.core.startup.Main.getModuleSystem(Main.java:125)
at org.netbeans.core.startup.Main.start(Main.java:282)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.io.IOException: Permission denied
at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.base/java.io.File.createTempFile(File.java:2090)
at org.eclipse.osgi.storagemanager.StorageManager.initializeInstanceFile(StorageManager.java:188)
at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:708)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initFileManager(BaseStorage.java:226)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initialize(BaseStorage.java:160)
at org.eclipse.osgi.baseadaptor.BaseAdaptor.initializeStorage(BaseAdaptor.java:123)
at org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:192)
... 16 more
I find out that every file and directory under ~/.netbeans has root as owner and group. I thought that might be the problem so i changed the owner and group with ~/.netbeans $ sudo chown -R myusername: .netbeans/. And still i'm only able to run netbeans as root.
This is a basic unix permissions problem.
For reasons that escape me, you used sudo to launch the netbeans IDE.
- You should not have done that.
- You should not have needed to do that!
When you use sudo to run something, you are typically running as the root user. (That is what sudo does!)
So, naturally, the something (in this case, the netbeans application run using sudo) will create files and directories owned by the "root" user. So when you try to update them as a normal user, the operating system says "Nope: you don't own those files / directories, so you can't modify them.".
Solution: use the chown command to change the ownership of the files and the directories as required.
How? Read man chown, or look for a tutorial on how to change the ownership of a file.
Hint: you will need to use sudo when chowning ...
Hint 2: be very, very careful when you use sudo, because sudo has the power to trash your system if you make a mistake.

KeyStore file is not found in jar, although present in jar

I set the Connector properties as
LOGGER.debug("ksPath=>" + ksPath);
httpsConnector.setAttribute("keystoreFile",ksPath);
httpsConnector.setAttribute("keystorePass", keyStorePass);
httpsConnector.setAttribute("clientAuth", "false");
httpsConnector.setAttribute("sslProtocol", "TLS");
httpsConnector.setAttribute("sslEnabledProtocols", tlsProtocols);
httpsConnector.setAttribute("SSLEnabled", true);
Connector defaultConnector = tomcat.getConnector();
defaultConnector.setRedirectPort(port);
What I see in logs (when it runs)
ksPath=>jar:file:/shn/lp/main-1.0-SNAPSHOT-jar-with-dependencies.jar!/my.keystore
However, the deployment fails and I see logs as
SEVERE: Failed to load keystore type JKS with path /shn/lp/jar:file:/shn/lp/main-1.0-SNAPSHOT-jar-with-dependencies.jar!/my.keystore due to /shn/lp/jar:file:/shn/lp/main-1.0-SNAPSHOT-jar-with-dependencies.jar!/my.keystore (No such file or directory)
java.io.FileNotFoundException: /shn/lp/jar:file:/shn/lp/main-1.0-SNAPSHOT-jar-with-dependencies.jar!/my.keystore (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:413)
at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:319)
at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:577)
at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:517)
at org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:462)
at org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:209)
Observation
jar:file:/shn/lp/main-1.0-SNAPSHOT-jar-with-dependencies.jar!/my.keystore
is different from
/shn/lp/jar:file:/shn/lp/main-1.0-SNAPSHOT-jar-with-dependencies.jar!my.keystore
the latter starts with /shn/lp/
However to assert, I see that the file is infact present in jar
jar -tvf /shn/lp/main-1.0-SNAPSHOT-jar-with-dependencies.jar | grep my.keystore
4704 Tue Jun 09 09:29:26 PDT 2015 my.keystore
What's up with it?
How do I resolve this issue?
Seems it does not understand the protocol, maybe because of the missing leading slash? Have you tried:
String ksPath = this.getClass().getResource("/my.keystore").getFile();

Tomcat home page is not coming properly

After installing Apache tomcat8 I am getting below home page.
I just installed tomcat8, start service and hit url
http://localhost:8080/
I haven't created any project.
It looks to me that the page in your screenshot is being served up by Oracle Application Express (APEX), not Tomcat.
APEX typically uses port 8080, and if you started this before starting Tomcat, Tomcat will be unable to use port 8080. To confirm that this is the case, take a look in your Tomcat stderr log file (it should be under C:\Tomcat 8.0\logs and have a name like tomcat8-stderr.2014-09-21.log). It will quite probably contain an exception whose stacktrace begins as follows:
21-Sep-2014 12:09:15.607 SEVERE [main] org.apache.coyote.AbstractProtocol.init Failed to initialize end point associated with ProtocolHandler ["http-nio-8080"]
java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
I would recommend that you change Tomcat to use another port. To do this, open your server.xml file (in C:\Tomcat 8.0\conf\). There should be a Connector element in here with an attribute port="8080": change this port number to 8081 (say) and restart Tomcat.
Ok, try this
1- Download a tomcat version.
2- unzip it in a folder. (let say C:\Java)
3- open a command prompt window
4- Type C:\Java\ your tomcat installation \bin\startup.bat
5- Access http://localhost:8080
Looks like you have not started tomcat yet.
Are you sure you have followed a guide like this ?

Tomcat is not shutting down

I am unable to shutdown tomcat. When I do ./shutdown.sh, I don't see any error, but the process still seems to be running. When I kill the process (kill -9), the process gets killed. After this, if I do a startup, and shutdown again, I see the same problem. How do I gracefully shut it down? Why is this happening in the first place? Please help me.
devServer:bin dev$ ps -ef|grep tomcat
501 34933 1 0 11:24PM test 0:02.02 /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Djava.util.logging.config.file=/Users/dev/admin/runtime/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/Users/dev/admin/runtime/endorsed -classpath /Users/dev/admin/runtime/bin/bootstrap.jar:/Users/dev/admin/runtime/bin/tomcat-juli.jar -Dcatalina.base=/Users/dev/admin/runtime -Dcatalina.home=/Users/dev/admin/runtime -Djava.io.tmpdir=/Users/dev/admin/runtime/temp org.apache.catalina.startup.Bootstrap start
501 34982 33786 0 11:45PM test 0:00.00 grep tomcat
devServer:bin dev$ ./shutdown.sh
Using CATALINA_BASE: /Users/dev/admin/runtime
Using CATALINA_HOME: /Users/dev/admin/runtime
Using CATALINA_TMPDIR: /Users/dev/admin/runtime/temp
Using JRE_HOME: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Using CLASSPATH: /Users/dev/admin/runtime/bin/bootstrap.jar:/Users/dev/admin/runtime/bin/tomcat-juli.jar
devServer:bin dev$ ps -ef|grep tomcat
501 34933 1 0 11:24PM test 0:02.03 /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Djava.util.logging.config.file=/Users/dev/admin/runtime/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/Users/dev/admin/runtime/endorsed -classpath /Users/dev/admin/runtime/bin/bootstrap.jar:/Users/dev/admin/runtime/bin/tomcat-juli.jar -Dcatalina.base=/Users/dev/admin/runtime -Dcatalina.home=/Users/dev/admin/runtime -Djava.io.tmpdir=/Users/dev/admin/runtime/temp org.apache.catalina.startup.Bootstrap start
501 34992 33786 0 11:45PM test 0:00.00 grep tomcat
devServer:bin dev$
Also, I see my catalina.out is rather too short. There is no port number info getting written to it at all. This is all I see everytime I startup.
Feb 15, 2014 11:24:23 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
Here is my log file -
devServer:logs dev$ cat catalina.2014-02-15.log
Feb 15, 2014 11:24:23 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
Something seems to be terribly messed up. I can't understand what. Please advise.
I am running tomcat 7.0.50 on Mac OS.
Judging by the logs, it is evident that tomcat is not starting up at all as it should be. I can advise a couple of other tests as well like to
Verify whether or not the ports are getting bound by the tomcat service or not. You can do this by issueing the command netstat -tuplen on the terminal and check to see if port 8080 is getting bound by the tomcat instance or not.
Check to see if you can ping the instance. Try to ping the tomcat instance from a local machine. Then try to ping the public ip of the server to verify whether that server is responding correctly or not
Verify that you have, infact, the complete tomcat template as is used by your other servers. Verify the tomcat installtion folder and compare it with the other tomcat templates as used in rest of your servers. Make sure all folders are there, all configuration (default tomcat config) files are present.
(Just a hunch) Verify read/write/execute privileges as well
Remove your application, shutdown tomcat, empty the logs, and then restart tomcat and re-deploy your application and then view the logs to see if you get some error
Point 3 seems more likely that you have an incomplete tomcat instance, so I advise you to make a copy of the tomcat instance used in any other server and use it in this server to make sure that the server environment is infact how it should be

Launching Jade In Ubuntu10.04 Linux

When I run the below command in terminal of ubuntu linux and also I set the ClassPath properly but I wasn't successful.
java jade.Boot -gui
I got following errors in terminal window:
15 Jun, 2011 6:33:10 PM jade.core.Runtime beginContainer
INFO: ----------------------------------
This is JADE snapshot - revision 6357 of 2010/07/06 16:27:34
downloaded in Open Source, under LGPL restrictions,
at http://jade.tilab.com/
----------------------------------------
Retrieving CommandDispatcher for platform null
15 Jun, 2011 6:33:11 PM jade.imtp.leap.CommandDispatcher addICP
WARNING: Error adding ICP jade.imtp.leap.JICP.JICPPeer#ae506e[Error: Not possible to launch JADE on a remote host (127.0.1.1). Check the -host and -local-host options.].
15 Jun, 2011 6:33:11 PM jade.core.AgentContainerImpl joinPlatform
SEVERE: Communication failure while joining agent platform: No ICP active
jade.core.IMTPException: No ICP active
at jade.imtp.leap.LEAPIMTPManager.initialize(LEAPIMTPManager.java:138)
at jade.core.AgentContainerImpl.init(AgentContainerImpl.java:316)
at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:482)
at jade.core.Runtime.createMainContainer(Runtime.java:165)
at jade.Boot.main(Boot.java:89)
15 Jun, 2011 6:33:11 PM jade.core.Runtime$1 run
INFO: JADE is closing down now.
help me to recover from this error.
I am so tired of this problem. It is one of many quirks and problems with JADE.
The problem you are facing is that you need to supply correct host information in the command line. Example
java jade.Boot -gui -local-host
This is all described here: http://jade.tilab.com/doc/tutorials/JADEAdmin/startJade.html
In many cases you don't have this problem and then it is sufficient to use the -gui option only. However I have discovered that Jade does not work very well when your resolves to 127.0.1.1. You can fix this by setting your IP address in or if you are on Linux edit your /etc/hosts file for a more permanent solution.
just type in JADE path..
java -cp lib/jade.jar jade.Boot -gui -local-host 127.0.0.1
(JADE has some problems to set local host adress)
The problem might be is previous java process might be still running on the local port , Make sure to check if port is in use or not if in use kill the java process before you rerun.
It's simple.
Modify /etc/hosts
Modify the line for the address 127.0.0.1, as follows:
127.0.0.1 localhost.localdomain localhost <machine_name>
Remove or comment the line with 127.0.1.1:
# 127.0.1.1 <machine_name>
and you're done.
The error isn't in the jade. It's a bug used by jade to start the default parameters with a bugged java method that should be fixed.
When jade runs the java method, it will retrieve 127.0.1.1 instead the loop-back 127.0.0.1.
I'm saying it because I tested. I read the JADE src that do this and I executed the java method that I didn't remember now.
Unfortunately it's happening in a few linux machines. In windows I didn't see it happens.
What I did to solve this problem was to edit the /etc/hosts file, like this:
Original file:
127.0.0.1 localhost
127.0.1.1 machine-name
Modified file:
127.0.0.1 localhost machine-name
127.0.1.1 machine-name
What I did was to put an alias of the machine-name on the loop-back ip address. This will bypass the bug.

Categories