Ron Alby

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

Recent posts by Ron Alby

I am under corporate constraints. There is no standard build mechanism here, no continuous integration, etc. But what we do have is a very restrictive set of rules governing the deployment of programs into production.

We are currently just using eclipse to do the builds for us - it is simple, it works, it is consistent, and doesn't require a bunch of extra effort. When we use eclipse to export to a runnable JAR, we have an option for dependent libraries to go into a separate folder. Is there some way (other than messing with Ant scripts) to get eclipse to put dependent property files into a separate folder?

If property files are included in the JAR, then you must touch the jar to modify a property. Where I work it can take an hour to get permission to modify a production property file, but several days if you want to touch a jar file that is in production (even if you are just touching it to modify a property file). So, it is to our advantage to keep our property files separate from the JAR file. It would be more consistent if there was a standard automated approach for us to use.

It seems like this should be a fairly common requirement ... I'm hoping that maybe someone did an extension of the default export wizard that meets our needs. If not, is there someone on here with experience creating plugins and/or extending existing wizards that could throw me a bone?
Well - it appears that something was just stuck out in Websphere. I removed amy application from the app server, bounced the app server, then reloaded the application back on it. The error went away.

I don't know ... when you're dealing with Websphere sometimes I think it matters what direction you're facing when you click the mouse button.
7 years ago
We have just moved to RAD 8.5, and I am having issues (which may be due to the move, or more likely due to my ignorance).
I have an EAR file - it has two modules (OnfsTh.war and FtpReInsEjb.jar). The war file contains a web service that then drops a message onto a JMS bus for the MDB inside the ejb.jar file.

As part of the onMessage processing, the MDB calls classes in several Utility jar files. Everything worked find until I added another call in onMessage to class in a new jar file. It is able to find classes in the other jar's (both open source jars and jars from other projects) just fine - but when I come to the TiffToTiff jar, I get a Class Not Found error. Everything compiles fine - all the spelling is fine - but it can't find TiffToTiff. I am at a loss.

RAD doesn't appear to be putting any classpath information in any Manifests - but since it can find the other classes in the other jars, I stopped going down that path.


CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "onMessage" on bean "BeanId(OnfsThEAR#FtpReInsEjb.jar#FtpReInsMDB, null)". Exception data: java.lang.NoClassDefFoundError: com/onfs/tifftotiff/TiffToTiff
at com.onfs.thunderhead.ftpreins.FtpReInsImpl.getAttachmentList(FtpReInsImpl.java:95)
at com.onfs.thunderhead.ftpreins.FtpReInsImpl.processWsCall(FtpReInsImpl.java:178)
at com.onfs.thunderhead.ftpreins.FtpReInsMDB.onMessage(FtpReInsMDB.java:53)
at com.ibm.ejs.container.MessageEndpointHandler.invokeMdbMethod(MessageEndpointHandler.java:1164)
at com.ibm.ejs.container.MessageEndpointHandler.invoke(MessageEndpointHandler.java:843)
at $Proxy37.onMessage(Unknown Source)
at com.ibm.ws.sib.api.jmsra.impl.JmsJcaEndpointInvokerImpl.invokeEndpoint(JmsJcaEndpointInvokerImpl.java:233)
at com.ibm.ws.sib.ra.inbound.impl.SibRaDispatcher.dispatch(SibRaDispatcher.java:901)
at com.ibm.ws.sib.ra.inbound.impl.SibRaSingleProcessListener$SibRaWork.run(SibRaSingleProcessListener.java:592)
at com.ibm.ejs.j2c.work.WorkProxy.run(WorkProxy.java:608)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1783)



Caused by: java.lang.ClassNotFoundException: com.onfs.tifftotiff.TiffToTiff
at java.net.URLClassLoader.findClass(URLClassLoader.java:434)
at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:198)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:665)
at java.lang.ClassLoader.loadClass(ClassLoader.java:644)
at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:113)
at java.lang.ClassLoader.loadClass(ClassLoader.java:627)
at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:62)
at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:58)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:583)
at java.lang.ClassLoader.loadClass(ClassLoader.java:627)
... 11 more

7 years ago
First: I apologize for how little I know on this subject. I am a non-web Java guy who has been brought in on an emergency where I work. I fully acknowledge that I am out of my element.


The code in question stores and retrieves values in the session object. However, it appears to me that we are actually dealing with multiple session objects (at least that is one possible explanation).

We are dealing with JSF, JSP, and plain old servlets; a JSP page invokes the plain old servlet:


The plain old servlet and the backing bean are trying to exchange values via the session object ... however the results are very strange. We do not appear to be getting back the same data we put in. In fact, in some instances it appears we are getting back data that was entered several hours previously in a completely different run.

On top of all this, we are running in a clustered environment so different things may well be executing on different boxes. We didn't uncover this behavior until they promoted to the cluster.

The JSF accesses the session like this:


The servlet accesses the session like this:


Any suggestions would be greatly appreciated.

RonA
9 years ago
JSF
After with a JAXB guy at work I think the best answer is:
Hand roll the opening MyDocument, have JAXB generate MyAddlData, append the Huge3rdPartyData, and then hand roll the closing MyDocument

Sorry for clogging up the forum.

RonA
I am working with an XML schema that is so big it destroys JAXB. There is absolutely nothing I can do about this.
I am working with a 3rd party application that sends me XML based on that huge schema.

