The Maven category in the New Projects wizard includes an OSGi Bundle archetype for creating OSGi bundle projects. When you create an OSGi bundle project, the generated POM declares the org.osgi.core JAR as a dependency and specifies the maven-bundle-plugin for building the project.
When you click Finish, the IDE creates the bundle project and opens the project in the Projects window. If you open pom.xml for the MavenHelloServiceApi project in the editor you can see that the packaging element specifies bundle and that the maven-bundle-plugin will be used when building the bundle.
The maven-bundle-plugin handles the generation of the MANIFEST.MF file when you build the project. If you open the MANIFEST.MF file in the compiled JAR you will see that the plugin generated a manifest header that declares the export packages. For OSGi, all bundles that you want to be exposed and available to other bundles must be listed in the Export-Package element in MANIFEST.MF .
To use @OSGiService and retrieve registered OSGi bundles, you need to make the web application a bundle which can access BundleContext . To make the WAR an OSGi bundle (Web Application Bundle), you add the Web-ContextPath meta-data to the MANIFEST.MF in the WAR. To do this, specify the element in the instructions for the maven-bundle-plugin and the manifest generated by the plugin will contain the element. You then modify the maven-war-plugin configuration to instruct the plugin to add the manifest that was generated by the maven-bundle-plugin to the WAR archive.
If you now expand the WAR archive and open MANIFEST.MF in the editor, you can see that MANIFEST.MF now contains additional information, including the Web-ContextPath: /mavenhellowebclient entry that you specified in the maven-bundle-plugin configuration and bundle name entries.
*Important: * If you are running GlassFish Server 3.1.2.2 you need to modify the osgi.properties file located in the GLASSFISH-INSTALL/glassfish/config/ directory and set the value of the org.osgi.framework.startlevel.beginning property to "2" ( org.osgi.framework.startlevel.beginning=2 ).See the following forum post for more details:+ Cannot start web console in Glassfish version 3.1.2.2+.
There are working glassfish/tomcat servers (netbeans specific tweaked - at a guess) that work very well out of the box and are included in the "ALL" or "JavaEE" editions of netbeans. This would be preferable to trying to hack an independent package into the IDE.
Netbeans doesn't provide the Tomcat (when I add a new server, Netbeans asks for Tomcat's directory). Though I installed Glassfish through Netbeans.
The only version I can see in aur/pacman is community/netbeans. The rest are packages for compatibility with C/C++/Others (UML too), but there is no version "ALL" or "JavaEE".
I guess I do have the JEE version since I can create dynamic web applications through Netbeans.
Can anyone help with this? I've heard rumors that I can also use arquillian-glassfish-managed instead of arqueillian-glassfish-embedded. What is the difference between the two? Is there a complete tutorial for setting up Arquillian in a modern Glassfish/Java EE/Netbeans/Maven environment?:
It is going better now. I'm having some success with the javaee 7 sample project at -samples/javaee7-samples
The configuration is much more organized and clear in the sample project. Here the GF choices seem to be:
glassfish-embedded-arquillian (embedded, starts every time you run a test)
glassfish remote-arquillian (gf starts once and tests connect to that)
I got the embedded one to work and am trying for the remote. My only problem with the remote is configuring my admin url. I'm using a non-standard admin console port 49843 and I'm getting:
org.jboss.arquillian.container.glassfish.CommonGlassFishManager start
SEVERE: Could not connect to DAS on: :4848 Connection refused
So far things are going well. I have gotten cdi/beansxml-noversion/src/test/java/org/javaee7/cdi/beansxml/noversion/GreetingTest.java to work in the javaee7-samples program using arquillian/junit/glassfish 4.1 and build/deploy in Netbeans.
I'm running Ubuntu on a desktop and laptop, and use Netbeans as an IDE. On the desktop, $/glassfish-4.1 has everything configured properly. I may have copied a JAR for MySQL over to the libs folder, but didn't otherwise configure Glassfish itself. Unfortunately, I can't remember or quite replicate how I installed Glassfish on the desktop.
gives the same small number of parameters as the other "version", or other instance, of glassfish installed on the laptop. Neither laptop version is giving me the catalog of options which are available on the Desktop for JDBC Connection Pooling with Glassfish.
There is a JSF plugin that's pre-0.5 and requires WTF 1.5 and a whole army of subsidiary plugins, and an experimental GlassFish plugin that requires WTF 1.0. I tried installing that and hosed my Eclipse installation. Note to self: Try this in a separate Eclipse sandbox next time.
If you know a working Eclipse plugin or an inexpensive Eclipse derivative that supports JSF 1.2 with autocompletion, debugging, HTTP monitor, etc., I'd love to know. If you don't, give NetBeans 5.5 a try.
Apache Camel 3.14.7 has been released featuring bug fixes and improvements to the camel-hdfs, camel-report-maven-plugin, camel-sql and camel-ldap modules. More details on this release may be found in the release notes.
NetBeans determines the driver to copy to GlassFish from the file glassfish-resources.xml that
we will create in Step 4 of this tutorial. Without this file and if you have not copied the driver into GlassFish manually then GlassFish will not be able to connect to the database. Any code in your web application will not work and all you will likely see are blank pages.
Performing this task will resolve a problem that occurs when using NetBeans to configure a JDBC Connection Pool and JDBC Resource for GlassFish. The default installation of NetBeans and GlassFish results in the naming of the JDBC configuration file as sun-resources.xml when it should be named glassfish-resources.xml. This is a Windows only problem.
In NetBeans, the "New persistence unit" wizard will create this for you, using a datasource name (e.g. "jdbc/mydb") and a database connection. From these it will create entries in glassfish-resources.xml for both a connection pool (pointing at the database you are using) and a datasource (pointing at the connection pool.
Sometimes, Glassfish appears to ignore glassfish-resources.xml and thus does not create the necessary objects. This is typified by an exception entry in the Glassfish server log that says it can't find a resource (e.g. "jdbc/mydb__pm"). It then becomes necessary for you to do something manual to create the objects.
760c119bf3