John Semler

Greenhorn
+ Follow
since Dec 11, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by John Semler

Made the following changes:

1) Switched to Container Managed Persistence (see code below).
2) Copied "mysql-connector-java-5.1.18-bin.jar" to "/home/glassfish/glassfish/domains/domain1/lib/ext"

Works perfectly!

ZIPCode.java

persistence.xml

glassfish-resources.xml
5 years ago
I'm also getting a lot of these errors. Keeps adding to the server log when I'm not doing anything. Probably a significant clue.



No error with another JPA module running in an EJB (it uses mysql_ephemeris_db_rootPool).
5 years ago
I was putting the finishing touch on my logic, but something happen and I was never able to recover - getting the following error mostly now. Been racking my brains for 6 hours.

The class in question below does have the @Entity annotation so I don't know where to go with this. I'm relatively new at this so I appreciate any help!

I'm developing under Linux using NetBeans 7.2 and GlassFish 3.1.2.



ZIPCode.java (blows up at line 31):

ZIPCodes.java (auto-generated):


persistence.xml:

glassfish-resources.xml:
5 years ago

Paul Clapham wrote:Here's what I did:

(1) Create a local copy of the demo page which was linked to from that tutorial which you linked to.

(2) Run that local copy in my browser -- applet shows up okay.

(3) Replace the base-64 string by garbage and run again -- applet shows up okay. (This was your experience too, right?)

(4) Remove the applet from my Java cache.

(5) Run the garbage version of the local copy again -- applet does not run.

So it looks like caching is confusing the issue. (As it so often does.)



Seeing this example work from a different perspective gave me the confidence I needed to pursue this further.

It turns out I needed to set the JNLP update "check" attribute to "background". It was set to "always" meaning it has to first reference the copy stored on the server. So if the server was down, the applet would not launch.

It's working fine now.

Thanks for your help!
5 years ago

Paul Clapham wrote:I would assume that the people at Oracle didn't just throw the feature out into the real world without doing some testing. So my guess would be that yes, people have successfully used the feature.



The problem I'm having is I wouldn't know if it works or not as the behavior is still the same even if I substitute junk data for the "jnlp_embedded" attribute.

I'd like to be able to verify my work.

Does anyone know a way to check?
5 years ago
Does "Embedding JNLP File in Applet Tag" really work?

This link says it does: http://docs.oracle.com/javase/tutorial/deployment/deploymentInDepth/embeddingJNLPFileInWebPage.html

I assigned junk data to the "jnlp_embedded" attribute and my applet still works! But it will never work without my jnlp_href attribute.

I'm not convinced that this works.

Has anyone successfully used this feature?

Thanks!
5 years ago

William Brogden wrote:Probably the reason "http://localhost/jws/Calculator.jsp" does not execute is that your local Tomcat does not think that "jws" is a legal web application.

Study the way the applications that Tomcat comes with are configured.

Bill



You got me thinking what was really happening at the hosting service implementation. The clue was that the WEB-INF directory appears inside my "httpdocs" directory. They do not allow users to upload war files for a reason:


Support Center » Knowledgebase » Tomcat (JSPs/Servlets) » Are .war files supported on your servers?

Solution In our shared Apache/Tomcat implementation, .war files are not supported (noted on our main website). You must unarchive your .war into your httpdocs directory. The container-standard /WEB-INF directory structure is preprovided.
...



My "jws" directory along with all the web files are loaded into the httpdocs directory.

On my localhost, I made junctions back into my WebContent development directories.

First, I shutdown the Apache and Tomcat service. Then renamed the Tomcat directories "webapp/ROOT" to "webapp/ROOT.bu' and "webapp/servlet" to "webapp/servlet.bu" to get them out of the way.

These are the commands I used to establish links back to my WebContent development directory:



Then I copy the files from the renamed servlet.bu into D:\home\jsemler.net\WebContent and restart the Apache and Tomcat installation.

http://localhost/jws/Calculator.jsp now works under my system.

Not an elegant solution but it works. I would also lose my Tomcat Manager Web page and the ability to use war files (because I took over "ROOT"). I only possess rudimentary knowledge of how to configure Apache/Tomcat/Windows 7 system so my chances are low in finding a better solution without investing a lot of time.