I need to add additional information to the XML. I can not mess with the 3rd party application. However, I have approval to embed that huge 3rd party xml into an outer document, as shown below:



Please do not suggest that I read the 3rd party data into a Java object and then write it back out. Like I said, the schema for that data is huge and kills JAXB, XML Spy code generation, and every XML<->Java toolkit out there except Jibx - which I am not approved to use.

Additionally, I really don't want to go thru the overhead of unmarshalling all of that and then remarshalling it.

Is there a convenient way for me to accomplish this using JAXB?
  • Could I interrupt the JAXB output stream and insert the 3rd party xml?
  • Is there a convenient way for me to use <any> in the MyDocument schema to allow me to slip it in?
  • Any other ideas?
  • Do I hand roll the opening MyDocument, have JAXB generate MyAddlData, append the Huge3rdPartyData, and then hand roll the closing MyDocument?


  • Thank you for your input on this problem
    Thank you Paul.
    I moved to the listener and implemented the worker as you suggested.
    Its all good now.

    9 years ago
    Let me be more specific ... perhaps the issue is how I do the lazy loading.

    The user clicks on a node to expand it. The JTree calls the TreeModel method getChildCount, followed by a series of getChild. I currently do the loading in getChildCount. I must return out of this method with a number that the JTree will then use when it is laying itself out. Since I have no idea how many children there will be (if any), what number do I return?

    Lets say I get fancy and restructure my code so that I am fetching one level of children in advance. Again, based on network traffic, I may still be in a situation where they have clicked on a node that has not yet had its children loaded and still have to deal with the getChildCount issue.

    Thanks for taking the time to answer my question.
    9 years ago
    I have read several postings and several articles on lazy loading a JTree (using either the WillExpand event or writing a new TreeModel). One reason I want to lazy load is that I am populating the tree from a database over a somewhat slow network link. I am having difficulty wrapping my head around using a SwingWorker (or some other thread) to do the database access on demand - and my readings haven't cleared it up for me.

    I don't know that I need to get the data until the user clicks on the tree. If I, at that point, go off and get the data synchronously the Event Dispatch Tread will be hung up until the query returns. If I use a thread to get the data, what do I tell the tree while I'm waiting for the query to return? Do I tell the tree that the selected node has zero children, and then asynchronously add the children and programatically open up the tree? ... I haven't seen any example code doing something like that.

    Thanks
    9 years ago
    I previously developed an application running in a J2EE environment. In order to access the database I used an InitialContext to get a DataSource, and then use the DataSource to get the connection. This is all good. But now I need to develop additional programs which run the same queries against the same database and I want to reuse code.

    My Data Access Object currently is responsible for acquiring the connection. I could rewrite the DAO to have a connection passed in and leave the connection acquisition to the calling program (via DataSource for the J2EE application and via DriverManager for the stand-alone applications) Maybe that is the "Best Practice" pattern - and if so I will switch. However, I was wondering if there was a good way to provide a Context and DataSource for the stand-alone applications and leave the DAO alone.

    I understand that the applications could tie back to the J2EE environment for a context factory (I have two which already do this), but I do not want to go that route. It does guarantee that the J2EE app and the stand-alone apps are pointing to the same database, but there are problems. The URL for the actual database is fixed, but in my world the J2EE environment may go up and down and its URL can change over time (the reason for this is outside of my hands and the point of this question is not to debate whether this should happen or how to stop it from happening). Every time the J2EE server bounces we have to shut down, reconfigure, and restart the stand-alone programs - this is very ugly.

    It seems to me to be a good idea to have a standard way of acquiring (or faking out) a Context and a DataSource outside of a J2EE environment, and I was hoping someone had already addressed this issue and I just didn't know about it.

    Thanks
    Ron
    I considered that .. and considered setting the log4j.configuration system property. I didn't know if this was an appropriate approach in an app server (possibly clustered) environment or not - given all the prohibitions against file I/O. I wasn't sure if people were putting it in the DB or something.

    Thanks
    Ron
    After a brief struggle I found where to put the log4j property file in my WAR so that my WebService could find it.

    However, and advantage to having a property file is being able to change the logging levels on the fly without any recompiling - reassembling - redeploying. By sticking the property file in the WAR I have lost that advantage.

    What is the best practice to having the log4j properties defined for a J2EE app in such a way that they can be changed on the fly?


    Thanks
    Ron
    I created the wsdl and build the web services. I have expectedContentTypes values in the wsdl to support MTOM. My Websphere generated client runs just fine, and does send the MTOM data in binary.

    Here's the problem. When a client attempts to use wsimport to generate their client (hitting the http site), Websphere strips off the expectedContentTypes values and the client generates a non-MTOM client.


    Here's the wsdl:



    Here is what Webshphere returns for the wsdl:


    And here is the referenced xsd (which Websphere stripped out of my wsdl all by themselves):


    Note that all references to xmime:expectedContentTypes have been removed.
    10 years ago
    Unfortunately, I could not get that to work. Creating new simple double properties passing in the width in the constructor did not trigger the callback. When I used the actual stage properties it said they had to be read only properties. When I did a cast I got a cast exception.

    I gave up on binding and just tried to change the size in the callback of the read only property ... it's funny, the callback kept getting the updated size but the size never changed on the screen.

    At this point I'm about to set resize to false.
    10 years ago
    The bug is RT-19503

    It is currently in 'incomplete' state until I send sample code.
    10 years ago