Andrew Och

Ranch Hand
+ Follow
since Mar 19, 2004
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Andrew Och

I get similar problems and found a solution from google search, but don't understand why this is necessary:

10 years ago
Sorry for posting in wrong place. I really did think about posting in applets, but at the time I felt it might be better to post here, because its to do with AOP. You are quite right to move it to applets though.
14 years ago
Has anyone found a way to perform just-in-time-translation weaving with java applets. I know that compile time weaving works very well, but I really am looking for run-time weaving solution. Is there a way to do run-time weaving in applets not using the Class Loader.

I searched and searched for ways to do run-time weaving to no avail. I have read and re-read Sun's explanation security explanation on: http://java.sun.com/sfaq/#appletCL that states "A web browser uses only one class loader, which is established at start-up. Thereafter, the system class loader cannot be extended, overloaded, overridden or replaced. Applets cannot create or reference their own class loader." Also I am not looking for just a hack or security hole like that described in Applets Running Wild: "http://www.securingjava.com/chapter-five/chapter-five-8.html" and the Evil Class Loader, because I need to sell the solution to my team and my boss.

If anyone has any help or advice on a way of doing run-time weaving in applets please let me know I am prepared to try any avenue.
14 years ago
Dear Marc

Thank you for your response. Actually we are not using Spring RCP just pure Spring and embedding the applet in a jar combined with Jetty (embedded Jetty server).

My colleague Mr. Zhang Han found a solution to this problem/error displayed in previous post:



The above snippet was added to the Jetty's Context handler.

The problem was caused by Jetty redirecting to the root context when receiving an invalid URL (naturally it needs at least the root context in the url). Rather then giving an error 404 it would then return html. However the java.beans.Introspector which searches for BeanInfo before analysising the class (this search in the applet effectively inputs an invalid url). The java.bean.Introspector then no longer anaylsed the bean because BeanInfo had data (html). Then the class loader tries to load the BeanInfo class which is actually only html. Ugh. The above fixes this :-)

Although this then removed the problem. He hit another problem which was related to permission and this was solved by signing all the jars.

Andrew & Han
[ July 03, 2008: Message edited by: Andrew Och ]
Has anybody managed to get Spring to work within a java applet?

We using Spring 2.5 to initialise an applet. Our requirement is to provide a user interface both as a Swing standalone and web enabled version (applet) to run by Jetty.

Our Swing version works fine. However when we try to run the same code in an applet, we get the error seen below

The applet code is quite simple. Any help or advice warmly welcome.




[ July 03, 2008: Message edited by: Ulf Dittmer ]
I had the same error message, but only in Eclipse (version 3.3).

I did not get the error on command line. I had setup up ANT_HOME variable correctly and copied the jakarta-oro-2.0.8.jar and commons-net-1.4.1.jar to %ANT_HOME%\lib

However it seems that the ANT Eclipse module does not automatically parse the %ANT_HOME%\lib directory for new jars and I had to add them manually

(preferences->Ant->Runtime, Classpath tab, Ant Home Entries -> Add External JARs...)

Then it worked.
14 years ago
One of our more important customers has a problem, our PM in the US calls us and says this problem must be resolved immediately (7.30am Shanghai). So we must drop everything we are doing, i.e. "But couldn't I just finish this.."
"NO!"

So I leave a task half done and move onto the higher priority issue.

Posted by Jeanne Boyarsky :
What I'm not ok with is things staying broken. It reminds me of the sentiment that it's ok to move on to the next task and leave the first one half completed.



And then its 7pm in the evening and I want to go home and my block of code has broken several tests. Its been a long long day. So it stays broken until things calm and I get a chance to fix them. I don't want to roll back, because it is just little things left to do.

Staying broken, means that each regression run nags me to fix what I broke.
15 years ago
Dear Hani, Cedric and Jeanne

First of all thank you very much response to my questions, I didn't expect it :-)

To Jeanne, my questions are all framed at developer level testing. I am very cynical when it comes to Quality Assurance level testing, mainly because of my experience, the Quality Assurance Managers' bonuses were based on getting a higher CMMI level during assessment and so for them quality means ticking boxes on checklists. To be fair R&D centers in China are full of fresh inexperienced graduates and a high CMMI rating implies that they are mature enough to get the job done.

To Hani, I really struggled with Cactus and turned to HtmlUnit, but that meant that the test cases generated were leaning towards functional tests rather then unit tests. At the moment I am working on a lot of legacy code (mixture of Korn Shell scripts and Perl). We are now creating a lot of functional tests, just as you say. Our users/customers give us bug reports :-) and our new policy is to create an automated test case first using Perl's Test::Unit, then fixing the bug or developing the enhancement. So I feel we are definitely moving in the right direction.

To Cedric, I worked for Siemens in Nanjing and now work for HP in Shanghai. As I say my colleagues are generally fresh graduates and I believe they are genuinely passionate about coding. You have however hit the nail on the head, we are testing legacy, boring code. It is the nature of the business I believe, to reduce development costs by moving support and maintenance of older code/products to low cost countries.

My second question was phrased badly. Let me put it into context, testing and process. We write test plans, then test cases, then execute the test case and write test reports. There is a lot of duplication of effort, e.g. the textual description of a test case goes into the test plan, test case and test report (sure you can cut and paste). However having a centralized xml file as a source manuscript for all would be ideal. One that works for TestNG and also perhaps Apache Continuum and is the bases of my test plan and is the descriptive input to my test report, output as a pdf. Thus the bureaucratic aspect of testing is covered by one or two xml files and a set of tools. A testing framework should offer that shouldn't it?

