SWTBotShell widget not found exception - eclipse

I am writing automated testing using swtBot in eclipse Juno Service Release 2.Below My code
#BeforeClass
public static void beforeClass() {
SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
bot = new SWTWorkbenchBot();
try {
bot.viewByTitle("Welcome").close();
} catch (WidgetNotFoundException e) {
// ignore
}
bot.menu("Window").menu("Preferences").click();
SWTBotShell shell = bot.shell("Preferences");
shell.activate();
SWTBotView view = bot.viewByTitle("Preferences");
bot.tree().expandNode("General").select("Workspace");
SWTBotCheckBox buildAuto = bot.checkBox("Build automatically");
if (buildAuto != null && buildAuto.isChecked())
buildAuto.click();
bot.button("Apply").click();
bot.tree().expandNode("General").select("Perspectives");
SWTBotRadio radio = bot.radio("Always open");
if (radio != null && !radio.isSelected())
radio.click();
bot.button("OK").click();
}
I am getting following exception:
org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException:
Could not find shell matching: with text 'Preferences' at
org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntilWidgetAppears(SWTBotFactory.java:387)
at
org.eclipse.swtbot.swt.finder.SWTBotFactory.shells(SWTBotFactory.java:114)
at
org.eclipse.swtbot.swt.finder.SWTBotFactory.shell(SWTBotFactory.java:104)
at
org.eclipse.swtbot.swt.finder.SWTBotFactory.shell(SWTBotFactory.java:95)
at com.packtpub.e4.junit.plugin.UITest.beforeClass(UITest.java:49)
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)

Don't put your test code in the method annotated with #BeforeClass. At this point the test class isn't even instantiated. Cf. this answer here for an explanation of the annotations.
If you have moved the relevant code to a #Test annotated method and the code still doesn't work, check spelling, etc.

Related

Why the error is displayed as java.lang.ClassNotFoundException: for the following groovy code?

class First {
public First() {
super()
// TODO Auto-generated constructor stub
}
static void main(String s)
{
print('Hii');
}
}
After running the code in eclipse using Groovy Console option the following exception is being shown.
java.lang.ClassNotFoundException: groovy.ui.Console
at org.codehaus.groovy.tools.RootLoader.findClass(RootLoader.java:179)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:151)
at java.lang.ClassLoader.loadClass(Unknown Source)
Nothing wrong with the code. Groovy Console dependencies are not included by default with Groovy 2.5+ You can use Groovy 2.4 which bundles groovy-all or run as Java Application since you have a class with a main method.

Talend: REST Call results in either "URI is not absolute" or "UnknownHostException"

