Christopher Frankland

Ranch Hand
+ Follow
since Jan 22, 2005
Merit badge: grant badges
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Christopher Frankland

Sridhar Santhanakrishnan wrote:toArray() returns an Object[] which cannot be typecast to Trip[] as Object is not a subclass of Trip. But maybe you can use System.arraycopy() (but am not sure).



Thanks Sridhar. Forgot to pass Trip into personTrips.toArray() as a parameter.
Hi,

I am running through a Hibernate Travel application and need some help with the following code. Everything works up until the line "trips4Person = (Trip[])personTrips.toArray();", where I receive a "java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ltravel.Trip;"



Trip and Person are java beans. I have debugged it to the last line and it all works ok, but for some reason the cast to Trip is not working.

Any help would be much appreciated!

Thanks.
Thanks Ulf. Off to do a bit of reading. One last question. Do I need to update the wsdl:address portion of my WSDL to point to HTTPS port 443?

15 years ago
Cheers Ulf. Is there anything else that needs to be added to the web service?

Also, am I correct in thinking that SSL and WS-Security are two different things altogether? I am a little unclear on the latter since I thought it was something that had to be hand coded into the web service? Or does WAS take care of that for me?

Thanks again.
15 years ago
Hi,

I have a simple web service that I deployed to my websphere application server and I have a quick question regarding SSL. My WAS instance has what is called a default "SSL configuration repertoire".

What do I need to add to my web service to force it be used over an SSL connection? I deployed the web service, but I am a little bit confused over how to get it to run with SSL. Also, what role does the <web-resource-name> play in the web.xml? Is it supposed to match up with anything?

Here is my web.xml for the web service:



Any help would be much appreciated.

Thanks.
15 years ago

Tony Docherty wrote:

testapp.jar ->

ar/mq/mqBrowse.java
META-INF/MANIFEST.MF
jndi.jar
connector.jar
com.ibm.mq.jar


You can't include jar files inside other jar files.
Your manifest file should have a Class-Path entry listing each of the jar files you need to reference, see the Sun Tutorial.



Interesting. I compiled the JAR file using the following:

jar cfvm testapp.jar META-INF\MANIFEST.MF *.jar ar/mq/*.class

It generates the testapp.jar file places the jar and class files into that jar. I now deleted the files and folders that I don't need to execute the jar and my folder now contains the following:

testapp.jar
com.ibm.mq.jar
jndi.jar
connector.jar
testapp_prop.properties

Executing testapp.jar now works! However, if I remove the other jar files from the folder and execute it, I get a missing class error, presumably because it requires the jar files.

One last question. I think I understand what is happening, however, why is it the other JAR files (mq.jar etc) are able to be packaged within testapp.jar if they are not reachable? It would be nice to have just one single executable jar file.

Thanks for the assistance.


15 years ago

Ulf Dittmer wrote:What's the internal structure of the jar file?

What are the contents of the manifest file?



Hi there,

Internal structure of JAR is as follows:

testapp.jar ->

ar/mq/mqBrowse.java
META-INF/MANIFEST.MF
jndi.jar
connector.jar
com.ibm.mq.jar

MANIFEST.MF contents:

Manifest-Version: 1.0
Class-Path: com.ibm.mq.jar jndi.jar testapp.jar connector.jar c
onfig/
Sealed: true
Main-Class: ar.mq.mqBrowse.java


The weird thing is, if I copy all of these files into the SAME folder as the JAR file, then it works. I would like to just have a single JAR, however and be able to execute it by itself.

Thanks!
15 years ago
Hi,

I have created an executable JAR file testapp.jar that contains a properties file. The folder structure is as follows:

TestApp (folder name)
testapp.jar
testapp_prop.properties

When I execute the jar file: "java -jar testapp.jar", I get a "NoClassDefFoundError".

The jar file in the TestApp folder was compiled beforehand and contains the META-INF manifest file and all other classes.

Why is this not working? Advice much appreciated.

Thanks.


15 years ago
Hi,

We have a requirement to loop through a folder of images (around 1000) and insert all of them to a database. Is there an 'easy' way I can do this using SWT/JFace? Ideally, the user would be able to select all of the images they would like to upload.

Any feedback much appreciated.

Thanks,

Christopher
15 years ago
Thanks Bear. I thought as much. Is there an alternative solution to achieve said functionality? A client based app. would be acceptable.

Cheers.
16 years ago
JSP
Hi,

Users can currently upload a single file within my JSP by browsing to the specified file. Works without any problems. However, a recent requirement now requires the user to be able to select a folder and have all images/files within that folder uploaded.

How can I provide this functionality within my JSP and servlet?

Advice much appreciated.

Thanks.
16 years ago
JSP
Hi,

I am sure there must be a simple explanation for this, however, I can't quite see it at the moment. The following value of the session var storeType is coming out as NULL.



Any ideas why I am getting NULL for the session.getAttribute("storeType")?

Thanks.
16 years ago

Originally posted by Rob Prime:
Change into
In your current situation, you are NEVER going forward on your iterator. It keeps pointing at the first element.



Rob...spot on! I thought I was advancing the loop in the for increment. Thanks v. much for pointing that out.
16 years ago

Originally posted by Joe Ess:



Do you really want to be creating a new instance of ImageVO, then creating an Image instance from it with what would presumably be a null byte array?



Joe, probably not. I haven't used a byte array like this before as part of a VO, so any suggestions you can make would be gratefully received

Thanks.
16 years ago
Hi,

Any help with this would be much appreciated. I have a DAO that I am using to retrieve BLOB images from a database. Upon retrieval, I write them as byte[] types to my Java bean. My PrintPDF servlet class is simply looping through my VOs and accessing each image. The problem is, when we hit the PrintPDF class, the server hangs and CPU for the Portal Server is at 70%.

What am I doing wrong?

GetImagesDAO:


ImageVO:


PrintPDF:


Any help would be much appreciated

Thanks.
16 years ago