Although I have to admit my original question was hinting towards the fact that this is another xml/configuration file, on top of many others and may pull people away from using conventions, defining convention busting test cases simply because they can using. I guess I am still a little skeptical of the xml panacea ;-)

Finally I do feel reinvigorated about testing and will during my lunch breaks talk up testing as the new cool thing and those who don't test "just don't get it".

Once again thank you very much for your answers, they are very much appreciated by me.

Andrew
15 years ago
Dear Cedric and Hani

I have been working as a software developer in China for just under 5 years in two separate and large international companies. Both companies are here to get the "China Price" for research and development and both appear to have very similar problems, i.e. quality.

Both companies see testing, as the answer to their quality problems, but theory and execution seem be miles apart.

Problem 1, Testing is boring. It must be because in my previous company and current, if you ask a tester if they like their job, they say "no, it's boring" and they would rather be developers. In fact my previous company would do a written exam during interview day and those with high scores became developers, those with low scores became testers. In my current company I asked where the tests are located on our Clearcase server and was told there aren't any. Development time pressure meant there was no time to write any. The project I joined is 7 years old :-)

So will this book make testing sound sexy?

While this question may sound flippant, it is not, until testing is seen as sexy and cool and fun (like software development), it will not attract talented people. Since you are both talented, what attracted you to testing?

Problem 2, Confusing plethora of testing extension. I used HttpUnit for testing an Oracle ADF application (now Apache Trinidad) and it failed to deal with JavaScript. HtmlUnit saved me, as did Javaranch :-). It was also a J2EE application, but our team was never given enough time to setup Cactus to test it properly. We had JMeter setup a little to test performance. Cynically I feel that our testing, test plans and test reports were contained in our project to ensure we passed our CMMI assessment.

Does this new framework provide one type of interface for all of this testing (the xml file), thus reducing test extension setup time?

I really hope so.

Andrew
15 years ago
Dear Cedric and Hani

I have been working as a software developer in China for just under 5 years in two separate and large international companies. Both companies are here to get the "China Price" for research and development and both appear to have very similar problems, i.e. quality.

Both companies see testing, as the answer to their quality problems, but theory and execution seem be miles apart.

Problem 1, Testing is boring. It must be because in my previous company and current, if you ask a tester if they like their job, they say "no, it's boring" and they would rather be developers. In fact my previous company would do a written exam during interview day and those with high scores became developers, those with low scores became testers. In my current company I asked where the tests are located on our Clearcase server and was told there aren't any. Development time pressure meant there was no time to write any. The project I joined is 7 years old :-)

So will this book make testing sound sexy?

While this question may sound flippant, it is not, until testing is seen as sexy and cool and fun (like software development), it will not attract talented people. Since you are both talented, what attracted you to testing?

Problem 2, Confusing plethora of testing extension. I used HttpUnit for testing an Oracle ADF application (now Apache Trinidad) and it failed to deal with JavaScript. HtmlUnit saved me, as did Javaranch :-). It was also a J2EE application, but our team was never given enough time to setup Cactus to test it properly. We had JMeter setup a little to test performance. Cynically I feel that our testing, test plans and test reports were contained in our project to ensure we passed our CMMI assessment.

Does this new framework provide one type of interface for all of this testing (the xml file), thus reducing test extension setup time?

I really hope so.

Andrew
15 years ago
Dear Ulf

You are absolutely correct, and I am just a muppet.

HtmlPage.getFrameByName("mainframe")

followed by

FrameWindow.getEnclosedPage()

Gives me the HtmlPage that I am after.

Thank you very much for your help.
15 years ago
I have played with getFrameByName and getFrames. What I am after is the web page inside these frames.

I wish something like this would work:
HtmlPage mainPage = (HtmlPage) myPage.getFrameByName("mainframe").getPage();

but getFrameByName() returns a FrameWindow object which I dont know how to use and in my case specifically the contents are printed out I have:
<frame src="ident.asp" noresize="" name="mainframe" target="_top" border="0">

Which is just one part of myPage.
15 years ago
I am using HtmlUnit to test a website.

My problem is that the first page returns a set of frames.

// Get the web page from the URL
final HtmlPage framePage = (HtmlPage) webClient.getPage(url);
System.out.println(framePage.asXml);

prints a page with 3 frames and I want to work on the main frame.

How do I get that main frame as an HtmlPage?


Sigh I am stupid.
15 years ago
I am pretty new to JBoss myself, but ran into similar problems with deploying datasource xml files (e.g. in my current project when I would deploy a new rdcs-mysqldb-ds.xml file, just changing the IP address of the Database server it would not switch).

I found that removing the datasource file and deleting the tmp and work directories, then starting JBoss, and then putting the datasource file into the deployment directory and watching the command prompt/logs to see if the data source would bind correctly. Its a bit drastic I guess, but it worked for me.

Actually the best thing we did in our project was write an Ant deployment script that packaged everything into an .ear and also copied the -ds.xml file in the correct place and then we gained a lot of stability in our project development.
16 years ago
I am using Hibernator with Eclipse 3.2, Hibernate3 and MySQL.

Whenever I try to create a connection in the Connection View I get the following message in the Hibernator Log:

Ignoring resources in Project output: /RDCS-WS/WebContent/WEB-INF/classes

Does anyone know how to resolve this?