Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
478 views
in Technique[技术] by (71.8m points)

jax ws - Eclipse Axis2 Web Service IWAB0014E Unexpected exception occurred

I have had a problem for a long time with Axis2 web service. When I try to create web service I got an error message IWAB0014E Unexpected exception occurred. I have tried in various ways but not successfully. Please help me how to do it correctly.

IWAB0014E Unexpected exception occurred.

  java.lang.NullPointerException
  at org.eclipse.jst.ws.internal.creation.ui.extension.PreServiceDevelopCommand.execute(PreServiceDevelopCommand.java:137)
  at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.runCommand(CommandFragmentEngine.java:421)
  at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.visitTop(CommandFragmentEngine.java:361)
  at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.moveForwardToNextStop(CommandFragmentEngine.java:256)
  at org.eclipse.wst.command.internal.env.ui.widgets.SimpleCommandEngineManager$6.run(SimpleCommandEngineManager.java:296)
  at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:436)
  at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:352)
  at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1033)
  at org.eclipse.wst.command.internal.env.ui.widgets.SimpleCommandEngineManager.runForwardToNextStop(SimpleCommandEngineManager.java:266)
  at org.eclipse.wst.command.internal.env.ui.widgets.WizardPageManager.runForwardToNextStop(WizardPageManager.java:93)
  at org.eclipse.wst.command.internal.env.ui.widgets.WizardPageManager.performFinish(WizardPageManager.java:264)
  at org.eclipse.wst.command.internal.env.ui.widgets.DynamicWizard.performFinish(DynamicWizard.java:384)
  at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:832)
  at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:472)
  at org.eclipse.jface.dialogs.Dialog.lambda$0(Dialog.java:619)
  at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:84)
  at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
  at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
  at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4213)
  at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1037)
  at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4030)
  at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3630)
  at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
  at org.eclipse.jface.window.Window.open(Window.java:799)
  at org.eclipse.ui.internal.handlers.WizardHandler$New.executeHandler(WizardHandler.java:260)
  at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:280)
  at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:283)
  at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:97)
  at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
  at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:319)
  at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:253)
  at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
  at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
  at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
  at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
  at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
  at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:389)
  at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:142)
  at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:579)
  at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:413)
  at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
  at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4213)
  at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1037)
  at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4030)
  at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3630)
  at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1158)
  at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
  at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1047)
  at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
  at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:658)
  at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
  at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
  at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:154)
  at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
  at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
  at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
  at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
  at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
  at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
  at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
  at org.eclipse.equinox.launcher.Main.run(Main.java:1447)

That's my code:

    package projekt_jsf_serwer;
    import java.io.ByteArrayInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.InputStream;
    import java.sql.Blob;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
    public class myclass {
    private Connection myConn;
    private ResultSet myRS;
    
    public String add(int a)
    {
        return "hello";
    }
    public String upload(String plik)
    {
        try {
            Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
            System.out.println("driver OK");
            this.myConn=DriverManager.getConnection("jdbc:derby:
            C:\eclipse_2020_06\workspace\projekt_jsf_serwer\imagesdb");
            System.out.println("baza OK");
            //sta1.executeUpdate("INSERT INTO images (base64) VALUES ("+blobData+")");
            InputStream nowystream=new ByteArrayInputStream(plik.getBytes());
            PreparedStatement pst = myConn.prepareStatement("INSERT INTO images (base64) VALUES (?)");
            pst.setBinaryStream(1,nowystream,nowystream.available());
            pst.setBlob(1, nowystream);
            pst.execute();
            System.out.println("Dodano");
            this.myConn.close();
            
        }catch(Exception ex) {
            System.out.println(ex.getMessage());
        }
        
        return "Image ok";
    }
    
    public String delete(int id)
    {
        try {
            Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
            System.out.println("driver OK");
            this.myConn=DriverManager.getConnection("jdbc:derby:
            C:\eclipse_2020_06\workspace\projekt_jsf_serwer\imagesdb");
            System.out.println("baza OK");
            PreparedStatement pst = myConn.prepareStatement("DELETE FROM images WHERE id = ?");
            pst.setInt(1, id);
            pst.execute();
            System.out.println("Dodano");
            this.myConn.close();
        }catch(Exception ex) {
            System.out.println(ex.getMessage());
        }
        return "Usunieto";
    }
    
    public String show()
    {
        try {
            Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
            System.out.println("driver OK");
            this.myConn=DriverManager.getConnection("jdbc:derby:C:\eclipse_2020_06\workspace\projekt_jsf_serwer\imagesdb");
            System.out.println("baza OK");
            ResultSet myRS;
            Statement sta=myConn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE );
            String result="";
            String tmp;
            int tmp4;
            Blob tmp2;
            byte[] tmp3;
            myRS=sta.executeQuery("SELECT id,base64 FROM images");
            myRS.first();
            while(!myRS.isAfterLast())
            {
                
                tmp2=myRS.getBlob(2);
                tmp= new String(tmp2.getBytes(1l, (int) tmp2.length()));
                tmp4= myRS.getInt(1);
                result+="<a href='data:image/png;base64,"+tmp+"'>"+tmp4+"</a><br>"+ "<img src='data:image/png;base64, "+tmp +" '/><br>";
                myRS.next();
            }
            
            return result;
        }
        catch(Exception ex) {
            System.out.println(ex.getMessage());
        }
        return "Error";
    }
}

Thank you in advance for any advice.

question from:https://stackoverflow.com/questions/65866077/eclipse-axis2-web-service-iwab0014e-unexpected-exception-occurred

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...