Win a copy of Rust Web Development this week in the Other Languages forum!

Patrick Martz

Greenhorn
+ Follow
since Dec 12, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Patrick Martz

i used this instead and it works fine for me.







10 years ago
i get the following error when i try to add an item from an EditText input inside an alert dialog to a spinner through an adapter, actual code below.

error: Fatal Exception: main
java.lang.UnsupportedOperationException
at java.util.AbstractList.add(AbstractList.java:411)
at java.util.AbstractList.add(AbstractList.java:432)
at android.widget.ArrayAdapter.add(ArrayAdapter.java:178)
*at remoteGraphics.oac.Place_RemoteActivity$1.onClick(Place_RemoteActivity.java:121)

declarations:


*line in code



10 years ago
the driver manager needed some easily accessible host names and it passed, thanks for your assistance
11 years ago
Thanks, the signed cert trust confirm dialog did show, and any jar's there after signed with that keystore no longer needed confirmed, but the jar acception did not remedy all errors, i receieved a connect refusal first, solved that, now i get a connection time out error when i try to connect from any client outside of the LAN. its close. thanks again
11 years ago
all class files inside the website are signed, including any .jar file...any outside pc over the internet receives SocketPermission access denial.
11 years ago
Signing the jar did nothing for the clients.. they still receive socket permission access denied
11 years ago
Best way to do this in NetBeans?....project properties?
11 years ago
Ok, now i am getting somewhere, If my clients cannot talk to the applet with the policy files they have and i probably would be better off not having to install a policy file on each user who tries to access, what is the alternative to allowing clients to use the applet...signed java applet?

thanks, im learning
11 years ago
i follow you to the point of the client side. Inside the folder where my src / build/dist/ ...etc folders are from the original IDE's files an applet.policy file is automatically created with any applet. Are you referring to this as the client policy file?

On any server hosting a java applet that accesses other nodes or needs to establish connect's and resolve's it can be done in the java.security file in the program files folder...

what im saying i altered was the file that accompanies the Japplet.jar and classes known as applet.policy, i also had a change of mysql engines, my testing WAMP server is on my local laptop, but i will be hosting the japplet and html @ http://fantasybaseball.dnsdojo.com/. I know i sound redundant, but i'm not understanding the location of the error, i need to reach my applet just on a different server through the above url..what changes....could a mysql connection string with incorrect username or password cause the socket permission...
11 years ago
Hi, i need some help with my japplet. after running from a browser i get this error>



I made a change to the applets policy file as follows:


This code remains in the same directory as the .jar the applet and html page are running from.

my question is regarding to a server side java.security edit, on the server do i need to go to program files/java/jre/lib/security/java.security and add
the directory of the applet and the website pointing to the policy file above?

any other input on the matter is appreciated
thanks for reading

pat
11 years ago
My applet is running from applet tags pointing inside an archive aka jar. The problem arises when i try to connect using driverManager the class.forName(entry) is automatically appended to the directory of the default.aspx page. i don't understand how its going from the inside the jar directly to a higher level url. I need the class.forName() to point it into the jar file in http://sharepoint/site/folder/ .jar file. so it can access the sqlserverdriver in it. Thanks for reading.Patrick.
I got it to work today, had some slight print errors but looked good on all kinds of browsers. Changing the server's and client's different java policy files and security files remedied everything. the socket permissions were the main problem, and adding different codebases helps based on what all is being accessed.
I really appreciate all your help. Thanks.
12 years ago
the applet.policy file in the projects root folder, it is auto made before i do any policy work. by default it had "grant {
permission java.security.AllPermission;
};
"

changing it to the link's specifications here under > Reading a Stack Trace > it didn't help, i still got the error in the above reply.
12 years ago
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2214)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:781)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:352)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:284)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at appletrir.NewJApplet$STPanel.getConnection(NewJApplet.java:1823)
at appletrir.NewJApplet$STPanel.getVendors(NewJApplet.java:395)
at appletrir.NewJApplet$STPanel.<init>(NewJApplet.java:216)
at appletrir.NewJApplet.createAndShowGUI(NewJApplet.java:140)
at appletrir.NewJApplet.access$000(NewJApplet.java:38)
at appletrir.NewJApplet$1.run(NewJApplet.java:162)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied (java.net.SocketPermission alpha resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at sun.plugin2.applet.Applet2SecurityManager.checkConnect(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:243)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:292)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2137)
... 25 more
java.lang.reflect.InvocationTargetException
at java.awt.EventQueue.invokeAndWait(Unknown Source)
at appletrir.NewJApplet.init(NewJApplet.java:155)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at appletrir.NewJApplet$STPanel.getVendors(NewJApplet.java:396)
at appletrir.NewJApplet$STPanel.<init>(NewJApplet.java:216)
at appletrir.NewJApplet.createAndShowGUI(NewJApplet.java:140)
at appletrir.NewJApplet.access$000(NewJApplet.java:38)
at appletrir.NewJApplet$1.run(NewJApplet.java:162)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)



this be the error of my ways. i edited my policy file as :
/* AUTOMATICALLY GENERATED ON Tue Dec 15 14:59:51 EST 2009*/
/* DO NOT EDIT */

grant {
permission java.security.AllPermission;
};

grant {
permission java.net.SocketPermission "alpha", "resolve";
permission java.net.SocketPermission "127.0.0.1:3306", "connect,resolve";
};


i also attempted to run it from the local server it is going to be hosted on and that made no difference and continued seeing errors.
i'll read up on signing for now, thanks again
12 years ago
ok, i got the applet tags to work with a second applet im working on. It has no mysql jdbc database connections. My other applet which uses the jdbc mysql connector jar and accesses a host on our intranet server will not make the connection without getting access denied errors and socket permission problems. I am working through the sun tutorials and learning pages to learn about policies and anything else i need to get it to display. Jar signing seems very involved and i hope that isn't required. but policy edits and other corrections seem to be making some differences, but im not entirely sure yet. I can send the errors when i get back to it tomorrow. thanks Ulf Dittmer
12 years ago