Resolve missing server in netbeans - netbeans

I use netbeans 8.1 and glassfish 4.0.When I click persistence.xml-design tab,a warning appears like The project does not have the target server properly.Java persistence features are server-dependent ...
So I don't use JPQL on persistence.xml
Any suggestion?

I found a solution for my QUESTION. If the project has a server, you will show your server to your ejb project. ejb projcet->properties->run and define your server.

I was having the same problem but with the little difference that mine was caused by attempting to downgrade glassfish from version 5.0.1 to 5.0. I had deployed my application using 5.0.1 but some issues with the jdbc drive occurred so I need to downgrade to Glassfish 5.0 and then this appears "The project does not have the target server properly... ", I checked the run properties and everything was all right.
In order to solve: first go to "project properties" and then to "Run" in the server option select apply changes, restart netbeans, open again and change the server again to glassfish

Related

GlassFish server fails to launch from eclipse [duplicate]

I am trying to test my web application in GlassFish 4 from eclipse. When I am starting GlassFish 4 with a file (startserv.bat), it works fine, but when I am trying to run it from Eclipse, it starts loading, but then the startup process gets stuck at 69%, on a message Launching Delegate...
After several minutes in that condition, it gives me an error message:
After a few re-tries, I got this message:
Even though nothing is running on the port 8080 (GlassFish's port) and 4848 (GlassFIsh's admin port)
It worked fine for me before, but now for some reason, it just doesn't, I haven't done anything to it's settings or anything. How can I resolve this problem?
Here is my startup console log: http://pastebin.com/XL0Lh5zw (using pastebin to avoid making the post to big)
I had the same problem, with the same messages.
After a long search, I gave up and I removed the server.
And I removed the Server Runtime Environment
The Glassfish files were not removed only the eclipse configurations, and then I re-created the Server Runtime and the Server using the existent glassfish server and the problem was fixed :D.
I got the same issue. I'm using Eclipse Luna.
I downgraded my GlassFish Tools to 7.2 and I got the server started back again.
http://download.oracle.com/otn_software/oepe/12.1.3.1/luna/repository
I didn't see any errors in the log, just some warnings about Hibernate stuff, which shouldn't crash the launch. It could be that it is taking too long to initialize with all of the eclipse overhead, but most likely it could be a locking issue, which could cause the timeout, since eclipse would be left infinitely waiting for a resource it could never obtain. Are you sure the server is only being accessed by eclipse, and is not already running or owned by another process?
I was also getting this issue all the week. But in our team we finally fixed it. It seems that Glassfish needs JDK 8 (not JRE 8 default given entry in Eclipse Luna) so you have to firstly install JDK 8 from Oracle web site and after configure Eclipse to point on it in Windows -> Preference -> Java -> Installed JREs Click on "Add" choose "Standard VM" click on "Next" and use "Directory" button to point on your -freshly installed- JDK8 directory if you didn't change any thing during the installation , on windows it would be "C:\Program Files\Java\jdk1.8.0_20".
Just because Glassfish and Glassfish Tools for Luna need JDK8 to perfectly work.
I had the very same issue with GF 3.1.
When looking into the problem I noticed that in the Eclipse console Glassfish appeared to be still running. I deleted the application using the web console and then I quit Eclipse. I then checked the active Java process (i.e. ps -e | grep java) and noticed an zombie Glassfish process.
Sometimes it happens that Eclipse is not able to startup / shutdown Glassfish correctly, "loosing" a process doing so. Usually killing the zombie process fixes Glassfish and related integration with Eclipse.
Another thing to try in this case is to remove the applications from the Server and remove the server from Servers panel in Eclipse, then adding the server and applications again.
I'm using Eclipse Glassfish 3.1.1, Luna 4.4.1, Java 1.7.0_71, OS X Yosemite.
Changing debug port (properties->glassfish->debug port) to current+1 (eg. from 8008 to 8009) every time it happens makes it work for me.
I'm using eclipse neon 4.6.0 + glassfish 4.1
If any one is still stuck go to your glassfish folder domain > domain1 > config
edit domain.xml change network listener port no. to any other port number.
Restart eclipse and glassfish.
assuming you have glassfish 4.1.1 it worked for me.
I fixed the problem by using Eclipse Neon (4.6) and GlassFish 4.1.1.
Had the same problem, no idea why this happens. Anyway, I deleted Glassfish from Eclipse and had a new GF set up. Worked for me just fine!
Using Eclipse Mars and Glassfish 3.2. I used Eclipse > Help > Check for Updates. Two updates were found and one was Glassfish tools. Allowed the update to do its thing and it seems to have resolved the problem.
Go to below path:
C:\glassfish4\glassfish\domains\domain1\config
Also the path where your server location configured into the eclipse and open domain.xml file.
Find out the 8080 port number and change different port number like 8081...
Save and close the file.
In eclipse:
Remove the added server and add fresh Glashfish server.
Start the server. This will solve the problem.
Same problem here, stuck at 68%.
I find out that it was docker which occupied 8080:80.
If any one who is also using docker:
I do "docker ps"to see which one is using 8080
then i do "docker stop [container id]"and "docker rm [container id]"
then the glassfish sever in eclipse finally launched successfully.

