Hi Chrles,

In order to generate the service from the SampleService using the eclipse
service archive we need to supply the dependent libraries of the
SampleService to the Eclipse Service Archiver at the Step 4  (
http://ws.apache.org/axis2/tools/1_2/eclipse/servicearchiver-plugin.html)

Please try adding the

stax-api-1.0.1.jar
axiom-dom-1.2.4.jar
axiom-api.1.2.4.jar
axiom-impl-1.2.4.jar

libraries in the setp 4

HTH

Thanks

Lahiru

On 7/22/07, carles massalle <[EMAIL PROTECTED]> wrote:

Hi

I'm a newbie with Axis2.

I tried to do the example sayHello to understand how to use axiom
(
http://ws.apache.org/axis2/1_2/userguide-buildingservices.html#getcomfortable
).


package ws.carles;  //I use my own package

import javax.xml.stream.XMLStreamException;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;

public class SampleService {

    public OMElement sayHello(OMElement element)
                             throws XMLStreamException {
            element.build();
            element.detach();

            String rootName = element.getLocalName();
            System.out.println("Reading "+rootName+" element");

            OMElement childElement = element.getFirstElement();
            String personToGreet = childElement.getText();

            OMFactory fac = OMAbstractFactory.getOMFactory();
            OMNamespace omNs = fac.createOMNamespace(
                    "http://example1.org/example1";, "example1");
            OMElement method = fac.createOMElement("sayHelloResponse",
omNs);
            OMElement value = fac.createOMElement("greeting", omNs);
            value.addChild(fac.createOMText(value, "Hello,
"+personToGreet));
            method.addChild(value);

            return method;
        }

     private void ping(){
     }

}



I work with Eclipse 3.3 with axis2 plugins.

When I try to create the ".aar" file with the Axis2 service archiver
plugin immediately I get the  error message:

"An error has occurred. See log for more details.
Reason: org/apache/axiom/om/OMContainer"

and the log file shows:

!ENTRY org.eclipse.jface 4 2 2007-07-22 10:52:24.109
!MESSAGE Problems occurred when invoking code from plug-in: "
org.eclipse.jface".
!STACK 0
java.lang.NoClassDefFoundError: org/apache/axiom/om/OMContainer
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at
org.apache.axis2.tool.service.eclipse.ui.ServiceXMLGenerationPage.updateTable
(Unknown
Source)
        at
org.apache.axis2.tool.service.eclipse.ui.ServiceXMLGenerationPage.createControl
(Unknown
Source)
        at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java
:170)
        at org.eclipse.jface.wizard.WizardDialog.createPageControls(
WizardDialog.java:669)
        at org.eclipse.jface.wizard.WizardDialog.setWizard(
WizardDialog.java:1083)
        at org.eclipse.jface.wizard.WizardDialog.updateForPage(
WizardDialog.java:1142)
        at org.eclipse.jface.wizard.WizardDialog.access$2(
WizardDialog.java:1139)
        at org.eclipse.jface.wizard.WizardDialog$4.run(WizardDialog.java
:1128)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(
BusyIndicator.java:67)
        at org.eclipse.jface.wizard.WizardDialog.showPage(
WizardDialog.java:1126)
        at
org.eclipse.ui.internal.dialogs.NewWizardSelectionPage.advanceToNextPageOrFinish
(NewWizardSelectionPage.java:71)
        at org.eclipse.ui.internal.dialogs.NewWizardNewPage$1.doubleClick(
NewWizardNewPage.java:355)
        at org.eclipse.jface.viewers.StructuredViewer$1.run(
StructuredViewer.java:799)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
        at org.eclipse.core.runtime.Platform.run(Platform.java:857)
        at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
        at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:193)
        at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(
StructuredViewer.java:797)
        at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect
(AbstractTreeViewer.java:1384)
        at
org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(
StructuredViewer.java:1173)
        at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(
OpenStrategy.java:237)
        at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java
:234)
        at org.eclipse.jface.util.OpenStrategy$1.handleEvent(
OpenStrategy.java:295)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java
:66)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java
:3682)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java
:3293)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
        at org.eclipse.jface.window.Window.open(Window.java:796)
        at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java
:182)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
        at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(
ActionContributionItem.java:545)
        at org.eclipse.jface.action.ActionContributionItem.access$2(
ActionContributionItem.java:490)
        at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(
ActionContributionItem.java:402)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java
:66)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java
:3682)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java
:3293)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java
:2389)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
        at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
        at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(
Realm.java:289)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(
Workbench.java:461)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java
:149)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(
IDEApplication.java:106)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(
EclipseAppHandle.java:153)
        at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication
(EclipseAppLauncher.java:106)
        at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
EclipseAppLauncher.java:76)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
EclipseStarter.java:363)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
EclipseStarter.java:176)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java
:504)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1169)


I believe my eclipse project includes all the needed libraries for this
example.
stax-api-1.0.1.jar
axiom-dom-1.2.4.jar
axiom-api.1.2.4.jar
axiom-impl-1.2.4.jar

The eclipse project compiles correctly before i try to deploy with
Axis2 service archiver plugin.

Thanks

carles massallé.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Thanks
Lahiru Sandakith

http://sandakith.wordpress.com/
GPG Key Fingerprint : 8CD8 68E0 4CBC 75CB 25BC  1AB1 FE5E 7464 1F01 9A0F

Reply via email to