Results 1 to 10 of 10
Thread: Update caused terrible error
- 10-18-2013, 08:25 PM #1
Member
- Join Date
- May 2013
- Posts
- 68
- Rep Power
- 0
- 10-18-2013, 09:18 PM #2
Member
- Join Date
- Jun 2013
- Posts
- 60
- Rep Power
- 0
Re: Update caused terrible error
If the problem is located in the file handling routines, perhaps you could troubleshoot the problem better if you create a small program to open and close a file, copy the appropriate lines of code from your troubled application to that small program and post it here.
- 10-18-2013, 10:02 PM #3
Member
- Join Date
- May 2013
- Posts
- 68
- Rep Power
- 0
Re: Update caused terrible error
You think its in the code rather than the update having some security thing blocking my program to have access to file and directories on my computer? this is what the update says it has in it if you haven't looked yet,
"Protections Against Unauthorized Redistribution of Java Applications
Starting with 7u45, application developers can specify new JAR manifest file attributes:
Application-Name: This attribute provides a secure title for your RIA.
Caller-Allowable-Codebase: This attribute specifies the codebase/locations from which JavaScript is allowed to call Applet classes.
JavaScript to Java calls will be allowed without any security dialog prompt only if:
JAR is signed by a trusted CA, has the Caller-Allowable-Codebase manifest entry and JavaScript runs on the domain that matches it.
JAR is unsigned and JavaScript calls happens from the same domain as the JAR location.
The JavaScript to Java (LiveConnect) security dialog prompt is shown once per AppletclassLoader instance."
- 10-19-2013, 01:06 PM #4
Member
- Join Date
- May 2013
- Posts
- 68
- Rep Power
- 0
Re: Update caused terrible error
here is what im getting when I try to do part of my program with the new update.
Does it have something to do with me not writing in serialization and letting netbeans create its own?
java.io.InvalidClassException: javax.swing.JComponent; local class incompatible: stream classdesc serialVersionUID = 5670834184508236790, local class serialVersionUID = -5074484439485650315
at java.io.ObjectStreamClass.initNonProxy(ObjectStrea mClass.java:617)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectI nputStream.java:1622)
at java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1517)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectI nputStream.java:1622)
at java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1517)
at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1771)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1350)
at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:370)
at java.beans.Beans.instantiate(Beans.java:197)
at java.beans.Beans.instantiate(Beans.java:80)
at screw.inquiry.initComponents(inquiry.java:47)
at screw.inquiry.<init>(inquiry.java:30)
at screw.timingScrew.jButton2ActionPerformed(timingSc rew.java:1543)
at screw.timingScrew.access$2700(timingScrew.java:42)
at screw.timingScrew$28.actionPerformed(timingScrew.j ava:395)
at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.jav a:6505)
at javax.swing.JComponent.processMouseEvent(JComponen t.java:3320)
at java.awt.Component.processEvent(Component.java:627 0)
at java.awt.Container.processEvent(Container.java:222 9)
at java.awt.Component.dispatchEventImpl(Component.jav a:4861)
at java.awt.Container.dispatchEventImpl(Container.jav a:2287)
at java.awt.Component.dispatchEvent(Component.java:46 87)
at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:4422)
at java.awt.Container.dispatchEventImpl(Container.jav a:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719 )
at java.awt.Component.dispatchEvent(Component.java:46 87)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.j ava:735)
at java.awt.EventQueue.access$200(EventQueue.java:103 )
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPri vilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPri vilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:708)
at java.awt.EventQueue$4.run(EventQueue.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPri vilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 705)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:91)
- 10-21-2013, 11:49 AM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 13,541
- Rep Power
- 25
Re: Update caused terrible error
What is happening at this point in your code:
screw.inquiry.initComponents(inquiry.java:47)
?
(I'm guessing that's your code there).
If you're trying to unserialise a presaved Swing component then you possibly should have heeded the comment on the API for every swing component:
"Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing."Please do not ask for code as refusal often offends.
** This space for rent **
- 10-23-2013, 06:35 PM #6
Member
- Join Date
- May 2013
- Posts
- 68
- Rep Power
- 0
Re: Update caused terrible error
this is what happens at initcomponents,
Java Code:private void initComponents() { backButton = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); try { jList1 =(javax.swing.JList)java.beans.Beans.instantiate(getClass().getClassLoader(), "screw.inquiry_jList1"); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (java.io.IOException e) { e.printStackTrace(); } backButton.setText("Back"); backButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { backButtonActionPerformed(evt); } }); jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel1.setText(" Cutter Inquiry"); jScrollPane1.setViewportView(jList1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(26, 26, 26) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 312, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(backButton, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(0, 0, Short.MAX_VALUE)) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 435, Short.MAX_VALUE)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 320, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(backButton) .addContainerGap()) ); pack(); }// </editor-fold>
i get an problem anytime my gui is trying to create a file(based on all the inputs in textboxes and button selections) as well. the file is on the network drive, i dont know if that would matter or not.
is there a way to declare serialization that will be compatible in future? if not what would you do to make this work no matter what updates there are? its for work so i can't keep having to redo this every 4 months when they update. thanks for your help it is really appreciated tolls.
- 10-23-2013, 06:37 PM #7
Member
- Join Date
- May 2013
- Posts
- 68
- Rep Power
- 0
Re: Update caused terrible error
Java Code:public table(){ setLayout(new FlowLayout()); String[] columnNames = {"Cutter #", "Cutter Description"}; String [][] data = { {"1", "1"}, {"1", "1"}, {"1", "1"}, {"1", "1"}, {"1", "1"}, {"1", "1"}, {"1", "1"}, {"1", "1"}, {"1", "1"}, {"1", "1"}, {"1", "1"}, {"1", "1"}, }; // table = new JTable (data,columnNames); // table.setPreferredScrollableViewportSize(new Dimension(500,100)); // table.setFillsViewportHeight(true); // JScrollPane scrollPane = new JScrollPane (table); // add(scrollPane); // // } } public class readfile implements Serializable { private static final long serialVersionUID = 12151215121L; CharSequence cutnum2[] = new CharSequence[51]; String cutdes[] = new String[51]; private Scanner x; String record[] = new String[51]; public void openFile() { try{ x = new Scanner(new File("N:/USERS-Engineers/Gsudicky/program look/Inquiry2.txt")); } catch (Exception w){ System.out.println("could not find file"); } } public String readFile(int b){ int p=1; int n = 1; while(x.hasNextLine()){ record[p]= x.nextLine(); int index = record[p].indexOf(" "); cutdes[p]= record[p].substring(index); System.out.println(cutdes[p]); cutnum2[n]=""+n+""; System.out.println(cutnum2[n]); n= n+1; // System.out.println(record[p]); p=p+1; } return cutdes[b]; } public void closeFile(){ x.close();} }
thanks again for taking your time to look at this
- 10-23-2013, 06:38 PM #8
Member
- Join Date
- May 2013
- Posts
- 68
- Rep Power
- 0
Re: Update caused terrible error
btw i just added the implements serializable and the UID today to try to see if that worked. it wasnt the working either way.
- 10-23-2013, 07:05 PM #9
Member
- Join Date
- May 2013
- Posts
- 68
- Rep Power
- 0
Re: Update caused terrible error
Okay, I think i figured out what is happening. my inquiry class creates a inquiry_jlist.ser file in my project. the other part of my problem that i didnt go into further detail early had a turn_error.ser file. i deleted it and the turnerror class and now i can create files again. something about the jlist.ser file is stopping it from running. Why did it create that file? do i need it? can i write something in the screw.inquiry file to change the jlist.ser file and make it useable again?
- 10-28-2013, 11:36 AM #10
Moderator
- Join Date
- Apr 2009
- Posts
- 13,541
- Rep Power
- 25
Re: Update caused terrible error
That's a serialised Swing component.
And I suspect that it is being read from here :
Java Code:jList1 =(javax.swing.JList)java.beans.Beans.instantiate(getClass().getClassLoader(), "screw.inquiry_jList1");
Please do not ask for code as refusal often offends.
** This space for rent **
Similar Threads
-
SQL - Syntax error in UPDATE statement
By mvidal in forum New To JavaReplies: 3Last Post: 11-16-2012, 08:03 PM -
error while using sql update statement
By jttslg in forum Advanced JavaReplies: 14Last Post: 07-03-2011, 10:38 PM -
fcpred.class update error
By Fulltimer2011 in forum Advanced JavaReplies: 0Last Post: 03-24-2011, 07:41 PM -
Error in JDBC batch update
By murali23krishna in forum JDBCReplies: 8Last Post: 02-21-2011, 11:42 AM -
Software caused connection abort: socket write error
By kuguy in forum NetworkingReplies: 3Last Post: 04-13-2010, 03:43 PM
Bookmarks