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 207303 - Commit glassfish samples from the trunk to NB 7.1.1 and NB 7.1 Patch 1
Summary: Commit glassfish samples from the trunk to NB 7.1.1 and NB 7.1 Patch 1
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Samples (show other bugs)
Version: 7.1
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: bhaktimehta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-13 23:07 UTC by bhaktimehta
Modified: 2012-02-13 15:34 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Project view scree shot. (30.13 KB, image/png)
2012-01-17 14:37 UTC, Jiri Skrivanek
Details
embedded-glassfish build log. (19.47 KB, text/plain)
2012-01-17 14:38 UTC, Jiri Skrivanek
Details
embedded-glassfish run log. (11.70 KB, text/plain)
2012-01-17 14:38 UTC, Jiri Skrivanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bhaktimehta 2012-01-13 23:07:51 UTC
I have committed 3 samples to the NB trunk workspace.
http://hg.netbeans.org/web-main/rev/72634ef30388

Filing this bug based on email from Petr Jirika
to track the integration to 7.1.1 against this bug.
Comment 1 bhaktimehta 2012-01-13 23:28:13 UTC
There are 3 samples which are added in javaee 

There are 3 samples which are currently checked in Samples->Javaee
ApplicationScopedResources
EmbeddedGlassfish
EjbContainer

ApplicationScopedResources is an enterprise project
EmbeddedGlassfish and EjbContainer are maven based projects

What does each sample achieve? Use case?
EmbeddedGlassfish
 A simple sample that shows Embedded API and demonstrates
        1. Start/stop GlassFish Server
        2. Deploy & Undeploy an application
        3. Scattered Archive
        4. Running asadmin commands from CommandRunner

EjbContainer
 Demonstrates the use of Maven to test EJBs using the standalone EJB container support.


ApplicationScopedResources
A simple sample showing Application Scoped Resources in Glassfish.


The samples are integrated in the netbeans web-main/j2ee.samples workspace.
Comment 2 bhaktimehta 2012-01-13 23:29:37 UTC
Note also I  will change the layer.xml so that samples will be in Samples->Glassfish  instead of Samples->Javaee as of now
Comment 3 Martin Janicek 2012-01-16 10:19:42 UTC
Patch looks good!
Comment 4 Jiri Skrivanek 2012-01-17 14:36:49 UTC
I tested samples in the following environment and have a some comments/questions.

Product Version: NetBeans IDE Dev (Build 201201160947)
Java: 1.7.0_02; Java HotSpot(TM) Client VM 22.0-b10
System: Windows XP version 5.1 running on x86; Cp1250; en_US (nb)

EmbeddedGlassfish
EjbContainer
  What RESTful Web Services present in project are good for?

ApplicationScopedResources
  There is a yellow badge icon on the project node (see screen shot). There is no hint in tooltip or error in underlying source files. What does it mean?
  AFAIK, application client project is somehow obsolete technology. Is it worth to demonstrate it in samples?

EmbeddedGlassfish
  There are some exceptions when building embedded-glassfish project (see log file) and then http://localhost:9590/td is invalid. If I run project, the application works and in log there is only one exception (see log files).
Comment 5 Jiri Skrivanek 2012-01-17 14:37:18 UTC
Created attachment 114968 [details]
Project view scree shot.
Comment 6 Jiri Skrivanek 2012-01-17 14:38:05 UTC
Created attachment 114969 [details]
embedded-glassfish build log.
Comment 7 Jiri Skrivanek 2012-01-17 14:38:27 UTC
Created attachment 114970 [details]
embedded-glassfish run log.
Comment 8 bhaktimehta 2012-01-18 21:17:10 UTC
Jiri thanks for your detailed feedback. Regarding coment 7 I noticed that is happening when using Glassfish 3.1.1. Once we upgrade to 3.1.2 this message will not show. We are planning to change the references to 3.1.2 once it is shipped next month
Comment 9 Jiri Skrivanek 2012-01-19 08:07:51 UTC
I forgot to say that I installed GlassFish 3.1.2-b17, registered it in IDE and used it with samples.
Comment 10 bhaktimehta 2012-01-24 22:26:18 UTC
Jiri,
Thanks a lot for your detailed feedback. Here are some comments

