Gerben Feenstra

+ Follow
since Feb 21, 2011
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Gerben Feenstra


I made a (custom) ww_verify_function to attach to a profile of users. It is based on one provided by Oracle and it's only slightly modified here and there. The errorhandling is untouched, so this is all 'vanilla'.
For those who don't know, the code does all kinds of checks on a newly entered password. For instance the minimum length of the password.
If it is not correct it raises:

Now, on the other end inside the application we have a (headstart?) form, QMS0004F that allows the user to change their password. The way this form does this is through a forms_dll call:

(This will trigger the ww_verify_function in the background and verify the entered password. I know the checks work, because I have tested them.)

After that the form does a check on form_success:

However, the user never sees the raise_application_error from the ww_verify_function, only the above messages. Password change either succeeded or it didn't.

How do I show the raise application error to the user, so they know what is wrong in their new password?

I figured the raised application errors would end up on an errorstack, so I searched some and tried getting them from the errorstack:

But nothing returned. Then I examined the cg$errors package some more, and found:

Nothing again. But this gave me the idea to do a little test with:

Now, if I modify my ww_verify_function and push an errormessage on the stack, I can 'pop' them in the form to present them to the user. This seems to work, but I am not at all sure this would be the right way to do it.
Or is it?...

Can anybody explain to me what would be the correct way to show the user the raised_application_error?
3 years ago
So, I found out something. If this is the solution, I'm not expecting any feedback from our customer and I will probably forget all about this post, so here's my findings for future reference and/or for anyone with a similar problem:

Although the checkbox (under timezone settings) for "Adjust to Daylight Saving Time" does not seem to do anything in wintertime (Which is standard time), it does seem to be having effect on my problem. I am able to reproduce the problem once again depending on wether the checkbox is on or off. I gave this information to our customer, but as usual I'll probably hear little from them if this is indeed the solution...
6 years ago
I'd say that chance is pretty slim, since my country is entirely in one timezone, so their timezone must be the same as mine, and the date comes from the same DB, so same timezone.
I do not think the problem is with the db (sql date) since it comes out trunced, plus many other locations report no problems on the same data.
6 years ago
Thank you for your analysis Winston. I have in fact tried this myself (Changing the timezone from +1:00 to 0:00), and it is the only way I can reproduce this problem on my local machine here. I figured since java dates always has a time (since java data is based on milliseconds from epoch), the trunced sql date will end up being at midnight, the first millisecond of that date sorta speak. When the timezone differs -1, it will become 23:00 (11PM) the previous day, so the date ends up displayed as the day before.

So, yes, timezone difference can cause this same problem.

However, the people I am dealing with here ensure me their timezones are set correctly :S
Not sure how credible this response is though...
6 years ago
This piece of java software I am responsible for is running throughout numerous locations in my country, there is only 1 location which has trouble with the dates being displayed incorrectly, birthdates of clients are displayed as a day earlier. It seems pretty safe to say it is a problem on their end... But still, they're asking me for an explanation as to why java would treat a date differently in this rare case.

The date (a birthdate) comes from an oracle database, it is a date without a time (trunced date). It enters the application as a member of the client-class, it is NOT being set or changed after that. It goes through several layers in the application, then ends up in a GUI class which unwraps it from the "client"-object and puts a SimpleDateFormat (new SimpleDateFormat("dd-MM-yyyy")) on it.

My first and only hunch was the timezone settings, but that seems to be OK!

Does anyone here have any clue as to what might cause this strange behaviour?

6 years ago
Got 2 webservices running on Weblogic 12c.

Both needed conversion from oracle EnterpriseManager/java6 to Java 7.