I am trying to get data from a REST API to our database with the help of Talend Jaspersoft ETL Express Version 5.6.
To make sure that my problem is not related to our server configuration i installed the tool locally too and got stuck. Since I am a student who is not well experienced with java but needs to get this run for his company i hope you can help me. I have only some basic knowledge so i did not try to find a solution in the "Code" tab, only worked with the Designer.
In the end I wanted to try out the following tutorial:
http://dwetl.com/2015/08/11/trest-use-case-example-use-rest-api-in-talend/
but that don't works too for me. I can get the data when i use the call in my browser but with that tool i am getting only errors.
With "https://api.github.com/users/mralexgray/followers" as URL I get an UnknownHostException:
Starte Job Test am 11:20 21/07/2016.
[statistics] connecting to socket on port 3941
[statistics] connected
Exception in component tREST_1
com.sun.jersey.api.client.ClientHandlerException: java.net.UnknownHostException: api.github.com
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:131)
at com.sun.jersey.api.client.Client.handle(Client.java:616)
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:559)
at com.sun.jersey.api.client.WebResource.get(WebResource.java:182)
at testetl.test_0_1.Test.tREST_1Process(Test.java:572)
at testetl.test_0_1.Test.runJobInTOS(Test.java:929)
at testetl.test_0_1.Test.main(Test.java:786)
Caused by: java.net.UnknownHostException: api.github.com
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
at sun.security.ssl.BaseSSLSocketImpl.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
[statistics] disconnected
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:218)
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:129)
... 6 more
Job Test endet am 11:20 21/07/2016. [exit code=1]
If I cut off that "https://" part and use "api.github.com/users/mralexgray/followers" as Url I get the error "Uri is not absolute"
Starte Job Test am 11:31 21/07/2016.
[statistics] connecting to socket on port 3809
[statistics] connected
Exception in component tREST_1
com.sun.jersey.api.client.ClientHandlerException: java.lang.IllegalArgumentException: URI is not absolute
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:131)
at com.sun.jersey.api.client.Client.handle(Client.java:616)
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:559)
at com.sun.jersey.api.client.WebResource.get(WebResource.java:182)
at testetl.test_0_1.Test.tREST_1Process(Test.java:572)
at testetl.test_0_1.Test.runJobInTOS(Test.java:929)
at testetl.test_0_1.Test.main(Test.java:786)
Caused by: java.lang.IllegalArgumentException: URI is not absolute
at java.net.URI.toURL(Unknown Source)
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:140)
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:129)
... 6 more
[statistics] disconnected
Job Test endet am 11:31 21/07/2016. [exit code=1]
Just to give you as many information as possible, here is a little part out of the auto generated java code which seems to be about this REST Call for me, but maybe I am completly wrong and this dont helps at all since I have only basic java knowledge:
/**
* [tREST_1 begin ] start
*/
ok_Hash.put("tREST_1", false);
start_Hash.put("tREST_1", System.currentTimeMillis());
currentComponent = "tREST_1";
int tos_count_tREST_1 = 0;
String endpoint_tREST_1 = "api.github.com/users/mralexgray/followers";
String trustStoreFile_tREST_1 = System
.getProperty("javax.net.ssl.trustStore");
String trustStoreType_tREST_1 = System
.getProperty("javax.net.ssl.trustStoreType");
String trustStorePWD_tREST_1 = System
.getProperty("javax.net.ssl.trustStorePassword");
String keyStoreFile_tREST_1 = System
.getProperty("javax.net.ssl.keyStore");
String keyStoreType_tREST_1 = System
.getProperty("javax.net.ssl.keyStoreType");
String keyStorePWD_tREST_1 = System
.getProperty("javax.net.ssl.keyStorePassword");
com.sun.jersey.api.client.config.ClientConfig config_tREST_1 = new com.sun.jersey.api.client.config.DefaultClientConfig();
javax.net.ssl.SSLContext ctx_tREST_1 = javax.net.ssl.SSLContext
.getInstance("SSL");
javax.net.ssl.TrustManager[] tms_tREST_1 = null;
if (trustStoreFile_tREST_1 != null
&& trustStoreType_tREST_1 != null) {
char[] password_tREST_1 = null;
if (trustStorePWD_tREST_1 != null)
password_tREST_1 = trustStorePWD_tREST_1.toCharArray();
java.security.KeyStore trustStore_tREST_1 = java.security.KeyStore
.getInstance(trustStoreType_tREST_1);
trustStore_tREST_1.load(new java.io.FileInputStream(
trustStoreFile_tREST_1), password_tREST_1);
javax.net.ssl.TrustManagerFactory tmf_tREST_1 = javax.net.ssl.TrustManagerFactory
.getInstance(javax.net.ssl.KeyManagerFactory
.getDefaultAlgorithm());
tmf_tREST_1.init(trustStore_tREST_1);
tms_tREST_1 = tmf_tREST_1.getTrustManagers();
}
javax.net.ssl.KeyManager[] kms_tREST_1 = null;
if (keyStoreFile_tREST_1 != null
&& keyStoreType_tREST_1 != null) {
char[] password_tREST_1 = null;
if (keyStorePWD_tREST_1 != null)
password_tREST_1 = keyStorePWD_tREST_1.toCharArray();
java.security.KeyStore keyStore_tREST_1 = java.security.KeyStore
.getInstance(keyStoreType_tREST_1);
keyStore_tREST_1.load(new java.io.FileInputStream(
keyStoreFile_tREST_1), password_tREST_1);
javax.net.ssl.KeyManagerFactory kmf_tREST_1 = javax.net.ssl.KeyManagerFactory
.getInstance(javax.net.ssl.KeyManagerFactory
.getDefaultAlgorithm());
kmf_tREST_1.init(keyStore_tREST_1, password_tREST_1);
kms_tREST_1 = kmf_tREST_1.getKeyManagers();
}
ctx_tREST_1.init(kms_tREST_1, tms_tREST_1, null);
config_tREST_1
.getProperties()
.put(com.sun.jersey.client.urlconnection.HTTPSProperties.PROPERTY_HTTPS_PROPERTIES,
new com.sun.jersey.client.urlconnection.HTTPSProperties(
new javax.net.ssl.HostnameVerifier() {
public boolean verify(
String hostName,
javax.net.ssl.SSLSession session) {
return true;
}
}, ctx_tREST_1));
com.sun.jersey.api.client.Client restClient_tREST_1 = com.sun.jersey.api.client.Client
.create(config_tREST_1);
com.sun.jersey.api.client.WebResource restResource_tREST_1;
if (endpoint_tREST_1 != null && !("").equals(endpoint_tREST_1)) {
restResource_tREST_1 = restClient_tREST_1
.resource(endpoint_tREST_1);
} else {
throw new IllegalArgumentException("url can't be empty!");
}
com.sun.jersey.api.client.ClientResponse errorResponse_tREST_1 = null;
String restResponse_tREST_1 = "";
try {
restResponse_tREST_1 = restResource_tREST_1
.get(String.class);
} catch (com.sun.jersey.api.client.UniformInterfaceException ue) {
errorResponse_tREST_1 = ue.getResponse();
}
// for output
row1 = new row1Struct();
if (errorResponse_tREST_1 != null) {
row1.ERROR_CODE = errorResponse_tREST_1.getStatus();
} else {
row1.Body = restResponse_tREST_1;
}
/**
* [tREST_1 begin ] stop
*/
/**
* [tREST_1 main ] start
*/
Any help would be very appreciated :). All my examples are about that tutorial but while I was trying to get our real API to work with ETL I just got the exact same problems and I guess this tutorial is easier to give you guys as an example.
We finally could figure out a way to solve our connection issue.
I don't know why Talend is not using our proxy correctly even if its manually set up in the preferences but if we use the tSetProxy component it works and gets the expected JSON object back from the server.
java.net.UnknownHostException : Did you check if you are behind a proxy ? The previous error should happen if, from your studio position, the site is not accessible.
You have to know that your browser doesn't necessarily have the same configuration as Talend Studio. So, please check your "Internet Settings" for the existing of any proxy. If it is the case, then it is possible to change the proxy settings in menu: Window -> Preferences, under General -> Network.

