[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Execution of (java) TRIGGER failed in OE sql engine; Error Code -210154

Status
Not open for further replies.
R

Rom Elwell

Guest
[quote user="Mohd Sayeed Akthar"] Hi Rom Elwell, The code path which error message is showing is responsible for loading class associated with the trigger, which fails here. Can we know which version of OE that you are using and is it possible to have a reproducible? Thanks, Akthar. [/quote]Mohd, Thanks for the reply. We are running OE 11.7.4 x64. A sample of the java trigger is below for review. Our Java Triggers fire after data has been updated in the OE DBs via a SQL Client, such as SquirrelSQL. The trigger establishes a connection to an Apache Tomcat web server and passes data related to the updated data. The Java snippet in the trigger was first written in the Java IDE BlueJ and successfully tested. The Trigger was created by running the code in a SQL Editor within Progress Developer Studio. CREATE TRIGGER sqlemployeeUPDATE AFTER UPDATE OF field1,field2,field3,field4 ON PUB.TABLENAME REFERENCING NEWROW FOR EACH ROW IMPORT import java.io.IOException; import java.io_OutputStreamWriter; import java.io.InputStreamReader; import java.io.InputStream; import java.io.BufferedReader; import java.lang.*; import java.net.HttpURLConnection; import java.net.URL; import java.sql.*; import java.util.*; BEGIN try { String dbURL = "jdbc:datadirect:eek:penedge://HOSTNAME:pORT;databaseName=DBNAME"; String userID = "USER"; String password = "PASSWORD"; String sql = "SELECT serverURL FROM pub.company"; String serverURL = null; String pkValue = null; Connection appCon = null; Statement appStmt = null; Class.forName("com.ddtek.jdbc.openedge.OpenEdgeDriver"); appCon = DriverManager.getConnection(dbURL,userID,password); appStmt = appCon.createStatement(); ResultSet rs = appStmt.executeQuery(sql); while(rs.next()) { serverURL = rs.getString("serverURL"); } serverURL = serverURL + "/appContainer/rest_ws/notify"; rs.close(); appStmt.close(); appCon.close(); URL url = new URL(appURL); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.setRequestMethod("PUT"); con.setRequestProperty("Content-Type", "application/json"); con.setRequestProperty("Accept", "application/json"); con.setDoInput(true); con.setDoOutput(true); OutputStreamWriter output = new OutputStreamWriter( con.getOutputStream() ); String jsonEntity = " \\\"{ \\\" " + " \\\"serverName\\\":\\\"DBNAME\\\", " + " \\\"tableName\\\":\\\"DBTABLE\\", " + " \\\"pks\\\":[ (String) NEWROW.getValue(2, character), ]," + " \\\"action\\\":1 } "; output.write(jsonEntity); output.close(); InputStream input = null; if (con != null) { input = con.getInputStream(); } else { throw new IOException (); } BufferedReader reader = new BufferedReader(new InputStreamReader(input)); List response = new ArrayList (); String line = ""; while ((line = reader.readLine()) != null) { response.add(line); } reader.close(); input.close(); con.disconnect(); } catch (ClassNotFoundException eCls) { } catch (java.sql.SQLException eSql) { } catch (java.net.MalformedURLException e) { } catch (java.io.IOException eIO) { } END

Continue reading...
 
Status
Not open for further replies.
Top