eclipse error: glassfish\domains\domain1 does not exist - eclipse

I have java ee6 web profile sdk & I am using eclipse ee. I installed Glassfish plugin for eclipse using Download additional server adapters in the New Server wizard. Now during building a test app, eclipse raise this error glassfish\domains\domain1 does not exist. Whats the reason & how can I remove it?

Either your eclipse glassfish plugin points to the wrong domain or your server has no domain although there should be at least a default domain which is usually named domain1.
Check what's the name of your domain in glassfish-install-dir\glassfish\domains directory. If there is no subdir, you can create a domain with the asadmin tool:
glassfish-install-dir\bin\asadmin create-domain your-domain-name
See this description of the create-domain command.
If you already have a domain with a different name than domain1, you have to reconfigure your eclipse glassfish plugin. (Since I don't use eclipse, I can't take you any further. But I remember a BalusC tutorial on this topic).

Go to <Glassfish-install-directory>/glassfish/config directory.
Edit asenv and point to your JDK installation for set AS_JAVA=C:\Java\jdk.
Now you should be able to run asadmin.
Create a new domain using asadmin create-domain domain1 (inside bin directory).
Server setup in eclipse will now find your newly created domain.

I ran into this same problem and fixed it with the following:
Open a command prompt and browse to C:\glassfish3\glassfish\bin (or whatever your glassfish directory is)
Execute asadmin
Type in create-domain --adminport 4848 domain1 (your debug port can probably be whatever)
Go back into Eclipse and continue

Although late reply, but may be useful to someone facing similar issues.
If no domain exists in your glassfish path i.e say C:\glassfish4\glassfish\domains\ then you can create a new domain in the same path as follows:
Navigate to C:\glassfish4\bin\ directory and double click on asadmin.bat. It will open a command prompt as asadmin >
Type the following command asadmin > create-domain --adminport 4848 domain1
Click Enter repeatedly to keep the default settings viz. username (admin) password and other things.
That's it. You will find the domain1 created under C:\glassfish4\glassfish\domains\ directory with all default configurations.
If want to create domain in another directory or want some more info then can refer Oracle Glassfish Reference Manual:
http://docs.oracle.com/cd/E19798-01/821-1758/create-domain-1/index.html

Eclipse doesn't have domain path setting for glassfish server. This error comes when domain path is not correct. Make sure when you run your application on eclipse give glassfish credentials user/password

In my case, the C:\glassfish4\glassfish\domains\domain1\config\ domain.xml was renamed to something like domain568912323464576456.xml, so I edited the file, leaving it as it supposed to be named and done, server started up again.

create a new domain with
asadmin create-domain myDomain
add the path of this new domain, if there is a message "domain is not valid", make the folder domains/myDomain/conf permission to not only the root. If there is the message "is not writtable" then open Eclipse as root and try again. This should be work in these cases.

You must to add a password to your admin user. Eclipse mistake. Eclipse doesn't recognise the domain without admin password.
When you create the domain, add a admin user and a password and Eclipse doesn't complain any more.

Related

AppSrv01 doesnt have write permission

i know that the default profile name when i installed websphere was Appsrv01, I want to create my own AppSrv02 but the location of my IBM Websphere was in C: and i dont have any write permission, i dont have any admin rights also..
using COMMAND-LINE, I want to make my profile folder to be writable, so that my newly created AppSrv02 will be list down in the profile names in my RAD.
Please help me. Thanks
So that's your problem. In order to have a usable profile in WAS, your user must have write permissions. See this link from WAS ND infocenter, it applies to WAS standalone too.
http://www.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.installation.nd.doc/ae/tpro_manage_nonroot.html
If you cannot change the write permissions to this profile, you'll need to create your own. For this, you can either use WAS Profile Management Tool, WAS CLI or you can create your profile using the Configure profiles... link in the WAS server creation wizard you posted. I'd use the RAD way because RAD validates, within the IDE, the proper permissions that you need to create and use the profile within RAD.
First check whether you have admin rights or not if your using User/Guest profile, by creating any new folder in C drive where IBM WAS is installed.
If you have Admin rights, than right click on RAD run as administrator. It should work fine.
If Profile doesnt show up in drop down, Configure new profile and try checking that way.
If you dont have Admin rights better install RAD in any local drive other than C
Running Eclipse with Admin rights and removing the read-only tick for the AppServXX folder/WAS folder couldn't help me... cause I copied the WAS server from another PC :). So for those of you who want to move / migrate your development environment:
I did a search inside the copied WAS, Eclipse and the project's workspace folder for their old paths (with Total Commander, feed the results into a list) and dragged all the files (except the log ones) into my editor (NotePad++) and did a replace in all open documents for the new paths. It's a bit lucrative, but it took only 10 minutes for me and afterwards the WAS server in Eclipse showed the correct profile and it also did start up well.

Generate code from deployed files

I had mistakely deleted my web services code. I don't have any backup of this code. Tried some file recovery tools but it didn't work. I have deployed the project in glass fish 4.0 server and the application works fine from there. So I am thinking is there any way I can generate the codes of that webservice?
Thank you
If you have the application deployed in your glassfish server then it is possible. You can always find your the .class files of original codes (not the one compiled by SEI) inside your domain folder of glassfish. Then you can use some third party tools to generate java codes from the class files. There are to ways that you can deploy your application in the glass fish server:-
By using the glass fish server web GUI and deploy it.
By using exernal IDE like eclipse where you create the glassfish server and deploy it.
For condition 1, goto :-
glassfish\domains\domain1\applications\__internal
where domain1 is your domain name. By default it is the name of your domain
For condition2, goto:-
glassfish4\glassfish\domains\domain1\eclipseApps
where domain1 is your domain name. By default it is the name of your domain
You can find your java codes inside WEB-INF\classes inside your project name.
Hope this helps.

