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….

sybase restrictions— inner member of outer join, for regular join

refer to Sybase Book – Chapter 4: Joins: Retrieving Data from Several Tables
for this
Outer join restrictions

If a table is an inner member of an outer join, it cannot participate in both an outer join clause and a regular join clause. The following query fails because the salesdetail table is part of both the outer join and a regular join clause:

select distinct sales.stor_id, stor_name, title
from sales, stores, titles, salesdetail
where qty > 500
and salesdetail.title_id =* titles.title_id
and sales.stor_id = salesdetail.stor_id
and sales.stor_id = stores.stor_id

Msg 303, Level 16, State 1:
Server ’FUSSY’, Line 1:
The table ’salesdetail’ is an inner member of an outer-join clause. This is not allowed if the table also participates in a regular join clause.

If you want to know the name of the store that sold more than 500 copies of a book, you must use a second query. If you submit a query with an outer join and a qualification on a column from the inner table of the outer join, the results may not be what you expect. The qualification in the query does not restrict the number of rows returned, but rather affects which rows contain the null value. For rows that do not meet the qualification, a null value appears in the inner table’s columns of those rows.

as for me, I am coding,

--and t.account_id *= ca.client_account_id
--and t.fund_account_id *= f.fund_account_id
    and (t.account_id = ca.client_account_id or t.fund_account_id = f.fund_account_id)

it then throw me above error, as ca, and f are inner member of the outer join, at the same time, trying to do another regular join.

comment the first two condition, as in the code, solved the problem.

version control on local pc

I used to install one subversion server on a company pc before.
I was doing something similar to this SVN server set up before. Run sequence of commands, to set up the repository.

however, now I found from apache, there are some windows installer which would do above work nicely.

Visual SVN server
Developer’s life are becoming better and better. 😀

=======

I might be not completely. Previously the subversion project is located at http://subversion.tigris.org/, and that time, I think it’s common to run those commands to set up subversion server. Then nowadays, as stated from above website,
“This is the former website of the Subversion software project, which now calls subversion.apache.org home.”
It’s currently in transition phase to apache. Then at subversion.apache.org, actually the windows (other OS) also, packages are newly available.

XSS again

helping a colleague from another team on one issue.

basically, this is the problem. From accounts application (java EE web application), there is a hyperlink for a Infoview.jsp.

This Infoview.jsp does is, to add cookies to the client browser, and use these cookies for single-sign-on. So user-id, for example has been put into these cookie. Then immediately, it would redirect to another connectiv.jsp, which would simply check the cookie value and verify where to proceed.
This connectiv.jsp, is on another web application on another server.

Okie, so such settings, it has been working well before. Then now, they try to upgrade, from tomcat 5.1 to 5.5, Jboss upgrade also, and on another server. Then problem arises, when click the hyperlink for infoview.jsp, instead of launching the other application, it would ask for user name and credential.

They are thinking maybe tomcat 5.5 and 5.1 architect changes.. Err…

after some checking, it’s most likely XSS again. because they shift the accounts application to another server. And when used, they use the cname of this server. However, which this infoview.jsp, try to add cookie, it’s adding cookie to the full name domain. so for browser, it seems like it’s “cross site scripting”. The browser is requesting for infoview.jsp on server A, however, this jsp then try to set up cookie for domain B.

Which is insecure!!! Don’t blame the browser, that’s what it can do in nowadays. And even if it try to do more, you would blame it for the slow response.

And also, there are some cache problems. Need to remove the xxx_jsp.java, and xxx_jsp.class.

That’s all.

maven multi module

For maven project settings, pom.xml, there are actually two ways to inherit the common settings, (like OOP), inheritance and composition.

Inheritance, refers to the parent project.

composition refers to the multi-module project. The “root” configuration actually would be shared among the sub-modules in this project.

refer to Mavan Book (multi-module)

and Maven Multi Module

Choice between GWT and ZK

My team has been using an in-house framework (Echo) built some years ago.

The idea is cool, design is nice, and implementation good. With good developers they achieve this.

The framework is created sometime ago, even before spring, struts, hibernate become popular. So at that time, the framework is designed to act as an one-stop solution for all, from UI, to service, to persistence. Till now, it’s slightly outdated. As the service part has been replaced with Spring, the persistence part has partially moved aside for using hibernate.

However, there is still one layer (UI) intensively using it. This should thanks to the great integration with ZK.

The framework (Echo) has created a lot of extension to ZK, form element, container element, eventhandler element etc. It has been in same ideology we have been using for the DB UI framework, creating bean to generate the HTML output corresponding each such XML element (forms, container, eventhandler, action etc).

Great ideas are similar. Smart are in similar ways.

That’s how I come to know ZK. The UI framework by some Chinese developers, based on their client-server fusion architecture. Basically, if I understand correctly, it’s translating ZHTML file, (their languge/context) into HTML, at the same time, put their javascripts, client layout engine. Server side, they have the couterparty to listen to their javascript’s ajax calls.

Not bad. Especially plugin with ZK studio.

Just drawback, debugging is really hard. At the same time, compared to GWT, Google is better in architecture, and design.

Simply, I vote for GWT.

refer to Zk vs GWt

ZK Architecture

GWT Overview

maven projects

Since last week, I have been working on an automation testing project (volunteering).

It’s developed in my Eclipse, with Spring and Maven plugin. The technology used is Spring (DI or IoC), Camel (registering each test case as a camel routes) and selenium (testing framework); jasper report (for output) and java mail (for publisher).

It’s been working well within eclipse, invoke within.

Then I plan to publish to the team, and it supposed to be maven (mvn commands, the default approach).

however, wtf, 6pm I started preparing on this “packaging” till now finally solved. HA, 3 hours around (dinner, mrt, games excluded).

Thanks to maven.

I like the structure it required.

my-app
|-- pom.xml
`-- src
    |-- main
    |   `-- java
    |       `-- com
    |           `-- mycompany
    |               `-- app
    |                   `-- App.java
    `-- test
        `-- java
            `-- com
                `-- mycompany
                    `-- app
                        `-- AppTest.java

refer to Maven Project Structure
which is PERFECT!!!

(Actually, my own problem. I am not YET expert on maven!)

and the command I used “mvn clean compile test”
and I have been using exec-maven-plugin, to start my application by invoking the boot strap class (Main.java simple load the spring application context).

Refer to 3 ways to run java from maven

Another good day.