C9510-319 practice questions, page 2 of 3, with answer review and explanations.
Question 6
The manifest file of an OSGi application project contains the following headers: Application-Content: BundleA; version=1.0.0, BundleB; version=1.0.0 Use-Bundle: BundleC; version=1.0.0 Which statement is true about the bundle content of this OSGi application?
BundleA, BundleB and BundleC are directly contained in the application.
BundleA, BundleB and BundleC are references to bundles that are hosted in an OS Gi bundle repository.
BundleA and BundleB are directly contained in the application while BundleC is a reference to a bundle that is hosted in an OSGi bundle repository.
BundleC is directly contained in the application while BundleA and BundleB are references to bundles that are hosted in an OSGi bundle repository.
Question 7
A developer has created a Liberty server in WebSphere Application Server Developer Tools for Eclipse. How can the developer start the Liberty server from the Servers view using a JRE different from the default JRE?
Open the Runtime Explorer view, select the runtime and click the Properties context sensitive menu item. Change the JRE set ting under the Server category in the Properties dialog.
Open the Server Configuration editor by double c licking the server configuration in the Servers view, add a JVM configuration element and specify the JRE location in the Location field.
Open the Server editor by double clicking the server in the Servers view, select the Runtime Environments link and change the JRE setting in the Liberty Profile Runtime Environment dialog.
Open the Server Configuration editor by double clicking the server configuration in the Servers view, add a Variable configuration element with the Name field
Question 8
A developer is testing a web application using a Liberty profile server. The application will also need to run on a Tomcat server and cannot make use of any APIs that are specific to the Liberty profile server. How can the user ensure that no classes outside of the specification classes are used by the application during the test?
Create a file server.env under the same directory as the server.xml file and add the following line: Class-Path-Visibility=spec
Open the meta-inf/manifest.mf file under the web project, add the following line: Class-Path-Visibility: specification
On the Server > Runtime Environment preference page, edit the Liberty profile runtime entry and select only the Specification checkbox under the API visibility section.
In the Server Configuration editor, create a Classloader Service item under the application element and add the attribute apiTypeVisibility with the value of
Question 9
In WebSphere Application Server Developer Tools with default settings, which situation will cause validation errors instead of warnings in the Problems view?
The closing </form> tag of a form element in an HTML page is omitted and the file is saved.
An optional header of a bundle manifest file is misspelled in the Source view, and the file is then saved.
A user is added to a basic user registry in the Liberty server.xml file with a name and a password, without the password being encoded.
A package is used and specified in an Import-Package header of a bundle manifest file, and no corresponding Export-Package header exists for the same
Question 10
A developer runs a servlet from an OSGi web project named CounterWebBundle on a Liberty server and gets the following error message when the doGet method of the servlet is run: [ERROR ] SRVE0777E: Exception thrown by application class 'com.ibm.ws.eba.servlet.CounterServlet.doGet():42' java.lang.NoClassDefFoundError: javax.naming.InitialContext How should the developer resolve the problem?
Ensure that jndi-1.0 and serverStatus-1.0 are added to the Feature Manager in the server configuration.
Ensure that jndi-1.0 is added to the Feature Manager in the server configuration and the javax.naming package is added to the Import-Package of CounterWebBundle.
Ensure that jndi-1.0 is added to the Feature Manager in the server configuration and Web 2.0 is selected in the Project Facets of the Properties for CounterWebBundle.
Ensure that jndi-1.0 is added to the Feature Manager in the server configuration and the javax.naming.InitialContext is specified in the init-method of the bean