Strange exception using Jersey with embedded Jetty

I have created an embedded Jetty application which utilizes Jersey in order to implement several RESTful services. I am using some standard code as described here in Stack Overflow as well as other websites:
public static void main(String[] args)
{
Server server = new Server(8080);
ServletContextHandler ctx = new ServletContextHandler(
ServletContextHandler.SESSIONS);
ctx.setContextPath("/");
ServletHolder holder = ctx.addServlet(
"org.glassfish.jersey.servlet.ServletContainer.class", "/*");
holder.setInitOrder(0);
holder.setInitParameter("jersey.config.server.provider.classnames",
RestfulClass.class.getCanonicalName());
server.setHandler(ctx);
try
{
server.start();
server.join();
}
catch(Exception exe)
{
exe.printStackTrace();
}
}
I've used all the recommended jar files, and several other jar files that the various blogs and sites failed to mention. When running the Jetty application, I get the following exception:
java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer.class
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.jetty.util.Loader.loadClass(Loader.java:86)
at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:95)
<several lines omitted for brevty>
Caused by: javax.servlet.UnavailableException: org.glassfish.jersey.servlet.ServletContainer.class
at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:102)
at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:361)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:874)
... 11 more
It is the "UnavailableException" that I do not understand. The ServletContainer class is actually in one of the Jar files (in jersey-container-servlet-core.jar, to be precise), but for some reason it is identified as "unavailable". This is causing a class that is actually in a referenced Jar file to be "not found"!
Can anyone tell me what is causing this UnavailableException and (more importantly) how I can prevent it from being thrown?
Someone please advise...
ServletHolder holder = ctx.addServlet(
"org.glassfish.jersey.servlet.ServletContainer.class", "/*");
You are using a String for the class name. When doing this, you don't use the .class suffix. That at only when you want to get the actual Class object. You have two options
Remove the .class from the String
ServletHolder holder = ctx.addServlet(
"org.glassfish.jersey.servlet.ServletContainer", "/*");
Remove the "" (double quotes) and just use the Class object1.
ServletHolder holder = ctx.addServlet(
org.glassfish.jersey.servlet.ServletContainer.class, "/*");
1 - See addServlet(Class, String)

JavaFX 8 TreeTableColumn setText ClassCastException

