Karsten Wutzke

Ranch Hand
+ Follow
since Jul 20, 2010
Karsten likes ...
Hibernate Python MySQL Database
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Karsten Wutzke

Be warned, putting

results in undefined behavior:

http://andyschwartz.wordpress.com/2009/07/31/whats-new-in-jsf-2/#get-prerenderview-event

It might just be luck if it's working. It's fragile. Not putting it inside f:metadata might cause the listener method to not be called at some other point and you start wondering what broke. Don't do it!

If you're experiencing redundant calls to the preRenderView method, you have to resort to Seam 3 Faces' s:viewAction instead:

Docs: http://docs.jboss.org/seam/3/faces/latest/reference/en-US/html/components.html#viewaction

This is the predecessor of the upcoming JSF 2.2f:viewAction:

here
http://www.oracle.com/technetwork/articles/java/jsf22-1377252.html

Both Seam 3 Faces and JSF 2.2 give you the ability to control initial/postback request behavior, which JSF 2.0 f:event doesn't. Everything else are "hacks", also see here: http://stackoverflow.com/questions/2830834/jsf-fevent-prerenderview-is-triggered-by-fajax-calls-and-partial-renders-some

Karsten



11 years ago
JSF
Yuck, don't use JDK/JRE 7 with GlassFish 3.1.1. Some issues are supposed to be fixed in 3.1.2. Read here: http://www.java.net/forum/topic/glassfish/glassfish/cant-login-admin-console-internal-glassfish-311

Karsten
12 years ago
Hello,

I could need some quick help on a topic posted here: https://coderanch.com/t/568658/java/login-admin-console-Internal-GlassFish

Sorry for posting this, but I really need to get GlassFish working with my webapp, which I can't without a datasource.

Thanks
Karsten
12 years ago
Hello,

I'm new to GlassFish. I've installed GlassFish 3.1.1 via the Eclipse Oracle utility plugin (download URL http://download.java.net/glassfish/eclipse/indigo) which gave me an Internal GlassFish 3.1.1 under Servers. (I needed to change the main port to 8081, but I don't think it matters.)

Server startup is fine, I can see the welcome page from which I go to the admin login. At the login neither entering admin//adminadmin nor admin//[empty password] is allowing me access to the admin console.

What's wrong? What's my password? Isn't one set automatically?

Karsten
12 years ago
Hello,

please follow the URL: http://www.bbstats.net/home

This is just a test HTTP servlet running in parallel to the Seam 2/Hibernate/RichFaces webapp. The exception you see there stems from the code:
This just reads a few entities to see if they can be found. Of course I'm not using transactions in the servlet setup at hand which I should be doing, but since this is for testing purposes only I left them off.

I believe I've never tested this servlet and now after months I did and an exception is thrown:
Note the part:

The last packet successfully received from the server was 1,933,172,030 milliseconds ago. The last packet sent successfully to the server was 1,933,172,031 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.


QUESTION: Could it be that the very old code line
is causing this because the EntityManager should actually be created in the doGet method instead of at servlet init (instantiation)?

Thanks
Karsten

PS: the 1,933,172,030 msec are ~22,5 days and that is around the time I last restarted the server.
12 years ago
You mean render=":repo-form:repo-edoc-datatable"... this works.

But what is the policy here? I thought the : syntax is for components outside the current form. Isn't there a form-local syntax? (I tried to use render="@form:repo-edoc-datatable" but this just resulted in another exception: @form:repo-edoc-datatable : Invalid id keyword specified for 'render' attribute...)

Thanks
Karsten
12 years ago
JSF
I have a repository of files, there's one tab for each type, here only external documents. They're listed per tab via data table. Don't be irritated by the sub tables, it's just for grouping certain files to a company. There's a delete commandLink to the right of each data table entry which pops up a dialog asking if s/he really wants to delete the file. On deletion, I want to update the list of files of course.

I have the following code:
Note the AJAXed h:commandButton above (it's a button on a RichFaces popup dialog to confirm deletion). Specifying simply works. Specifying to only update the necessary part/s results in a FacesException:

Why isn't JSF able to find any of the outcommented IDs above? Any explanation welcome.

Karsten
12 years ago
JSF
I've only used Seam 2 so far, no plain Java EE 5 or 6 before, so I have no experience with the overall Java EE programming model and/or newer patterns.

I've used Seam 2's EntityHome and EntityQuery mainly in a read-only application, that is I used EntityHome's for page navigation and the EntityQuery's to construct the actual pages. I can't say I was unhappy about that framework, even though it did have some issues.

Now I need to switch to Java EE 6 using CDI and the application also requires me to implement complex edit pages. Now I wonder in Java EE 6 (using CDI) what would be the (closest) equivalent to Seam 2's org.jboss.seam.framework classes in Java EE 6?

I'm kind of confused by the fact that in Seam 2 I only used a single kind of component, whereas in Java EE tutorials you deal with session beans and EJBs.

Can anybody clear this up for me a little? I'm really having trouble understanding the JavaEE concepts.

Karsten
Hello,

I've stumbled across this:

http://docs.jboss.org/weld/reference/latest/en-US/html_single/#example

It shows how to implement a login with JavaEE 6/CDI.

1. Why is the Credentials bean request-scoped and not session-scoped?
2. What's the purpose of the custom annotations @LoggedIn and @UserDatabase ("custom qualifier annotations"). Can anybody point me to good document explaining the principle behind this and why this programming model is necessary/desirable?

It seems to be core CDI, but unfortunately I'm short in time reading a lot documentation.

Thanks
Karsten
Hello,

I'm constructing an admin tool on top of my read-only pages. I put the admin .xhtml pages into a separate sub folder in the root dir:



This is a pretty basic structure (on the server).

Now the question: how do you best handle paths to resources from various directories in the hierarchy, here the root dir and the admin dir?

Example footer footer.xhtml:
The footer is included from /admin/home.xhtml and /team-list.xhtml, so from the root dir files the images work and from the admin files they don't. For whatever reason prefixing with a slash
neither works in the root nor the admin dir (image not found). Same with CSS of course.

I know JSF 2 comes with extensions concerning resources like the above by using library="...", but how is it done in JSF 1.2? Is it really necessary to somehow prefix all paths with a custom value depending on who is the "caller" (client)? I have the feeling I am missing something very fundamental about JSF/Facelets here, but I've had no luck finding out what it is.

Can anybody clear this up for me? (The biggest question to me still is why paths like "/images/..." don't work........)

Thanks
Karsten
12 years ago
JSF
OK thanks, so I asume the rest is pretty much evenly balanced. I'll have to give it a try then.

Karsten
Hello,

has anyone recently visited the new JPA certification exam?

Based on this thread:

https://coderanch.com/t/510020/java-EJB-SCBCD/certification/JPA-Certification

the BETA exam was obviously very much about the Criteria API (~50%). Is that still the case with the final release of the exam?

Karsten
Correct, thanks! I was copying standalone.xml to and from my localhost and I must have overwritten the server file sometime without noticing.

Karsten
12 years ago
This is what I thought: max + perm space, I wonder where such facts can be found...

So I'll have to do some math now, how to split up the ~640MB that I have left.

320 + 256 = 576 MB + small buffer, or should I do 384 + 192 perm or 320 + 192 perm. I'll just try I guess.

Thanks
Karsten
12 years ago
OK I set JAVA_HOME in ~/.bash_profile and it shows up.

When starting the server with the -Xmx512m I get the very same error as in my OP. (I did relogon!)

Karsten
12 years ago