Unable to deploy a JSF project with Eclipse Mars

I've been using Eclipse Kepler with Java 1.7, Glassfish 4 and JSF 2.2 successfully for a while. I've just installed Eclipse Mars, the latest version, and installed Java 1.8_66, and got a simple "Hello World" test to run in the console mode. After downloading Glassfish 4.1.1, the latest version, I set up a simple "Hello World JSF" project, but I'm unable to associate it with the server. On right clicking on the Glassfish server in the server window and selecting "Add and Remove", I keep getting the message:
"There are no resources that can be added or removed from the server."
On right clicking on the project then selecting Properties > Project Facets, everything appears to be in order, and have the following selected:
Dynamic Web Module 3.1,
Glassfish Web Extensions 4.0,
Java 1.8,
JavaScript 1.0, and
JavaServer Faces 2.2,
which is identical to the setup I had with Eclipse Kepler, except for the version of Java, and as far as I know, there is no Glassfish Web Extensions 4.1. What is going wrong, and how to I associate the project with the server?
Glassfish is running normally, and get the greeting page at localhost:8080 when I start it manually using asadmin start-domain in the console. However, if I start it from Eclipse, I get the following text in the Eclipse console:
Starting preview server on port 8080
2015-12-25 19:01:41.539:INFO::main: Logging initialized #1285ms
2015-12-25 19:01:41.793:INFO:oejs.Server:main: jetty-9.2.13.v20150730
2015-12-25 19:01:42.173:INFO:oejs.ServerConnector:main: Started ServerConnector#3bcacab5{HTTP/1.1}{0.0.0.0:8080}
2015-12-25 19:01:42.177:INFO:oejs.Server:main: Started #1931ms
with the last four lines in red. When I go to localhost:8080 I get the message:
Error 404 - Not Found
No context on this server matched or handled this request.
Contexts known to this server are:
so the server is obviously running, but doesn't pick up the HTML in the default page. This is presumably related in some way to why I cannot get anything linked with Glassfish in Eclipse.
Some ideas on what is happening and how to fix this would be very welcomed indeed, as I really want to upgrade to the latest versions of Eclipse, Java and Glassfish.

How to solve SplitsrcTargetPreparation exception in Oracle weblogic server?

I am trying to run a simple Restful web service example on oracle weblogic server . but i am getting this issue while run the project on server. Publishing to Oracle Weblogic server at localhost has encountered a problem.Runtime exception occurred in publish task 'SplitsrcTargetPreparation'.
Have a look on screen sort.What i have to do ?
None of the other answers solved my problem, but I finally found a solution. I'm not claiming that this is the best or only way of resolving this issue, but it worked for me. Hope it helps others.
Open the Properties of your WebLogic server instance in Eclipse. Select Publishing. Set the publishing mode to "Publish as an exploded archive". You will no longer get a split source error.
Check the following.
Maven version – If you have imported as a maven project then make
sure that maven version is compatible to the java version you are
using.
Makes sure that you are using the java from the Middleware
which is comes bundled with weblogic.
New domain – Corrupt domain
may also cause this. Create a new domain

Is it possible to integrate Glassfish support into Liferay IDE yet?