My situation is: I have a TreeTableView that has a TreeTableColumn. The Columns head text will be changed on runtime.
When I change the text through setText or textProperty().bind(...) before I show the stage, all works as expectet.
But if i change the text after showing the stage, I get a massive java.lang.ClassCastException.
I have tried this with Java SE 1.8.0 b132 and with Java 1.8.0_20 b17 EA.
Is there a workaround for this except recreating the TreeTableColumn?
My Sample Code:
TreeTableView<String> ttv = new TreeTableView<>();
TreeTableColumn<String, String> ttc = new TreeTableColumn<>();
ttc.setText("Hello");
ttv.getColumns().add(ttc);
ttv.setOnMouseClicked(new EventHandler<MouseEvent>() {
#Override
public void handle(MouseEvent t) {
ttc.setText("World");
}
});
Scene scene = new Scene(ttv);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
The Exception(after clicking on TreeTableView):
Exception in Application start method
java.lang.reflect.InvocationTargetException
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:483)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:367)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:305)
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:483)
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:894)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:56)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:158)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.ClassCastException: javafx.scene.control.TreeTableColumn cannot be cast to javafx.scene.control.TableColumn
at com.sun.javafx.scene.control.skin.TableHeaderRow$10.invalidated(TableHeaderRow.java:277)
at javafx.beans.WeakInvalidationListener.invalidated(WeakInvalidationListener.java:83)
at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:339)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
at javafx.beans.property.StringPropertyBase.fireValueChangedEvent(StringPropertyBase.java:103)
at javafx.beans.property.StringPropertyBase.markInvalid(StringPropertyBase.java:110)
at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:143)
at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:49)
at javafx.scene.control.TableColumnBase.setText(TableColumnBase.java:189)
at com.kalasch.test.TreeTableTest.start(TreeTableTest.java:39)
at com.sun.javafx.application.LauncherImpl$8.run(LauncherImpl.java:837)
at com.sun.javafx.application.PlatformImpl$7.run(PlatformImpl.java:335)
at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:301)
at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:298)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$6.run(PlatformImpl.java:298)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$300(WinApplication.java:39)
at com.sun.glass.ui.win.WinApplication$4$1.run(WinApplication.java:112)
... 1 more
Exception running application com.kalasch.test.TreeTableTest
UPDATE 08/04/2014:
Submitted Bug report to javafx-jira:
https://bugs.openjdk.java.net/browse/JDK-8095931
UPDATE 08/05/2014:
Fix Version will be: 8u40
#thatjavaguy09 fix does work.
Greetings, Kalsch
Looking through the stack trace, it seems the issue is that your TreeTableColumn is trying to be casted into a TableColumn which is what is throwing the ClassCastException (since that is in fact an invalid cast).
It seems the call is coming from TableHeaderRow.invalidated. Looking at this method, I see where the cast is coming from.
private final InvalidationListener columnTextListener = new InvalidationListener() {
#Override public void invalidated(Observable observable) {
**TableColumn<?,?> column = (TableColumn<?,?>) ((StringProperty)observable).getBean();**
CheckMenuItem menuItem = columnMenuItems.get(column);
if (menuItem != null) {
menuItem.setText(getText(column.getText(), column));
}
}
};
This might be a bug with the JDK. I believe the correct cast should be to a TableColumnBase. I would submit this to their bug tracker:
https://javafx-jira.kenai.com/secure/Dashboard.jspa

Invalid Cursor State - No current row

I am very new to Java, and I am trying to complete one simple task of reading data from a table and passing it to form variables. However, I am getting this frustrating exception:
Invalid cursor state - no current row;
I tried everything but still no luck. I looked into Google but I'm not getting an answer that will fix this issue. Hope you guys can help.
public class MainFrame extends javax.swing.JFrame {
Connection con;
Statement stm;
ResultSet rs;
/**
* Creates new form MainFrame
*/
public MainFrame() {
initComponents();
DoConnect();
}
public void DoConnect() {
try{
String host = "jdbc:derby:studentinfo;create=true";
String uname = "sudeep";
String upass = "sunny";
con = DriverManager.getConnection(host, uname, upass);
stm = con.createStatement();
String sql = "SELECT * FROM APP.STUDENTID";
rs = stm.executeQuery(sql);
System.out.println("Query executed");
if(rs.next())
{
// This is where the exception is occurring!!!!!!
String id = rs.getString("STUDENTID");
String first = rs.getString("FIRST_NAME");
String second = rs.getString("SECOND_NAME");
ID.setText(id);
fnam1.setText(first);
lnam.setText(second);
System.out.println(id);
}
}
catch ( SQLException err) {
JOptionPane.showMessageDialog(MainFrame.this, err.getMessage());
System.out.println("ERROR GETCONNECTION");}
}
}
Here is the trace generated by the program
run:
[EL Info]: 2013-09-03 21:14:15.732--ServerSession(552364977)--EclipseLink, version: Eclipse Persistence Services - 2.5.0.v20130507-3faac2b
[EL Info]: connection: 2013-09-03 21:14:16.299--ServerSession(552364977)--file:/Users/vasundhra_sudeep/NetBeansProjects/StudentForm/build/classes/_jdbc:derby:studentinfo;create=truePU login successful
java.sql.SQLException: Invalid cursor state - no current row.
Invalid cursor state - no current row.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedResultSet.checkOnRow(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedResultSet.getColumnType(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedResultSet.getString(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedResultSet.getString(Unknown Source)
at studentform.MainFrame.DoConnect(MainFrame.java:57)
at studentform.MainFrame.(MainFrame.java:35)
at studentform.MainFrame$7.run(MainFrame.java:579)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.sql.SQLException: Invalid cursor state - no current row.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
... 27 more
BUILD SUCCESSFUL (total time: 7 seconds)
It's likely that APP.STUDENTID has no data in it. Insert at least one record (aka row) of data into that table, run your program again, and see if the same exception occurs.