One (Let's call it webapp A) got converted pretty easy using Jdeveloper 12c, the other one (Webapp B) I converted to a java 7 Maven-project on Eclipse Kepler. (Don't ask me why, long story short: it didn't work on jdev...)

Anyways, both A and B use the same defined datasource on the weblogic container, both using pretty much the same code to retrieve the datasource.

It is working great for app A, but gives a class-cast exception on app B, and I can't seem to figure out why

This is pretty much the same code I use to get to my Connectionfactory and JMS queue's, which seems to work just fine...
The datasource name is correct, if I use anything else it fails alltogether. So, appaerantly it does find 'something', but of another type.

I can not really find an answer when I google this. I did read somewhere JDBC driver might be missing, so included oracle's thin client on my classpath (ojdbc7.jar). => Nothing

I am using apache CXF, if that matters... Not sure... It needs spring components, so there is an applicationContext.xml where I fiddled around with.
Found somewhere on google, so tried adding this. But it did not do the trick, and to be honoust, I have no clue what I'm doing here...

Is there anyone here who has a clue about what is happening here? Is there anyone who can explain to me how this stuff is supposed to work?
I'm not really into this java "magic" stuff... The InitContext for instance, how does it get the context from the server, while I am the one instantiating it with InitialContext initContext = new InitialContext() ?


Jan 30, 2014 11:54:50 PM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging WARNING: Application {urn:hl7-org:v3}VaccinatiesOpvragen_Service#{urn:hl7-org:v3}VaccinatiesOpvragen_QueryResponse has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: weblogic.jndi.internal.WLEventContextImpl cannot be cast to javax.sql.DataSource at org.apache.cxf.service.invoker.AbstractInvoker.createFault( at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault( at org.apache.cxf.service.invoker.AbstractInvoker.invoke( at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke( at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke( at org.apache.cxf.service.invoker.AbstractInvoker.invoke( at org.apache.cxf.interceptor.ServiceInvokerInterceptor$ at java.util.concurrent.Executors$ at at org.apache.cxf.workqueue.SynchronousExecutor.execute( at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage( at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept( at org.apache.cxf.transport.ChainInitiationObserver.onMessage( at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke( at org.apache.cxf.transport.servlet.ServletController.invokeDestination( at org.apache.cxf.transport.servlet.ServletController.invoke( at org.apache.cxf.transport.servlet.ServletController.invoke( at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke( at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest( at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost( at javax.servlet.http.HttpServlet.service( at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service( at weblogic.servlet.internal.StubSecurityHelper$ at weblogic.servlet.internal.StubSecurityHelper$ at weblogic.servlet.internal.StubSecurityHelper.invokeServlet( at weblogic.servlet.internal.ServletStubImpl.execute( at weblogic.servlet.internal.ServletStubImpl.execute( at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun( at weblogic.servlet.internal.WebAppServletContext$ at at at at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute( at weblogic.servlet.internal.WebAppServletContext.securedExecute( at weblogic.servlet.internal.WebAppServletContext.execute( at at weblogic.servlet.provider.ContainerSupportProviderImpl$ at at Caused by: java.lang.ClassCastException: weblogic.jndi.internal.WLEventContextImpl cannot be cast to javax.sql.DataSource at nl.ordina.service.DbHandler.createConnection( at nl.ordina.service.DbHandler.<init>( at nl.ordina.service.DbHandler.instance( at nl.ordina.service.Verwerking.legVastInDB( at nl.ordina.service.Verwerking.verwerkBericht( at nl.ordina.service.VaccinatiesOpvragenProvider.invoke( at nl.ordina.service.VaccinatiesOpvragenProvider.invoke( at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( at sun.reflect.DelegatingMethodAccessorImpl.invoke( at java.lang.reflect.Method.invoke( at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation( at org.apache.cxf.service.invoker.AbstractInvoker.invoke( ... 36 more

6 years ago
Same problem here, have not found a permanent solution yet. Workaround I found: Go to java console and set "Perform certificate revocation checks on" to "Do not check (not recommended)"
6 years ago
I found another way to get things working. My initial JNDI-problem however was solved by using...

... instead of setting Context.PROVIDER_URL.

Also, the only way I got things working at all is using a dependency on glassfish-embedded-all, which is a 35MB Jar. Which sounds kind of insane to me, considering I only want to sent simple text-messages to a queue. How hard can that be? Communication with code running outside a container is a major flaw in JEE in my opinion.

Anyways, thanks for the help.
Problems solved, thread closed.
Follow up on this thread:

I've got 2 laptops here, running next to eachother, connected to the same network switch. One is running an almost default instance of glassfish 3x, the other is running a client OUTSIDE of the container comprised of only a few lines of code to get a connectionFactory from the Glassfish server.
Running both on the same machine works like a charm now, but when ran on different machines it refuses to connect, and my head-ache is now getting worse by the minute...

Server side:
Running inside Netbeans IDE 7.2

GlassFish Server version: 3+
JMS Service Type: LOCAL (instead of EMBEDDED)
Created javax.jms.QueueConnectionFactory named "TapServiceConnectionFactory" under JMS Resources.

Glassfish configuration is otherwise untouched (I've fooled around lots, so created a clean glassfish instance for this example):

Startup log:


Simple maven application containing 1 class with a main-method:


This is what happens if my glassfish server is running and the client is started:

Also not very sure which port to use, 3700 (JMS) or 7676 (IIOPS), however, I've tried both, but both fail.
I'm out of ideas :/
I found this example:

Then I should be able to get the connectionFactory from the context with this:

and the queue:

But I don't know what values to use in the properties to connect to my glassfish container. What type of InitialContextFactory should I use? What protocol should I use? vm:// or tcp://, or something else?

I tried using com.sun.enterprise.naming.SerialInitContextFactory and the url: iiop://
But then I get an Exception:

This is driving me crazy. How hard can it be to remotely connect to a queue and put a message on it?

I have a standalone desktop application 'A' which needs to send messages to remote application 'B' running inside a JEE container. Application B has a JMS-queue to recieve messages. Application A should have minimal changes, and for Application B I have no access to functionality or source code whatsoever.

So the plan is to make a jar-library which can be used by creating a single call with some parameters to it from within Application A. The library should put messages on the queue in Application B.

I followed the Java EE 5 tutorial from oracle, in particular the part about JMS that has a 'server' (earthmdb demo) and a client (jupiterclient demo) running separately ( I use the 'server' to mimic Application B so I can test my code. It is a simple class implementing the MessageListener interface and an onMessage() method. This is working just fine; I see messages get send from the client-application and they're being received in the onMessage() method correctly.

However, they both run inside the same Glassfish container. So I tried to seperate the client to a standalone application to eventually be able to put it in a jar that is to be used by application A.
I used Apache ActiveMQ as a JEE implementation, so I don't need to run inside a JEE/glassfish-container. The messages are send to "TapServiceQueue" running in the glassfish-container on the same machine (for now) on port 17294. My code runs, messages get send, but they are not received on the server-side somehow :/

Here's is the code of my client class:

I created my app as a Maven-app inside netbeans, so dependencies are taken care of automatically.
In my client I do a createQueue:

This seems rather strange to me, since the queue already exists. I've been searching for ages for a solution now, but there does not seem to be a way to get an existing queue reference :s How to do this? Can you guys see something wrong in my code? Or is my approach not the correct one somehow?

Any suggestions?

OS: Ubuntu 11.04
JAVA: 1.7
JEE: 5
IDE: Netbeans 7.2
JEE-container: Glassfish 3+

For completeness, here is the server-side code

K, for future reference by other people looking for the same info: I just found this: Which is the closest to date what I'm looking for, although still a bit vague IMO. Unless someone reading this knows of a clearer overview, I think I'll manage with this one.
Perhaps taglib documentation is the wrong term then (although they seem pretty much the same to me), probably because I was looking for something similar as the JSTL-taglib reference (
What I'm searching for is complete documentation on all the JAXB tags and elements used in XSD's and XJB's, especially for namespaces ""; and ""; (Hyperjaxb). For example: <jaxb:bindings>, <jaxb:package>, <hj:default-generated-id> etc. And all of their properties.

The link provided is just the namespace I found in an existing XJB, which happens to contain a webpage, not containing the documentation I'm searching for, and besides, very old.

There must be some complete overview of JAXB tags and elements somewhere!?