error in opening jar file rt.jar jdeveloper Oracle Middleware - java

I'm developing a project with web services in JAVA, in JDEV.
I'm using Oracle Middleware and I am getting this error when trying to run every time:
Error occurred during initialization of VM
java/lang/ClassNotFoundException: error in opening JAR file C:\Oracle\Middleware\Oracle_Home\oracle_common\jdk\jre\lib\rt.jar
Process exited with exit code 1.
I've found people with the same issue, but apparently no fix so far:
https://community.oracle.com/thread/3783771?start=0&tstart=0
My workaround is to copy and paste the .jar in my local project folder.
But is pretty annoying to do this everytime I want to run.
It works after doing it, so I'm sticking to that for now.
I'm using Windows and my app does not "crash" when running in a Web Logic Server so I'm thinking is something in my laptop.
The .jar is fine, and is not 0kb.

Modify access control of the rt.jar file in windows.
Give full control to the windows logged in user.

Related

Generating executable file in IntelliJ for Windows

I used to work on an IntelliJ project that was started before I started working on it. This project had a configuration that allowed me to generate an EXE file that could easily be sent to windows users.
It would generate a massive EXE file bundled with all the needed JARs of the application, and upon running it the first time, it would silently "install" itself into the AppData folder, as if it were a regular windows setup file, even though the user would not even notice it doing that installation.
I am trying to configure a project in IntelliJ to do the exact same thing, but first I have not been able to output the exe file by selecting "exe" as the Java FX native bundle type. It just generates a .jnlp and .jar file. When I select "all", as per some other post here in stackoverflow, it generates an exe file, but only with a few kb in size, which does not contain any of the .jar files that should be part of it. Moreover, when I try to open it, it just crashes saying the main class was not found.
Am I missing some setting for building the project? I am using IntelliJ 2018.3.2
Here are some screenshots:
I have been able to get past this error, after changing the verbosity of the compilation and going through the logs.
There was a log message which helped fixing this:
The process complained about the Inno Setup Compiler missing, which was right. Makes me wonder why IntelliJ would have that feature built in if it depends on external tools but does not notify the user clearly of this.
Detected [iscc.exe] version 0.0 but version 5.0 is required.
After going to the Inno Setup site, downloading and installing the tool, I was able to get the executable to be generated.
Now I am struggling with another error, which is the executable complaining about the main class referenced in the Artifact not being found, but at least I have moved past the first problem! Going to tackle this one now...
The best solution for this is using exe generator software.
There is plenty of exe generators out there.
EXE4J is the most simple & easy tool to use.
In EXE4J,
You can upload your main jar file and select the main class.
I think this will be solved your problem.
This may be due to you`ve extracted Jars to your output root, while you neet to Put it(you can check difference by deleting everything from your output root in Output Layout screen and then just right click on jar on the right side, you will see two options here, try another one

netbeans remote debugger out of sync

I am trying to use NetBeans 8.0.2 on win7 to debug a java web app on a remote Linux server. The source code is developed on win7 and committed to subversion. On the Linux server I checkout the code from svn and build with maven after first doing a clean. I deploy the .war file to a glassfish server and then attach the debugger and set a breakpoint in NB. I run the web app in Firefox and the debugger stops properly at the breakpoint. Then I "step into" F7 the code but it jumps to a location that is off by about 4 lines of where it is supposed to hit. After that it starts jumping off to even stranger locations and the code I want to study never gets hit. I have made sure the source code on both wind7 and Linux are the same. Any ideas why it seems to be out of sync?
The problem turned out to be that the same but older class was located in a jar file in the glassfish startup library. That's why it didn't show up when I searched for the class name. This web app uses a custom realm and hence needed the class earlier during glassfish initialization. Man I hate inheriting difficult stuff like this with no documentation!

Eclipse can't delete lib.jar

When I try to clean my projects I am now getting two errors that stops the build process...
Could not delete: D:\myworkspace\library\bin\library.jar.
Could not delete 'D:\myworkspace\google-play-services_lib\bin\google-play-services_lib.jar'.
I am running Eclipse as administrator on my Windows 7 computer.
I have been updating all of my libraries recently in order to use Google Cloud Messaging but I have no idea if this has anything to do with it.
If I delete the jar files manually, then start eclipse and clean it will run ok. But now I need to do this anytime I want to recompile.
I have googled this error but I can't find anything on it.
Thanks,
Gary
When you get the error in Eclipse, try using Process Explorer or similar tool to try to determine what running process is holding on to that file.

Executable jar file won't run on centOS

I want to execute a little java program I wrote on my server running centOS and having the jdk1.7.0_10 running.
When logging onto the server with PuTTy, i navigate into the folder containing my eclipse generated runnable jar file jbtct.jar and try to launch it using the Command java -jar jbtct.jar.
But instead of launching, my putty session would just get stuck with nothing happening and The log files my Program should create won't come up as well.
I have a tomcat with applications running on the same server working quite well, so I guess it's some kind of config error. But what kind?
Alright, I solved the Problem! Eclipse may generated the runnable jar, but the Manifest files weren't set up properly as I was using maven to manage my dependencies.
The Solution was to add some code to the plugin management as described here (Posted by mike)

NetBeans - Java EE server classpath is not correctly set up - server home directory is missing error

I am getting an error when I try to build my project in NetBeans. I am using JBoss 5.1.0 server and have attached that to my project. The error is -
The following error occurred while executing this line:
.../myPath/build-impl.xml:176: The Java EE server classpath is not correctly set up - server home directory is missing.
Either open the project in the IDE and assign the server or setup the server classpath manually.
For example like this:
ant -Dj2ee.server.home=<app_server_installation_directory>
I am using Mac OS X Lion.
I was missing a library. When I right clicked the project and went to libraries, it showed me library missing. I added the library and did a clean and build and the error disappeared
Clean builds did not help me, either. I took a look at project.properties and found that j2ee.server.home was not set anywhere, although j2ee.platform.classpath depends on it.
I do have Weblogic Server set up under /home (on a Linux machine).
So, I closed the project and added a line to project.properties:
j2ee.server.home=/home/blister/wls/wlserver
(where wlserver = the server name)
And reopened the project. Presto, the app now builds. It still doesn't know where the app server is, but at least I can built my jar and can worry about deploying it later. (I tell it to build a war which deploys nicely to Weblogic.)
If you are using netBeans Ide, then right click on the project. click properties. in the properties menu select Run. in that the first text box is server. There select the server. with which u want to run the project. If the server details are not configured before. configure server details and try. it wil help you to solve the above problem.
This worked for me.
Right click on the Project -> Properties -> Run
And Change the server Setting from the current server to another sever and click OK.
Wait for any background scanning to finish.
Repeat the processes 1 to 3 again this time selecting the actual server you want to run the code on.
Then try Re-Running your application.
I also had this error. However despite adding servers in the Run section of the Properties window, repeatedly no servers showed as being available to add to the Project ( again within the Run section ). The solution to being able to see a server in this server list was to run Netbeans as an admin ( which I saw Rotunba referencing in this thread..It was then possible to add a server and the project built successfully..
I solved it like this, I added in the ANT properties field
"j2ee.server.home=http://localhost/"
tolls>options>java>Ant
this in linux netbeans
It could also be as simple as not running your IDE i.e. netbeans as an administrator on your machine. I had the same problem. Wasted some time.

Categories