I am looking for a bit of Liferay/Glassfish assistance here.
I am currently using a Liferay 6.0.6 portal running on Glassfish 3.0.1 and developing in Eclipse 3.7 (Indigo). I have downloaded the Liferay IDE for Eclipse as well.
The trouble I am having is in actually developing in Eclipse against a Glassfish server. I cannot create an actual Liferay project in Eclipse because the wizard requires me to specify a Liferay-Tomcat runtime environment.
Now I realize that this is the only server that is supported for the Liferay IDE as it is clearly documented in multiple places on the Liferay website and various forums around the web. However, I seem to recall one site (which, of course, I didn't bookmark :/ ) that gave instructions on a workaround for using Glassfish within the Liferay IDE. I believe it had something to do with creating the initial project as a Tomcat project, then going behind the scenes and changing some configuration files' Tomcat references to point to my Glassfish server.
I have set up my Liferay SDK environment correctly, including the build.username.properties file. I have this file pointing to my Glassfish server.
#
# Specify the paths to an unzipped Glassfish bundle.
#
project.dir=C:\\DEV\\myworkspace
app.server.type=glassfish
app.server.dir=${project.dir}\\..\\bundles\\liferay-portal-6.0.6\\glassfish-3.0.1
app.server.deploy.dir=${app.server.dir}\\autodeploy
app.server.lib.global.dir=${app.server.dir}\\domains\\domain1\\lib
app.server.portal.dir=${app.server.dir}\\domains\\domain1\\applications\\liferay-portal
However, everytime I try to do a deploy through Eclipse...
...this build.username.properties file gets overwritten with Tomcat settings from the runtime environment.
app.server.type = tomcat
app.server.dir = C:\\DEV\\bundles\\liferay-tomcat-6.0.6\\tomcat-6.0.29
app.server.deploy.dir = C:\\DEV\\bundles\\liferay-tomcat-6.0.6\\tomcat-6.0.29\\webapps
app.server.lib.global.dir = C:\\DEV\\bundles\\liferay-tomcat-6.0.6\\tomcat-6.0.29\\lib\\ext
app.server.portal.dir = C:\\DEV\\bundles\\liferay-tomcat-6.0.6\\tomcat-6.0.29\\webapps\\ROOT
Is there somewhere else that I need to make a change in order to get Eclipse to recognize my Glassfish server?
Any help or tips would be greatly appreciated.
It is not currently possible to use a Liferay+Glassfish bundle directly as a runtime or server adapter in Eclipse with the Liferay IDE plugins. As you pointed out the only runtime and server adapters for Liferay IDE are the tomcat bundles. However, you can still use Liferay IDE to develop with Glassfish by using the following receipe with version 6.0.6 and current version of Liferay IDE.
Download Liferay+tomcat bundle
Configure it as a Liferay runtime
Create the project pointing to Liferay runtime
Go to Window > Preferences > Liferay > Installed SDKs, switch "update build.properties" option to Never
Launch Glashfish externally using startup script
Modify the build.properties in your SDK to point to Glasshfish as runtime
For deployment use the SDK deploy action just as you showed and it should be deployed to glassfish.
This should work for now. In the future, we will be adding support for Glassfish server to our Server Manager plugin that can be using with Liferay IDE and Liferay 6.1 for remote deployment and development, so it will work just like a local tomcat instance except it will be remote Liferay running on glassfish or jboss, or whatever you like. But right now the Server manager plugin in 6.1 beta4 only supports Tomcat6/7 and Jboss7. We hope to add Glassfish very soon.

Unable to add installed Glassfish 3.1 to Netbeans 7.0

I recently migrated to Netbeans 7.0(with glassfish 3.1) from 6.9(with glassfish 3.0). After that glassfish server ran just for the first time and when I restarted netbeans, since then, it doesnt show glassfish in the servers list.
Now when I am trying to add my already installed server to netbeans, on pointing to installation location of server, it says C:\Program Files\glassfish-3.1(my glassfish installation directory) does not have a usable default domain.
Then on selecting : Register Local Domain it asks for:
Enter the path to a directory that will contain a new domain.
On selecting any directory, it says : Unsupported domain at C:\Program Files\glassfish-3.1; Admin-listener is disabled or no enabled http-listener
How do I rectify this and add Glassfish support to my netbeans 7.0 ?
I just had the exact same problem and I managed to solve it this way:-
Just run NetBeans as Administrator & try again repeating your steps, everything will work!
I think that NetBeans doesn't have a right to create folders outside of it's own if you don't run it as an Administrator.
This issue also occurred for me in UNIX using GlassFish 4.1.1.
My fix involved gaining write privileges to my GlassFish folder (located for me in /usr/local/glassfish-4.1.1). This can be done by using the chmod command, which requires sudo access if not the owner.
I had same issue but this time Netbeans 8 with Glassfish 4.x win7, the way I solved it is below:
No need to run netbeans as administrator.
No need to dowload the Glassfish zip file, you'll dowload through netbeans IDE.
-create a dir where you'll place your glassfish installation files. In my case (win7) is:
C:\glassfish4
-Enter glassfish ide, go to Services / Servers / Add Server
-when Netbeans request your GlassFish location, browse the one we created above.
-select "Remote Domain"
-mark "I have read and accept licence agreement"
-press "Download" and select glasfish 4, ok.
this should start dowloading the Glasfish Server, just complete configurations steps.
This happens when Java EE is not activated in the IDE. In the Services window, the Servers node is then empty. The node allows to add a new server, and in the process activates Java EE. Now when trying to register, the IDE discovers that it already has the selected server, refusing to register it twice. Just cancel and use the existing server in the refreshed Servers node.