3

我在 Eclipse 中创建数据适配器以连接 SqlServer。我在向导中提供了所有信息。我还在驱动程序类路径中添加了 sqljdbc4.jar 文件。最后,当我点击测试按钮时,我得到以下异常......

java.lang.reflect.InvocationTargetException
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1008)
at com.jaspersoft.studio.data.wizard.AbstractDataAdapterWizard.widgetSelected(AbstractDataAdapterWizard.java:143)
at com.jaspersoft.studio.data.wizard.DataAdapterWizardDialog.fireTestPressed(DataAdapterWizardDialog.java:54)
at com.jaspersoft.studio.data.wizard.DataAdapterWizardDialog.access$0(DataAdapterWizardDialog.java:52)
at com.jaspersoft.studio.data.wizard.DataAdapterWizardDialog$1.widgetSelected(DataAdapterWizardDialog.java:69)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at com.jaspersoft.studio.data.actions.EditDataAdapterAction.run(EditDataAdapterAction.java:68)
at com.jaspersoft.studio.data.DataAdapterProvider.doubleClick(DataAdapterProvider.java:103)
at com.jaspersoft.studio.repository.RepositoryView$2$1.run(RepositoryView.java:124)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
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:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.extensions.ExtensionsEnvironment
at net.sf.jasperreports.engine.DefaultJasperReportsContext.getExtensions(DefaultJasperReportsContext.java:246)
at net.sf.jasperreports.engine.SimpleJasperReportsContext.getExtensions(SimpleJasperReportsContext.java:121)
at net.sf.jasperreports.engine.util.LocalJasperReportsContext.getExtensions(LocalJasperReportsContext.java:167)
at com.jaspersoft.studio.utils.jasper.JasperReportsConfiguration.getExtensions(JasperReportsConfiguration.java:422)
at net.sf.jasperreports.data.DataAdapterServiceUtil.getService(DataAdapterServiceUtil.java:76)
at com.jaspersoft.studio.data.wizard.AbstractDataAdapterWizard$3.run(AbstractDataAdapterWizard.java:168)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

我必须连接到那个 sqlserver 数据库。请帮助我如何解决它。我搜索了一些论坛,但有相同的 InvocationTargetException 和 java 代码。但是这里没有java代码。请帮我。

4

0 回答 0