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
Related
An architect is having issues bringing Liberty up. Currently, an individual is running a server on his local computer and they want to move it to a shared server. When he tries to deploy a simple “helloworld” it’s failing and he is receiving an error “Context Root Not Found”. He is not sure what to set in server.xml file to have wlp recognize the application. They have ODM 8.5 on the mainframe. He thinks it might help if he saw an example of an EAR or WAR file deployed. Any ideas or suggestions?
Either put your application in the dropins folder, it will be detected and started automatically, or put it in the apps folder and configure in server.xml like this:
<webApplication id="HelloApp" location="HelloApp.war" name="HelloApp"/>
by default context root is application file name without extension, but you can change it by adding contextRoot="mycontext" attribute.
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
I am building a project in jdeveloper 11.1.2, but when i want to deploy it in weblogic it appears the next message
Error opening zip file or JAR manifest missing : ../modules/org.eclipse.persistence_1.1.0.0_2-1.jar
The file is there so i don't know what's happening.
The solution for this problem is removing the hash area named "RunConfigurations" in the project file. (Model.jpr)
I have resolved this issue in different way.
First of all it was an integrated weblogic server and the error was coming exactly after security patches have been installed on my Windows XP machine.
To repair:
In JDeverloper go to "View"->"Application Server Navigotor"; select IntegratedWeblogicServer and open properties. We need Domain Directory. Domain Directory for the IntegratedWeblogicServer is not located under "..:\Oracle\Middleware". By default it was placed (at least on my machine) under "C:\Documents and Settings\user name\Application Data\JDeveloper\system11.1.2.1.38.60.81\DefaultDomain\".
So copy entire modules folder from you Fusion Middleware home "..:\Oracle\Middleware\" to "C:\Documents and Settings\user name\Application Data\JDeveloper\system11.1.2.1.38.60.81".
Restart integrated weblogic server.
It works for me ...
Good luck.
Answer for JDeveloper version : 11.1.2.1.0:
Right Click Model.jpr -> Project Properties -> Run/Debug/Profile -> Run Configurations. Select EclipseLink JPA Client -> Edit -> Launch Settings -> Java Options --> -javaagent:D:/JDeveloper/modules/org.eclipse.persistence_1.1.0.0_2-1.jar
D:/JDeveloper/modules is the path where my org.eclipse.persistence_1.1.0.0_2-1.jar file is located.
So give whatever your org.eclipse.persistence_1.1.0.0_2-1.jar path is after -javaagent:
I had the same problem with JDeveloper 11g 11.1.2.1.0 (R2) in Windows 7, and I solved it by uninstalling the following automatic updates of windows, it is not a problem of a project or specific application in JDeveloper, because it occurs at trying to run the integrated WebServer.
These are the uninstalled updates:
KB2647518
KB2665364
KB2641653
KB2639308
KB2621440
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.
I have a problem that, after a lot of reading and research, seems like tomcat is running another instance of itself and thus serving an old version of my updated app (or somehow has cached an older version of my webapp somewhere only serves that.)
I work on the app in eclipse on a windows machine and deploy it on a Linux server as a ROOT app (Renaming the war file to a ROOT.war).
What I'd like to know is if there's a way to locate the older version that tomcat is serving by getting tomcat to log an output of the context root of the servlet that's serving the older version of the app.
As it stands it the moment any files created by the updated app get created in the right directory but because the app instances are different it can't access the files shortly after they're created.
Any help/hints would be welcomed
To answer the question in the title, let your code basically do the following:
System.out.println(getServletContext().getRealPath("/"));
To solve the problem described in the question, shutdown Tomcat and delete everything in its /work directory, delete the expanded WAR in /webapps and remove the /Catalina subdirectory of /conf directory (if any) and then restart.