Thanks!
6 years ago
On the hosting service, the path http://jsemler.net/jws/Calculator.jsp invokes my Java webstart Calculator application.

But Apache2.2 web server can't pass "http://localhost/jws/Calculator.jsp" for processing to the Tomcat 6 server on my local test machine.

My httpd.conf file has the following lines:



This is what the hosting service has to say about mount directives:

Under the shared Apache/Tomcat implementation as we have here (per Apache’s specifications and industry-standard for a shared platform), all requests go through Apache first, and as such, specific mount directives have to be defined in Apache to pass the JSP/Servlet/Mapping from Apache to Tomcat (otherwise Apache will assume it should try processing the request). By default, the directives we pass are:

We pass the three standard mount directives:

*.jsp
/servlet/*
/servlets/*



How do I configure the my local Apache/Tomcat system to behave more like the hosting service?

(I struggled for far to long with this, I'm not an expert with Apache/Tomcat configuration and may be looking at the wrong things)

Thanks!
6 years ago
The solution to this problem is simple, add the parameter "initial_focus: false" to the parameters section like this:



No more mouse wheel lockup!
6 years ago
I'm having a problem with my MoonClock JApplet when it starts up on my main web page. It appears that the mouse wheel is disabled for the web page after the applet starts up. About the only sure fire way to free up the frozen mouse wheel is to click on the face of the applet. It will lockup again after each page refresh.

To see a really simple JApplet example that exhibits these same symptoms, click on the following link: http://chortle.ccsu.edu/java5/Notes/chap36/ch36_2.html

Is there any code I can insert in the JApplet "init()" or "start()" routines to pass the mouse wheel focus (for a lack of a better term) back to the web page?

Thanks!
6 years ago
Thanks!

I've converted over to the Dynamic Attributes method. I now have 3 tags defined to take care of the similiar situations involving checkboxes and select options. I put the definitions all in one file.

EphemerisTags.tld:

Checkbox.java:

Option.java:

Radio.java:

Here are my code fragments that shows how I use my tags to simplify my programming of checkboxes, radio, and select options (I maintain a name list of checked items for my check box group in the EL expresion "ephemeris.reductions"):

ephemeris.jsp:

With Month drop down box set to "December", Reduction checkboxes all checked, and Catalog DE200 radio button selected, it renders as:

I coded up a tag so I can avoid getting the warning messages.

This is what I coded in my JSP ("ephemeris.jsp"):



This is what gets rendered to output after selecting "DE405" ("View Source" from browser client):




*****************************************************************************************

How did I implement my tag?

Here's my Java code that writes the replacement XHTML code ("Radio.java"):



Here's my tag library descriptor ("RadioTag.tld"):



*****************************************************************************************

If anybody can come up with an explanation as to what was wrong with the orignal coding, I'd still be interested in knowing.

Just saw the Dynamic Attrribute tutorial for tag programming, Java Ranch is a great resource!
I'm trying to remove all scriptlets from my JSP file. Since I'm working on getting my SCWCD certification, I thought I would ask the question here.

The following JSP code works:



But Eclipse gives me the following warnings:

Description Resource Path Location Type
Undefined attribute name (:). ephemeris.jsp /servlet/WebContent line 244 JSP Problem
Undefined attribute name (:). ephemeris.jsp /servlet/WebContent line 246 JSP Problem
Undefined attribute name (:). ephemeris.jsp /servlet/WebContent line 248 JSP Problem
Undefined attribute name (DE200). ephemeris.jsp /servlet/WebContent line 244 JSP Problem
Undefined attribute name (DE405). ephemeris.jsp /servlet/WebContent line 246 JSP Problem
Undefined attribute name (DE406). ephemeris.jsp /servlet/WebContent line 248 JSP Problem
Undefined attribute name (ephemeris.catalog). ephemeris.jsp /servlet/WebContent line 244 JSP Problem
Undefined attribute name (ephemeris.catalog). ephemeris.jsp /servlet/WebContent line 246 JSP Problem
Undefined attribute name (ephemeris.catalog). ephemeris.jsp /servlet/WebContent line 248 JSP Problem


Here's the result of the HTML rendering ("view source" on web browser). This is the correct result after selecting "DE405".



Is there something wrong with the way I use the expression?