GlassFish - Migrate domain from version 3 to version 4 - glassfish

I would like to move a GlassFish domain from a GlassFish v3.x server (running Java 6) to a new server running GlassFish v4.x (running Java 8). The old configuration uses JNDI, JMS, a webservice, etc...
What is the best approach to handle this ? Can I just copy the domain folder to the new server ? Or do I have to export the config and restore it on the new server ?
Thanks

Right now we are doing the same thing in my company.
We were trying a few things like exporting domains, upgrading them or just coping the domain, unfortunately none worked ...
The only solution that worked without problems was coping the "important"
parts like resources from glassfihs 3 domain.xml to glassfish4 domain.xml.
Coping the full domain.xml content or file wont work..

Related

Avoid font downloading in Glassfish

We currently have a Glassfish Server 4.0 hosting our webpage, with Apache 2.2 as our Digital Certificate Holder in Ubuntu Server. One of our clients did a Vulnerability testing and discovered that a font (specifically, the glyphicons-halflings-regular.ttf) could be downloaded by using the URL:
http://<URL>/<War>/faces/resources/fonts/glyphicons-halflings-regular.ttf
Is there any way that we can avoid that download and instead redirect that Link to a error page when people try to access any link of that type?
Thanks in advance
Well, the solution I found was this
I opened the Glassfish Console, went to Configurations –> server-config -> virtual servers -> server and then I clicked on the Add Property button
the name was: Redirect1
The code was:
from=/<war>/faces/resources/fonts/glyphicons-halflings-regular.ttf url-prefix=https://<URL>/<war>/
I did it with all of the Cluster and configuration instances of Glassfish Cluster
After a Glassfish and Cluster restart everything was working fine.
Regards!

Weblogic different ojdbc library on servers

im running multiple servers on weblogic domain.
Is it possible to run different ojdbc drivers on servers?
adding classpath under server start configuration doesnt work, also deploying with application and deploying on server as a library doesnt overrride default.
Thanks for help
First, basic checklist...you do use NodeManager don't you (server start tab won't do anything if you don't). Also, you made sure the new driver name is configured in the JDBC datasource (I'm assuming the driver is for a datasource right?)
Deploying in the app shouldn't do anything since the datasource object is created prior to deployment.
You might want to take the old ojdbc6.jar, for JDK 6, and ojdbc5.jar, for JDK 5, out of the directories to make sure they're not seen anymore.
Also, where in the classpath did you put the new path ? When you add another path you should always put it in the beginning (after patches though)

How to reference apache cxf library from apache web server

When I deploy my apache cxf web service using eclipse I have to include the apache cxf library in the Web Deployment Assembly in order for it to work when I deploy it on my production apache web server. This is a problem because it makes the war file very large because the cxf library is included. If I exclude the library the war file is much smaller but the web service does not work when it is deployed on the live server even though the apache cxf library is on the live server.
My assumption is I need some kind of classpath reference so the live server can see the apache cxf installation but I am not familiar with how to do this as I am new to apache.
Thanks, Jesse
Put the cxf jars on folder tomcat/lib.
Ok, this workaround worked for me:
We can set the CXF lib path on the common.loader variable which is in $CATALINA_HOME/conf/catalina.properties file. You can add (after the comma) something like this:
common.loader=....,/path/to/cxf/home/lib/*.jar
I couldn't find a way to set an enviroment variable on tomcat in order to have something like: ${cxf.home}/lib/*.jar. I tried to put -Dcxf.home=$CXF_HOME in several places in catalina.sh but it never picked it up :( - hope someone can help on this later.
Restart tomcat and it will take cxf jars

Implementing a JAAS page to a WAR file on JBOSS AS 7.1.1

I'm very new to web applications. I've been told that JBOSS 7.1.1 has an in-built JAAS system which can be enabled on my JBOSS configuration quite simply. However I'm having trouble trying to get this running, namely most internet searching I went through has just ended up with older versions of JBoss.
Does anyone have a step-by-step guide on how to implement a simple JAAS authentication screen on my WAR file in JBoss 7.1.1? Prefarbly using its h2 database. Thanks :)
Also - my machine has trouble with Eclipse, so I can't use any of Eclipse EE's nifty server running mechanisms.
Finally got it. For those of you in the future:
You need your own standard login/logout pages in jsp/html/whatever. You put that in your web.xml constraints. Then you add an xml file called "Jboss-web" and type in your security domain (the default AS 7 is called 'other'). Then lastly add users and roles using adduser.bat in config folder.

serve a GWT application from the app server root

I have a GWT application, which I deploy as a WAR file to a Jetty 8 server.
I want it to be accessible via
http://<myserver>/
instead of
http://<myserver>:8080/MyApp/MyApp.html
I understand I can configure Jetty to run on port 80 instead of 8080 or have an apache instance running on port 80 and forwarding requests to Jetty running on 8080 (don't see a benefit of the latter, though).
but how can I deploy the GWT app to be accessible at the server ROOT?
so far I see I can create myapp.xml in Jetty/contexts folder and put
<Set name="contextPath">/</Set>
there. I can also rename MyApp.html to index.html. but I'm not sure this is the "recommended" approach
I think you pretty much answered your own question:
The application server (e.g. Jetty) is responsible for the context path, so you must set it somehow in the application server. This is different for each server, e.g. in Tomcat one possibility to achieve this is renaming the war file to ROOT.war. (I don't know all the possible ways how to do this in Jetty off-hand.)
Note: The file that is served when going directly to the context URL can be determined in your web.xml, using
<welcome-file-list>
<welcome-file>MyApp.html</welcome-file>
</welcome-file-list>
So you don't have to rename it to index.html.
ok, accepting my own answer:
create myapp.xml in Jetty/contexts folder
thank you, Chris!