This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 86955 - Blueprint samples tests fail sometimes
Summary: Blueprint samples tests fail sometimes
Status: VERIFIED FIXED
Alias: None
Product: usersguide
Classification: Unclassified
Component: SOA (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Tientien Li
URL:
Keywords: REGRESSION
: 87059 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-11 18:04 UTC by Mikhail Kondratyev
Modified: 2006-10-21 15:15 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
blueprint failing after first deploy (3.18 KB, application/octet-stream)
2006-10-11 21:13 UTC, lchang
Details
build.xml output (14.46 KB, application/octet-stream)
2006-10-12 16:40 UTC, Alexander Pepin
Details
junit output (4.15 KB, application/octet-stream)
2006-10-12 16:42 UTC, Alexander Pepin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Kondratyev 2006-10-11 18:04:59 UTC
Steps to reproduce:
 - restart App Server
 - undeploy all service assemblies from JBI node
 - create and deploy Blueprint 1 project
 - run tests - tests should pass
 - create and deploy BluePrint 2 project
 - run tests - tests will fail
There is some dependency, probably on runtime level between the project and
previously deployed projects. This can be reproduced not only with Blueprint 2
Comment 1 Mikhail Kondratyev 2006-10-11 18:06:37 UTC
This needs to be fixed or if the fix is a risky one this should be reflected in
the troubleshooting guide. 
Comment 2 lchang 2006-10-11 21:12:00 UTC
I get the same issue, but not with those steps.

In some cases, my first deploy of a Blueprint project will fail, but after a 
redeploy, it is then successful.  Please see attached logs.
Comment 3 lchang 2006-10-11 21:13:40 UTC
Created attachment 35122 [details]
blueprint failing after first deploy
Comment 4 Jun Qian 2006-10-12 00:37:39 UTC
Ling, I think you meant your test run after the first deployment sometimes
failed. The deployment always succeeds, right? 
Comment 5 lchang 2006-10-12 00:41:19 UTC
Yes, that is what I meant.  I am assuming that the deployment is succeeding, 
only from the "BUILD SUCCESSFUL" message that I am getting.  I have not 
checked the logs after a successful build to ensure that no exceptions were 
thrown during deployment.

But yes, the symptoms are the first deployment succeeds, but the test run 
fails.  Then after re-deployment the test run will pass.
Comment 6 Alexander Pepin 2006-10-12 16:40:52 UTC
Created attachment 35146 [details]
build.xml output
Comment 7 Alexander Pepin 2006-10-12 16:41:41 UTC
Unfortunately I can't give exact steps to reproduce this bug but in my case I
got following results:
- all 5 blueprint samples were deployed successfuly according to build.xml log
- result of testruns:
BP1 - pass
BP2 - pass
BP3 - fail
BP4 - fail
BP5 - pass
I've attached junit output and build output for one of BP3's test. May be it
helps  somehow. I also want to notice that in fact BP3 and BP4 weren't deployed
correctly. When I tried to get a wsdl via browser (navigate to
http://localhost:12100/wsdl/purchase/PurchaseOrder/Servicelocation/bp3?wsdl) I
got an error instead. It shows that the service was not deployed and the server
log says the same (No web service mapping exists for the requested URL.
/wsdl/purchase/PurchaseOrder/Servicelocation/bp3 at port 12,100).
Comment 8 Alexander Pepin 2006-10-12 16:42:37 UTC
Created attachment 35147 [details]
junit output
Comment 9 Mikhail Kondratyev 2006-10-13 08:11:20 UTC
This looks like a regression introduced in the last runtime drop
Comment 10 _ hong_lin 2006-10-13 19:47:23 UTC
Please see IZ87059 (http://www.netbeans.org/issues/show_bug.cgi?id=87059) for
more detail.

Comment 11 _ hong_lin 2006-10-13 19:52:38 UTC
*** Issue 87059 has been marked as a duplicate of this issue. ***
Comment 12 Tientien Li 2006-10-16 21:37:17 UTC
The problem was casued by cached wsdl models in XAM. The CompApp project build 
ant task picked
up cached models created by pervious builld because identical keys were used 
to access models.

Fix:
We replace the uri-based key with system time. It ensures that a new model 
will be created for
each build. The fix has been checked in into release55_dev. The following is 
the CVS diff:

Index: 
antsrc/org/netbeans/modules/compapp/projects/jbi/anttasks/wsdlRepository.java
===================================================================
RCS 
file: /cvs/enterprise/compapp/projects/jbi/antsrc/org/netbeans/modules/compa
pp/projects/jbi/anttasks/Attic/wsdlRepository.java,v
retrieving revision 1.1.2.11.2.3
retrieving revision 1.1.2.11.2.4
diff -r1.1.2.11.2.3 -r1.1.2.11.2.4
212a213
>         Date d = new Date();
228c229,230
<         ModelSource ms = loadModel(inputStream, entry.getName(), false);
---
>         // ModelSource ms = loadModel(inputStream, entry.getName(), false);
>         ModelSource ms = loadModel(inputStream, "JBIPRJ"+d.getTime(), 
false); // NOI18N


We also monitor the heap useage after running the compapp project builds 
continuesly for 1/2 hour.
The GC works great and cleans up the heap memory every 5 to 10 builds.

Comment 13 Tientien Li 2006-10-16 21:42:55 UTC
Added cvs diff -c -u output:

diff -c -u -r1.1.2.11.2.3 -r1.1.2.11.2.4
cvs server: conflicting specifications of output style
--- 
antsrc/org/netbeans/modules/compapp/projects/jbi/anttasks/wsdlRepository.jav
a       11 Oct 2006 19:24:41 -0000      1.1.2.11.2.3
+++ 
antsrc/org/netbeans/modules/compapp/projects/jbi/anttasks/wsdlRepository.jav
a       16 Oct 2006 18:51:40 -0000      1.1.2.11.2.4
@@ -210,6 +210,7 @@
         ZipEntry entry = null;
         InputStream inputStream = null;
         ArrayList xwsdls = new ArrayList();
+        Date d = new Date();
         for (Iterator iterator = reverseIterator(seJarPathLocations.iterator
()); iterator.hasNext();) {
             seJarPath = (String) iterator.next();
             if(seJarPath != null) {
@@ -225,7 +226,8 @@

                             if (fileName.endsWith("wsdl") || fileName.endsWith
("xsd")) {
                                 inputStream = seJarFile.getInputStream(entry);
-                                ModelSource ms = loadModel(inputStream, 
entry.getName(), false);
+                                // ModelSource ms = loadModel(inputStream, 
entry.getName(), false);
+                                ModelSource ms = loadModel
(inputStream, "JBIPRJ"+d.getTime(), false); // NOI18N
                                 inputStream.close();
                                 inputStream = null;
                                 if (fileName.endsWith("wsdl")) {
Comment 14 Tientien Li 2006-10-16 22:59:33 UTC
updated the code to use System.currentTimeMillis() recommended by Chris W.
Comment 15 Tientien Li 2006-10-17 18:43:59 UTC
The fix has been checked in into both release55_dev and release55

> Oops.. my bad, forgot another change. Too much multi-tasking is not very
> productive. I completely forgot about this change made last Friday in one
> branch of code when switching to a new branch yesterday. I will check it
> into release55_dev now and send Ling Ling a copy for testing.
Comment 16 Tientien Li 2006-10-17 18:45:36 UTC
CVS diff

diff -c -u -r1.1.2.11.2.7 -r1.1.2.11.2.4
cvs server: conflicting specifications of output style
--- 
antsrc/org/netbeans/modules/compapp/projects/jbi/anttasks/wsdlRepository.java  
     17 Oct 2006 14:17:39 -0000      1.1.2.11.2.7
+++ 
antsrc/org/netbeans/modules/compapp/projects/jbi/anttasks/wsdlRepository.java  
     16 Oct 2006 18:51:40 -0000      1.1.2.11.2.4
@@ -156,7 +156,7 @@
         return wsdls;
     }

-    private ModelSource loadModel(InputStream modelIn, String baseURI, String 
key, boolean editable) {
+    private ModelSource loadModel(InputStream modelIn, String baseURI, 
booleaneditable) {
         ModelSource model = null;

         try {
@@ -176,7 +176,7 @@
             //Document d = new PlainDocument();
             //d.insertString(0, text, null);
             // Lookup adding cm and d
-            File fakeFile = new File(key);
+            File fakeFile = new File(baseURI);
             Lookup lookup = Lookups.fixed(new Object[]{d, acm, fakeFile, 
org.netbeans.modules.xml.xam.dom.ReadOnlyAccess.Provider.getInstance()});
             model = new ModelSource(lookup, editable);
             // System.out.println("Model created: "+baseURI+", "+model);
@@ -210,7 +210,7 @@
         ZipEntry entry = null;
         InputStream inputStream = null;
         ArrayList xwsdls = new ArrayList();
-        long lastTime = 0;
+        Date d = new Date();
         for (Iterator iterator = reverseIterator(seJarPathLocations.iterator
()); iterator.hasNext();) {
             seJarPath = (String) iterator.next();
             if(seJarPath != null) {
@@ -226,21 +226,12 @@

                             if (fileName.endsWith("wsdl") || fileName.endsWith
("xsd")) {
                                 inputStream = seJarFile.getInputStream(entry);
-                                //ModelSource ms = loadModel(inputStream, 
entry.getName(), false);
-                                //ModelSource ms = loadModel
(inputStream, "JBIPRJ"+System.currentTimeMillis(), false); // NOI18N
-                                long time = System.currentTimeMillis();
-                               if (time <= lastTime) {
-                                   time = lastTime+1;
-                               }
-                               lastTime = time;
-                               String uniqueFileName = file.toURI().toString()
+ "/" + entry.getName() + "/" + time;
-                               //System.out.println("loading " + 
uniqueFileName);
-                                ModelSource ms = loadModel(inputStream, 
entry.getName(), uniqueFileName, false); // NOI18N
+                                // ModelSource ms = loadModel(inputStream, 
entry.getName(), false);
+                                ModelSource ms = loadModel
(inputStream, "JBIPRJ"+d.getTime(), false); // NOI18N
                                 inputStream.close();
                                 inputStream = null;
                                 if (fileName.endsWith("wsdl")) {
                                     WSDLModel wm = WSDLModelFactory.getDefault
().getModel(ms);
-                                    assert wm.getModelSource() == ms;
                                     xwsdls.add(wm);
                                 }
                             }
@@ -576,7 +567,7 @@
                 InputStream in = new FileInputStream(child.getAbsolutePath());

                 //todo: use the relative path as URI..
-                ModelSource ms = loadModel(in, child.getName
(), "JBIPRJ"+System.currentTimeMillis(), false);
+                ModelSource ms = loadModel(in, child.getName(), false);
                 WSDLModel wsdl = WSDLModelFactory.getDefault().getModel(ms);
                 if (child.getName().equalsIgnoreCase("portmap.wsdl")) {
                     portmapWsdl = wsdl;
Comment 17 _ hong_lin 2006-10-17 22:58:23 UTC
Verified the fix is in Coke B23 (061017_1).
Comment 18 _ hong_lin 2006-10-19 00:43:56 UTC
This issue can be reproduced on RC1 and RC3 build again.

RC1 build: All samples work fine. But when I tested Tutorial, loanprocessing
test failed with the same error.

RC3 build: The Cancel/Confirm tests in BluePrint4 sample failed on MacOS and
Linux platform. 

Comment 19 Tientien Li 2006-10-19 22:35:51 UTC
I just checked in another IZ#86955 fix to release55_dev for the problem Jun 
reported. It is a regression caused by the key value changes used in Chris 
fixes. The problem showes up in any bpel project that uses subdirectories to 
store xsd/wsdl files.

Jun Qian wrote:
>
> I encountered one problem earlier today with one of the Alaska testing 
> project (jbicomps/test/correlation/CorrelationJBI). The problem is 
> reproducible on Windows XP. The problem occurs at compapp project 
> build
> time:
>
> ...Ex: java.lang.NullPointerException
> java.lang.NullPointerException

Comment 20 Tientien Li 2006-10-19 23:37:30 UTC
The fix has been checked in into release55, so it can be included in the next 
build if needed.

diff -c -u -r1.1.2.4 -r1.1.2.3
cvs server: conflicting specifications of output style
--- 
antsrc/org/netbeans/modules/compapp/projects/jbi/anttasks/JarCatalogModel.java 
     19 Oct 2006 22:30:49 -0000      1.1.2.4
+++ 
antsrc/org/netbeans/modules/compapp/projects/jbi/anttasks/JarCatalogModel.java 
     29 Aug 2006 19:14:19 -0000      1.1.2.3
@@ -68,11 +68,6 @@
             try {
                 File f = (File) ms.getLookup().lookup(File.class);
                 String path = f.getParentFile().getPath().replace('\\', '/') 
+ "/" + uri.toString();
-                int idx = path.indexOf("build/SEDeployment.jar"); // NOI18N
-                if (idx > 0) { // OK, needs to strip off Chris W. fixes..
-                    path = f.getParentFile().getParentFile().getPath().replace
('\\', '/') + "/" + uri.toString(); // NOI18N
-                    path = path.substring(idx+23);
-                }
                 return new URI(path);
             } catch (Exception ex) {
                 // failed to generate normalized uri..
Comment 21 Alexander Pepin 2006-10-21 15:15:15 UTC
verified in RC4 (061020) build