Met Glassfish v2 probeer ik een (MySQL) connectionpool op te zetten. Deze connectionpool probeer ik te benaderen via een (remote) Java applicatie.
Wat heb ik gedaan:
Echter wanneer ik dit uitvoer krijg ik de volgende fout:
23-feb-2009 17:11:07 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 192.168.1.2; port: 3700"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure
(ORBUtilSystemException.java:2690)
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure
(ORBUtilSystemException.java:2711)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
Het lokale ip adres van de server (192.168.1.2) is zo te zien wel bekent bij de client.
Wat mij lijkt, is dat de client nu probeert te verzenden naar het lokale ip van de server i.p.v. de 80.101.xxx.xxx.
Wat heb ik getest:
Wat heb ik gedaan:
- Via de applicatie server 9.1 admin console connectionpool aangemaakt (ping werkt)
- Via de applicatie server 9.1 admin console JDBC resource aangemaakt met de naam jdbc/MySkinning
- Via de applicatie server 9.1 admin console IIOP Listener aangemaakt op adres 0.0.0.0
- Op router van server port 3700 geforward naar de server (192.168.1.2)
Java:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
| public class Main { public static void main(String[] args){ testIt(); } public static void testIt(){ InitialContext ctx; Connection c; Statement statement; try { Properties props = new Properties(); props.put("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory"); props.put("java.naming.factory.url.pkgs", "com.sun.enterprise.naming"); props.put("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl"); props.put("com.sun.CORBA.ORBServerHost", "80.101.xxx.xxx"); props.put("org.omg.CORBA.ORBInitialHost", "80.101.xxx.xxx"); props.put("org.omg.CORBA.ORBInitialPort", "3700"); ctx = new InitialContext(props); javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup("jdbc/MySkinning"); c = ds.getConnection(); statement = c.createStatement(); ResultSet result = (ResultSet) statement.executeQuery("SELECT * FROM users"); statement.close(); result.close(); // Do db operations. c.close(); } catch (SQLException ex) { Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); } catch (NamingException ex){ } } } |
Echter wanneer ik dit uitvoer krijg ik de volgende fout:
23-feb-2009 17:11:07 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 192.168.1.2; port: 3700"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure
(ORBUtilSystemException.java:2690)
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure
(ORBUtilSystemException.java:2711)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
Het lokale ip adres van de server (192.168.1.2) is zo te zien wel bekent bij de client.
Wat mij lijkt, is dat de client nu probeert te verzenden naar het lokale ip van de server i.p.v. de 80.101.xxx.xxx.
Wat heb ik getest:
- Netwerk adres van de IIOP Listener gewijzigd naar het publieke ip adres (80.101.xxx.xxx)
De GF server wil hierdoor niet meer starten - In de sun-acc.xml op de server target-server name en target-server address aangepast naar publieke ip (80.101.xxx.xxx)
Geen resultaat - Zoals al in de code staat com.sun.CORBA.ORBServerHost toegevoegd. Staat op diverse forums dat dit de oplossing is.
Geen verschil
[ Voor 0% gewijzigd door Verwijderd op 23-02-2009 19:01 . Reden: Code buiten beeld ]