For EjbContainer and EmbeddedGlassfish the way to use 3.1.2  is to change in the pom.xml
the groupId has changed to "org.glassfish.main.extras" and artifactId is glassfish-embedded-all and the version 3.1.2-SNAPSHOT
Then you will see that 3.1.2 embedded glassfish is being used and you will not see the error  related to java.lang.NoClassDefFoundError: org/osgi/framework/ServiceException

The error is showing up as we are using version 3.1.1 of glassfish which is already released. Once 3.1.2 is released we can modify the samples to use 3.1.2 and also blog about it.

Regarding the Restful webservices shown in EjbContainer sample it is due to a dependency which glassfish-embedded-all has on admin-rest and hence they show up .

Also I am not sure how to fix yellow badge icon on the ApplicationScopedResources sample. There is no hint given and I tried to look at IDE logs too. So I dont know how best to fix this. If you think we can file a bug against the ide for more information on why the badge is coming I can do so and provide the nb project for the sample as an attachment

Please let me know if this patch is approved for transplant .

Thanks,
Bhakti
Comment 11 Jiri Skrivanek 2012-01-25 12:58:47 UTC
Thank you for your comments.

1) I tried the following and it works.
    <dependency>
        <groupId>org.glassfish.main.extras</groupId>
        <artifactId>glassfish-embedded-all</artifactId>
        <version>3.1.2-SNAPSHOT</version>
    </dependency>

From my point of view it would be better to transplant these changes with final location of glassfish-embedded-all 3.1.2. It depends on timing of releasing of the 71 patch. If GlassFish 3.1.2 is already released in that time, we should build samples against it. Petr Jiricka is in charge to decide it.

2) I filed bug 207714 about warning icon. It is because data source defined in project is not found. I would recommend to change data source the following way because it is default connection in NetBeans:

-      <property name="Password" value="APP"></property>
+      <property name="Password" value="app"></property>
-      <property name="User" value="APP"></property>
+      <property name="User" value="app"></property>
       <property name="serverName" value="localhost"></property>
-      <property name="DatabaseName" value="nb-samples"></property>
+      <property name="DatabaseName" value="sample"></property>
-      <property name="connectionAttributes" value=";create=true"></property>

3) In build 201201230600 samples are still under Java EE category and not under GlassFish as you proposed in comment 2.
Comment 12 bhaktimehta 2012-01-25 20:53:51 UTC
Thanks Jiri for the quick response.

I will start a thread with Petr, you , and Sathyan the 3.1.2 manager on how to align the samples with 3.1.2. I think when 3.1.2 is released NB may be in code freeze mode and may not accept my changes. So we have to start with 3.1.1 in samples now and then blog or update the samples later. But lets discuss this more. 

I will file a new bug to move the samples from Javaee to Glassfish and assign it to myself since I am running into  commit-validation failures when I  modify the layer.xml  so I do not want this change to affect the migration of the samples, also this is not as high priority as getting the samples in first. I am following up with nb engineers also . 

I have made changes to the glassfish-resources.xml and will commit to the nb trunk tomorow so you can verify. Appreciate all your help


Thanks again
Regards,
Bhakti
Comment 13 bhaktimehta 2012-01-26 22:42:45 UTC
Jiri,
I have committed the patch to the nb trunk right now. I have modified the samples based on feedback from you and Petr Jirica.

The glassfish-resources.xml has default values. Modified the pom.xml to specify 3.1.2 release in the EmbeddedGlassfish and EjbContainer samples so that once 3.1.2 is out these will start working (detail / hgweb)

Please can you approve this transplant
Thanks,
Bhakti
Comment 14 Jiri Skrivanek 2012-01-30 11:53:29 UTC
Verified in trunk build 201201280600.
Comment 15 bhaktimehta 2012-02-08 20:39:10 UTC
Integrated in release71_fixes so marking bug  71patch1-fixed and target milestone 7.1.1