good explanation and solution, for jboss server start up and access deinied exception

from http://www.brianmokeefe.com/node/9

Adventures with JBoss
Fri, 09/25/2009 – 16:43 — brian

I’ve spent a couple days this week venturing further into the Java world after a long absence. My goal this week was to install and learn how to use JBoss. It was a bear at times, but I feel like I am on my way to understanding it. There were two big issues that caused me fits, and I wanted to share, as the answer did not seem readily available on Google.

The first big issue was that I could start JBoss perfectly fine, but whenever I tried to stop and restart it, it would not work. Peering through the log files, I came across the following
2009-09-24 12:57:23,653 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=jboss:service=NamingProviderURLWriter state=Create mode=Manual requiredState=Installed
java.io.IOException: Access is denied
It seemed that a file was being locked for some reason, and that file was obviously necessary for JBoss to start. Some further investigation (ok, I admit, I just tried to delete all of JBoss with the faith that it would fail on the locked file), it turns out that file was some file called jnp-service.url in the data directory of the default server. After downloading and installing the handy Unlocker tool (http://ccollomb.free.fr/unlocker/), it turns out that cidaemon.exe (aka the Windows Indexing Service) was locking the file for some reason. Turning off the Indexing Service solved that problem.

The second issue came when I attempted to deploy my WAR file with my JAX-WS service into my new JBoss server. Again, I could not get it to deploy, and a review of the log files showed
“vfsfile:/C:/dev/Workspaces/BeliefNet/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Server/deploy/RAFTSOA.war/” is in error due to the following reason(s): java.lang.StringIndexOutOfBoundsException: String index out of range: -1
A strange and cryptic error indeed. As you can see, I was using the JBoss tools integration with Eclipse, so I tried just exporting the WAR file and copying it manually to the JBoss deploy directory, but still no luck. With nightmares of “pouring through source code to see what JBoss is doing when it throws this exception” dancing in my head, luckily Google gave a bunch of pieces to the puzzle to what might be causing this. It turns out that JBoss requires all servlets and such to be inside a package. This was not the case when I was just deploying in Tomcat alone, but luckily this is among the easiest problems to fix.
Happy to say, after those issues were resolved, my sample JAX-WS application is up and running. Now I just have to unlock the puzzle of JAX-WS, JAXB, and how everything lives in harmony to create a viable SOA solution….

weblogic server 11g

upgrade of weblogic server becomes much easier nowadays.

Once installed weblogic server 11g, (download from oracle website). after finish installation, coming to quick starts, there are options, either to create new domains, or update existing domains with old version.

choosing the update option, just click and follow steps, most commonly, it’s naturally, smoothly done well.

from http://www.oracle.com/technetwork/middleware/fusion-middleware/downloads/index.html

weblogic application.xml

i just finished solving another simple task.

problem description:
there are three projects inside the application. Front_End, Pricing_Admin_Engine, and Help_Context.

deployment of previous two applications have no problem, since they are standard Java EE applications. deployment Help_Context have problems. As the project structure is

the root of this project is CFC_Static_Content, and the required resource is at CFC_Static_Content\cfc_static\help\db\enUS\content\cfc.xml
once deployed as it is, the url would be
CFC_Static_Content/cfc_static/help/db/enUS/content/cfc.xml, while required is /help/db/enUS/content/cfc.xml.

for some, this is a very simple problem, and the solution is also very simple, just add a META-INF folder, to contain new created application.xml, inside which specifiy as

<?xml version="1.0" encoding="UTF-8"?>
<application id="CFC" version="5"
	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd">
	<display-name>CFC Static Content</display-name>
	<module id="WebModule_CFC_Help">
		<web>
			<web-uri>cfc_static/help</web-uri>
			<context-root>/help</context-root>
		</web>
	</module>
</application>

Apache plus https, set up a secure web site

Another limitation on home ISPs, besides the dynamic IP address, the http default port 80 is blocked.

Using some open port test tools check against my home external IP address, and found out 443, the default https port is still open. So I decide to use the https protocol instead.

This web site is built on top of apache web server, in windows environment. To have apache provide https connections, the apache with ssl support version should be downloaded, and installed first.

  • create the site SSL certificate

After installation, at /bin  directory of apache, there should be a openssl.exe module.  Besides, there is a openssl.conf under /conf folders.

There are three steps to create the certificate.

  1. create the new key
    openssl req –config openssl.conf –new –out ./ssl/best2jj.csr –keyout ./ssl/best2jj.pem
  2. remove the passphrase from the key(for safety)
    openssl rsa -in ./ssl/best2jj.pem -out ./ssl/best2jj.key
  3. Convert request into signed certificate
    openssl x509 -in ./ssl/best2jj.csr -out ./ssl/best2jj.cert -req -signkey ./ssl/best2jj.key -days 365
  • install or configure the certificate

modify the http.conf files, change the setting as below,

  1. enable ssl modules
    as uncomment this line, LoadModule ssl_module modules/mod_ssl.so
  2. enable ssl configurations
    as uncomment this line, Include conf/extra/httpd-ssl.conf
  3. add these lines at the end of the http.conf
    SSLMutex default
    SSLRandomSeed startup builtin
    SSLSessionCache none
  4. at httpd-ssl.conf, point to the correct certificate and certificatekey files
    SSLCertificateFile “the directory to your cert file just now created/best2jj.cert”
    SSLCertificateKeyFile “the directory to your key file just now created/best2jj.key”

Restart the server, and test using https://yourServerAddress.

Godaddy plus dyndns

This web site is hosted on a home PC. The domain name is registered with <a href=”www.godaddy.com”>godaddy </a>. Most direct and easiest configuration with godaddy is to point to the home pc address, then it’s done. However, it’s not the case for a home pc with non-static ip address. Then dyndns comes into view to work.

Anyone can register a free dyndns host, and point to your home pc ip. One good feature dyndns provides is, there are either routers, or client applications to update the dynamic ip address to dyndns server automatically. In such case, the dyndns registered host can always point to the correct home ip address.

As for godaddy, there is no simple configuration as pointing the registered domain to the dyndns host name. Life is not easy. However, there are CNAME configuration which can be utilized. I have configured the www CNAME for this domain, to point to my dyndns host. As a result, http://www.best2jj.com would point to my dynamic ip address in-directly in such way, yet always correctly.

One more add-on for this setting is, best2jj.com won’t works pointing to my home server, instead pointing to the godaddy free parking web site. To correct this, the domain forwarding features can be utilized.

Select manage forwarding under the registered domain, then point to https://www.best2jj.com. Wait for few minutes, to have the configuration updated to the server, everything now perfect.