Configure the path (localhost) of the war application to be the root (Java EE)

I want to change the path when I run my war-application locally...
Right now, it is running on the default setting...
http://localhost:8080/myproject-war/
and I want it to be the root, something like:
http://myproject-war.local/
or
http://myproject:8080/
How can I do that???
Note: My app is a Java EE 6 Application with Glashfish using Netbeans 7.3
This post helped me out How do you deploy a WAR that's inside an EAR as the root (/) context in Glassfish?.
First, I added a Standard Deployment Descriptor (application.xml) to the Enterprise Application Project.
Then, change the path of the context root of your web application: <context-root>/myproject-war</context-root> to <context-root>/</context-root> or <context-root />
Finally, (optional) remove or rename the Glashfish index page (or redirect it to the welcome page). located in the Glashfish default folder such as C:\Program Files\glassfish-3.1.2.2\glassfish\domains\domain1\docroot
Now the page web application will be visible on: http://localhost:8080/
Maybe you are mixing up stuff here - one thing you can and should do is setting the context root of your application. This is done in the server's deployment descriptor - in your case in glassfish-web.xml:
<context-root>/myproject</context-root>
(See The Java EE 6 Tutorial for more details.)
What you're asking in your example URLs is changing the host name, which is not related to your application or application server, but to your machine and OS settings.
You may put something in the OS hosts file (/etc/hosts on Linux, C:\Windows\System32\drivers\etc on Windows), but I don't see the point to do this. Your application runs on some host (may it be localhostor some external server) and this is how your URL starts.
you can put entry in host file. which is located in "C:\WINDOWS\system32\drivers\etc".
127.0.0.1 your_project_name

Eclipse remote system explorer and sudo

I use Eclipse RSE to access files on a web server. To establish a sftp connection with Eclipse RSE I use my HippieBandJam user-ID. To edit files I need root access which I only can gain with the sudo command. In Eclipse RSE I have tried to start a new ssh terminal, use sudo su and then refreshed the sftp tree but this does not seem to work. Does anyone have any idea how to "upgrade" the sftp connection so I can edit the files?
If you want something really exotic, you could:
Compile a tiny program in C that does the only thing: execs the shell
Set a suid bit for the executable
Create a new user and set our freshly compiled binary as this user's login shell
Set up proper permissions for the binary, allowing only the new user to execute this file
Use new user's credentials to log onto the server
He-he :-)
Here is one idea:
create a mount point in your local system in /media/
use sshfs cmd to mount the remote server file system directory to .
In eclipse use the project, use add directory to your project
Steps: right click on your project -> New -> Folder -> Advanced (Select link to alternate location) linked folder.
There you have your remote systems files synced up...
Hope this helps!
My workaround for this was to set up the connection to use the root user from the start. First, you need to enable it on your ssh client:
https://forums.aws.amazon.com/thread.jspa?threadID=86876
Then you may have to configure the authorized_keys file:
/root/.ssh/authorized_keys
to accept the key.
Hope that helps! It's not quite as secure, so be wary of this method.
Other Workaround:
NOT ON LIVE SERVER!!!!
Assign the group of the files write rights during the period you are editing them and add your account to the group.

crossdomain.xml location when Tomcat is running in Eclipse

I need to use a crossdomain.xml file to access my WebApp from a dev sandbox.
I gather from other SO posts that it should be accessible at http://localhost:8080/crossdomain.xml , hence in tomcat ROOT webapp.
Where the heck is that ROOT directory when running Tomcat in Eclipse?
Edit: Tomcat is using a Runtime Environment named "Apache Tomcat v6.0" which is using a "Tomcat installation directory" set to "D:\dev\apache-tomcat-6.0.33"
I tried to drop crossdomain.xml in "D:\dev\apache-tomcat-6.0.33\webapps\ROOT" but I still get a 404 trying to access http://localhost:8080/crossdomain.xml from a browser. In fact, anything in that ROOT directory is accessible.
Edit 2: In the server launch configuration, there is an "Arguments" tab listing the following -Dcatalina.base="D:\dev\workspaces\project\.metadata\.plugins\org.eclipse.wst.server.core\tmp1" -Dcatalina.home="D:\dev\apache-tomcat-6.0.33" -Dwtp.deploy="D:\dev\workspaces\project\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps" -Djava.endorsed.dirs="D:\dev\apache-tomcat-6.0.33\endorsed"
Hence, I pasted the crossdomain.xml into D:\dev\workspaces\project\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\ROOT and ... it worked. Seriously.
Thanks in advance
As per edit #2
In server launch configuration, there is an "Arguments" tab listing the following VM Arguments
-Dcatalina.base="D:\dev\workspaces\project\.metadata\.plugins\org.eclipse.wst.server.core\tmp1" -Dcatalina.home="D:\dev\apache-tomcat-6.0.33" -Dwtp.deploy="D:\dev\workspaces\project\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps" -Djava.endorsed.dirs="D:\dev\apache-tomcat-6.0.33\endorsed"
Hence, I pasted the crossdomain.xml into D:\dev\workspaces\project\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\ROOT