I had a problem a couple of days ago where I was getting a Permission denied: connect when using Javamail to send an e-mail using our local mail server. For reference it can be found here: JavaMail API to iMail -- java.net.SocketException: Permission denied: connect. The solution was to add "-Djava.net.preferIPv4Stack=true" to my project's VM Options.
I'm getting the same error codes after building the project and trying to run the .jar file outside of NetBeans. The project works as intended from inside the NetBeans IDE.
I have searched around the questions here, Google, and read through some Javamail FAQs. To be honest, I really don't know what I am looking for and figure that I am just missing something.
I'm using NetBeans 7.2, Java 7, and Windows 7. The dist folder for my project has the .jar file and the dist\lib folder contains mail.jar.
Any ideas on why I would be getting that error again? Thank you again for any help/information.
How are you running your program?
If you run it with "java -jar myprog.jar", use "java -Djava.net.preferIPv4Stack=tru -jar myprog.jar".
If you run it by double clicking the jar file or something like that, you might need to set the property in your code, by adding System.setProperty("java.net.preferIPv4Stack", "true");
Related
I am using Eclipse Luna, and I am trying to import a project from github. However, it says "Internal error; consult Eclipse error log" when I pasted the URI in:
The project is valid. I've tried a few projects, and they all worked on my older Juno version of eclipse, but all failed on Luna, just like above. What should I do to reproduce this problem?
Here is my Eclipse log error: http://pastebin.com/QcfF4Xsq
I solved this problem going to "Preferences > General > Security > Secure Storage > Contents", open "[Default Secure Storage]", deleting the "GIT" row and finally restarting Eclipse.
You have a similar error message with other Eclipse-based products, like RTC:
A summary of the problem is that Eclipse uses a default location on your machine that is the same for all your Eclipse installs.
So if you have installed and used 32-bit Eclipse, then your secure storage requires the 32-bit plugins to access.
When you try to use a 64-bit Eclipse, it will try to read that secure storage and will fail because it is using the 64-bit plugins to read the storage.
The solution is to tell your Eclipse to use a different secure storage area. You can do this by running Eclipse with the following option:
-eclipse.keyring <file_path>
where <file_path> is the location of the file which you wish to use as your new secure storage area.
(You can check by the way if you have a consistent Eclipse distribution: all 32 bits or all 64 bits)
Note that another product (NetBeans) resolved the same error message like so (issue 211863)
I found the problem.
NetBeans is detecting a remnant of an Eclipse IDE installation. Once I deleted the file, the errors in the log went away.
C:\Documents and Settings\ttroy\.eclipse\org.eclipse.equinox.security\secure_storage
On Windows 7 or more:
C:\Users\<username>\.eclipse\org.eclipse.equinox.security\secure_storage
# or
%USERPROFILE%\.eclipse\org.eclipse.equinox.security\secure_storage
Delete C:\Users\USERNAME\.eclipse\org.eclipse.equinox.security\secure_storage it will resolve your problem.
This is the message I see in the eclipse Error log.
Secure storage was unable to retrieve the master password from the OS keyring. Make sure that this application has access to the OS keyring. If the error persists, the password recovery feature could be used, or secure storage can be deleted and re-created.
So as others said if you delete the secure_storage file and it should solve the problem.
On a mac, better use command line.
/Users/< userid >/.eclipse/org.eclipse.equinox.security
For the last couple of hours, I'm desperately trying to configure apache tomcat6 in Eclipse, and I'm having some difficulties.
I tried everything I could find online, including several posts here in Stack Overflow (most of the problems I found wasn't exactly like mine).
Initially, I followed this tutorial, and after installing tomcat6 like this:
sudo apt-get install tomcat6-common
sudo apt-get install tomcat6
and making sure that the server is running.
Next, I followed the mentioned tutorial, and everything was fine, until I got to stage 5.4 in the tutorial: "Start Server".
When I click Start, I get the following error:
As I said, I tried to look online for an answer, but nothing seems to help...
Does anyone know why am I getting this error and how can I fix this?
This might be a long-shot but do you have correct permissions for the folder where the config file is located?
try to follow the steps mentioned in below link
clipse-could-not-load-the-tomcat-server-configuration
1)Close Eclipse
2)Copy all files from TOMCAT_6_HOME/conf to WORKSPACE_FOLDER/Servers/Tomcat v6.0 Server at localhost-config
3)Start Eclipse
4) Expand the Servers project, click on the Tomcat 6 project and hit F5
5) Start Tomcat from Eclipse
Try to start the server using terminal and then try in eclipse. go to /bin/ execute the command startup.sh. try this.
if you still got error. Execute this configtest.sh will provide you the proper error.
Then try set Classpath for your server. can be done using setclasspath.sh
I was able to solve it, after 3 and a half hours of trying...
Apparently, when I installed tomcat from the command line (sudo-apt-get etc) the /usr/share/tomcat6 folder (the default installation path) was missing some files, including this /conf folder, which required for Eclipse (hence the error message).
But when I removed it, and download tomcat as a tar.gz file from here, and extracted it, it somehow contains more files in it, including the /conf folder.
So then in Eclipse I created a new Server, and provided the path of the new extracted folder, instead of the previous /usr/share/tomcat.
This did the trick.
How to rectify module deployment error while using GlassFish Server?
While trying to run jsf web-application in Netbeans8 I am getting the following error:
ant -f C:\\Users\\admin\\Desktop\\WebTime -Dnb.internal.action.name=run -Ddirectory.deployment.supported=true -DforceRedeploy=false -Dnb.wait.for.caches=true -Dbrowser.context=C:\\Users\\admin\\Desktop\\WebTime run
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
Starting GlassFish Server
GlassFish Server is running.
In-place deployment at C:\Users\admin\Desktop\WebTime\build\web
GlassFish Server, deploy, Connection refused: connect, false
C:\Users\admin\Desktop\WebTime\nbproject\build-impl.xml:1045: The module has not been deployed. See the server log for details.
Being new to programming, I need hint to rectify this error. Kindly help me to rectify it.
The line:
GlassFish Server, deploy, Connection refused: connect, false
... is a clue.
I had the same error, but I solved it. The steps:
1) Grant privileges to write on the glassfish server installation folder. If you use Windows the path is:
C:\Program Files\glassfish-xx
2) Run C:\Program Files\glassfish-xx\bin\asadmin.bat as Administrator. Then in the console type: start-domain
3) Clean and Build the project
4) Deploy
5) Run
PD: I recommend use JDK7
after a whole day solving this problem on my own, because nobody's answer was usefull for me on internet, I found following:
don't try to use different web server (I tried wildfly), it wont
help.
give glassfish folder permission to write (I mean the folder with
version in name)
restart pc to shut down all (or the) running server
after my restart, I got still the same error during developing build-impl.xml:1045: The module has not been deployed., but now there was different error in server log - java.lang.IllegalArgumentException: Invalid URL Pattern: [{0}].
Then I realised that my problem was in web.xml file, where I tried to set different welcome page. All other projects with this file untouched were working (developing, running) properly
so this was my story of waisting whole day - check your web.xml file
Being new to programming, I need hint to rectify this error. Kindly
help me to rectify it.
If you look carefully, the hint is given in the output itself.
See the server log for details.
In NetBeans IDE output's sub-window, you should see another tab called "GlassFish Server", you can look there for logs from the server.
Alternatively , you can use GlassFish's Administration GUI to see some more detailed logs, it is accessible in a browser and by default from localhost:4848.
While trying to run jsf web-application in Netbeans8 I am getting the
following error:
Looking at what you have posted (project's deployment log), I can say your GlassFish instance is running fine , but your project contains errors, so it couldn't be deployed.
I doubt anyone here can concretely solve your problem because we need more details from GlassFish's logs.
Suggestion : Edit your question by appending GlassFish's logs.
Setup
I'm using Netbeans 7.4 on Mac OSX Mavericks and Glassfish 4.0 (build 89) on my dedicated server and JDK 1.7. To use the server locally I setup and ssh-tunnel. The following way:
ssh -L 4848:127.0.0.1:4848 -p 6122 glassfish#XXXXXXXXXX
This is working perfectly fine, I can access the server via localhost without any problems. To use this server I added a server in Netbeans, see prinscreen:
Problem
Now I'd like to deploy the project to the server (Right-Click Project -> Deploy) but I get following Error:
Building jar: /Users/tzhware7/NetBeansProjects/SkyLogicAddon/dist/SkyLogicAddon.war
Distributing /Users/tzhware7/NetBeansProjects/SkyLogicAddon/dist/SkyLogicAddon.war to [glassfish.ivo]
glassfish.ivo, deploy, null, false
/Users/tzhware7/NetBeansProjects/SkyLogicAddon/nbproject/build-impl.xml:1050: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 1 second)
Now I'd checked the line where the Error-Show's up, which is following (1049-1051). For me everything looks normal:
<target if="netbeans.home" name="-run-deploy-nb">
<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
</target>
In advance I checked the serverlogs, which are empty - no error is shown. What am I doing wrong? Can someone advice me what to change? Thank you in advance!
Edit 1 - 08.01.2014
Allright, I didn't found a solution for solving the problem above, but following way worked at least to deploy the app manually.
Netbeans -> Right-Click on Project -> Clean/Build (now check your outputlog where it save's the project.
Now go to that path, you'll shoud find a .war file
Log into your glassfish-server -> Click Application's -> Click deploy -> upload the .war file -> Click again deploy
Now glassfish deploys the project for you. :)
Edit 2 - 17.01.2014
I could fix the problem, following was wrong. In netbeans I configured that the Target should be domain1, if you do this, it won't work. Let the target be empty, and everything works fine.
Thank you Tim B for your help!
If NetBeans can't talk to the server when you add it to the list then it silently fails. The server appears in the list but you can't click on the + and expand it out to see what it contains.
Check in your server list that NetBeans can actually see the server. Also keep in mind that NetBeans needs access to the admin port (usually 4848) not the normal web one, although it looks like your tunnel is correct for that.
You also need to turn on remote administration and set up the username and password etc. Try pointing a web browser to your localhost 6122 and check you can log in to the admin panel using the same username and password that netbeans is using.
To turn on remote administration:
https://blogs.oracle.com/quinn/entry/securing_adminstration_in_glassfish_server1
asadmin enable-secure-admin
You will also need to add an administrator username and password.
Would someone please be able to explain to me how to properly install JavaMail and have it to execute in Eclipse please.
I have been trying for the past few hours and I am completely lost as to why this is.
This is from trying to execute their demo projects msgsend.java and msgshow.java.
I either find an error message stating invalid protocol or could not connecto to SMTP host: localhost, port 25;
What I suggest.
Open Eclipse
Create a new Java project
Create a new Java class which contains a main method (entry point)
Create a folder "libs" inside which you put your JavaMail jar library and other external dependencies
Right-click (from within eclipse) on the added JavaMail jar file and choose Build path and add to build path.
Now you project should be ok in terms of dependencies and you can start coding your test logic within your main method or other classes you create
Once coded, Run your project, by right-clicking on the class which represents your app's entry point and select Run and run as Java application
(That's all I can provide given the details in your question ;) )
If you're running the examples and it's using "localhost:25" as the server, you'll need to have an SMTP server running on the same machine.
If you don't have a local SMTP server, then try replacing "localhost" with the SMTP server hostname that your ISP provides you.
If you are getting an exception being thrown which is stating that it could not correct to an SMTP host (it may be helpful if you posted the exact error) that means that Javamail is correctly installed in your classpath but that it could not find the given SMTP host.
Keep in mind that by merely dropping Javamail into Eclipse will not automatically result in an SMTP server running on localhost (aka your own machine).
So, either set up an SMTP server on your machine or just use your ISP's server for test purposes.
I would suggest the later, but if you are interested in the former, you may want to check out:
http://www.ericdaugherty.com/java/mailserver/
It includes an Eclipse plugin.