Can anyone provide an example of an OSGI WAB or bundle of any kind providing a JNDI DataSource?
Thanks,
Nick Baker
Can anyone provide an example of an OSGI WAB or bundle of any kind providing a JNDI DataSource?
Thanks,
Nick Baker
Hello,
I have a question regarding this bug:
https://java.net/jira/browse/GLASSFISH-16964
The bug is said to be fixed in "3.1.2_b13".
Does it mean that it is fixed in 3.1.2.2 (
https://glassfish.java.net/downloads/3.1.2.2-final.html ) ?
I get confused by the version number.
It doesn't seem to be mentioned in the release doc (
https://glassfish.java.net/docs/3.1.2.2/release-notes.pdf ).
If that fix hasn't been shipped in 3.1.2.2, is there another version I
should get for v3?
Thanks,
Ben
I need to develop some OSGI bundle and webapps the should interact.
eclipse & NB have include the GF4 dependency runtime for webapp's via the IDE tool kits.
But what about OSGI bundles.
In OSGI I want to use for example GF4 CDI for JPA database persistence-unit
So it would be nice if we run or a debug a OSGI bundel it gets deployed in the GF4 autodeploy\bundles so it can interact with the other deploy webapps or bundles
Hi,
We are getting this error. Is there any effect in production.
[#|2013-09-18T09:42:31.930-0400|SEVERE|oracle-glassfish3.1.2|javax.enterprise.system.ssl.security.com.sun.enterprise.security.ssl.impl|_ThreadID=22;_ThreadName=Thread-2;|SEC5054: Certificate has expired: [
[
Version: V3
Subject: CN=GTE CyberTrust Root 5, OU="GTE CyberTrust Solutions, Inc.", O=GTE Corporation, C=US
Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
Key: Sun RSA public key, 2048 bits
modulus: 23741889829347261660812437366387754385443431973861114865490414153884050331745811968523116847625570146592736935209718565296053386842135985534863157983128812774162998053673746470782252407673402238146869994438729551246768368782318393878374421033907597162218758024581735139682087126982809511479059100617027892880227587855877479432885604404402435662802390484099065871430585284534529627347717530352189612077130606642676951640071336717026459037542552927905851171460589361570392199748753414855675665635003335769915908187224347232807336022456537328962095005323382940080676931822787496212635993279098588863972868266229522169377
public exponent: 65537
Validity: [From: Fri Aug 14 10:50:00 EDT 1998,
To: Wed Aug 14 19:59:00 EDT 2013]
Issuer: CN=GTE CyberTrust Root 5, OU="GTE CyberTrust Solutions, Inc.", O=GTE Corporation, C=US
SerialNumber: [ 01b6]
Certificate Extensions: 4
[1]: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 76 0A 49 21 38 4C 9F DE F8 C4 49 C7 71 71 91 9D v.I!8L....I.qq..
]
]
[2]: ObjectId: 2.5.29.32 Criticality=false
CertificatePolicies [
[CertificatePolicyId: [1.2.840.113763.1.2.1.3]
[] ]
]
[3]: ObjectId: 2.5.29.15 Criticality=true
KeyUsage [
Key_CertSign
Crl_Sign
]
[4]: ObjectId: 2.5.29.19 Criticality=true
BasicConstraints:[
CA:true
PathLen:5
]
]
Algorithm: [SHA1withRSA]
Signature:
0000: 41 3A D4 18 5B DA B8 DE 21 1C E1 8E 09 E5 F1 68 A:..[...!......h
0010: 34 FF DE 96 F4 07 F5 A7 3C F3 AC 4A B1 9B FA 92 4.......<..J....
0020: FA 9B ED E6 32 21 AA 4A 76 C5 DC 4F 38 E5 DF D5 ....2!.Jv..O8...
0030: 86 E4 D5 C8 76 7D 98 D7 B1 CD 8F 4D B5 91 23 6C ....v......M..#l
0040: 8B 8A EB EA 7C EF 14 94 C4 C6 F0 1F 4A 2D 32 71 ............J-2q
0050: 63 2B 63 91 26 02 09 B6 80 1D ED E2 CC B8 7F DB c+c.&...........
0060: 87 63 C8 E1 D0 6C 26 B1 35 1D 40 66 10 1B CD 95 .c...l&.5.@f....
0070: 54 18 33 61 EC 13 4F DA 13 F7 99 AF 3E D0 CF 8E T.3a..O.....>...
0080: A6 72 A2 B3 C3 05 9A C9 27 7D 92 CC 7E 52 8D B3 .r......'....R..
0090: AB 70 6D 9E 89 9F 4D EB 1A 75 C2 98 AA D5 02 16 .pm...M..u......
00A0: D7 0C 8A BF 25 E4 EB 2D BC 98 E9 58 38 19 7C B9 ....%..-...X8...
00B0: 37 FE DB E2 99 08 73 06 C7 97 83 6A 7D 10 01 2F 7.....s....j.../
00C0: 32 B9 17 05 4A 65 E6 2F CE BE 5E 53 A6 82 E9 9A 2...Je./..^S....
00D0: 53 0A 84 74 2D 83 CA C8 94 16 76 5F 94 61 28 F0 S..t-.....v_.a(.
00E0: 85 A7 39 BB D7 8B D9 A8 B2 13 1D 54 09 34 24 7D ..9........T.4$.
00F0: 20 81 7D 66 7E A2 90 74 5C 10 C6 BD EC AB 1B C2 ..f...t\.......
]|#]
[#|2013-09-18T09:42:34.662-0400|INFO|oracle-glassfish3.1.2|javax.enterprise.system.tools.admin.com.sun.enterprise.container.common|_ThreadID=23;_ThreadName=Thread-2;|User [] from host ftmsi does not have administration access|#]
[#|2013-09-18T09:42:37.181-0400|SEVERE|oracle-glassfish3.1.2|javax.enterprise.system.ssl.security.com.sun.enterprise.security.ssl.impl|_ThreadID=24;_ThreadName=Thread-2;|SEC5054: Certificate has expired: [
[
Version: V3
Subject: CN=GTE CyberTrust Root 5, OU="GTE CyberTrust Solutions, Inc.", O=GTE Corporation, C=US
Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
Key: Sun RSA public key, 2048 bits
modulus: 23741889829347261660812437366387754385443431973861114865490414153884050331745811968523116847625570146592736935209718565296053386842135985534863157983128812774162998053673746470782252407673402238146869994438729551246768368782318393878374421033907597162218758024581735139682087126982809511479059100617027892880227587855877479432885604404402435662802390484099065871430585284534529627347717530352189612077130606642676951640071336717026459037542552927905851171460589361570392199748753414855675665635003335769915908187224347232807336022456537328962095005323382940080676931822787496212635993279098588863972868266229522169377
public exponent: 65537
Validity: [From: Fri Aug 14 10:50:00 EDT 1998,
To: Wed Aug 14 19:59:00 EDT 2013]
Issuer: CN=GTE CyberTrust Root 5, OU="GTE CyberTrust Solutions, Inc.", O=GTE Corporation, C=US
SerialNumber: [ 01b6]
Certificate Extensions: 4
[1]: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 76 0A 49 21 38 4C 9F DE F8 C4 49 C7 71 71 91 9D v.I!8L....I.qq..
]
]
[2]: ObjectId: 2.5.29.32 Criticality=false
CertificatePolicies [
[CertificatePolicyId: [1.2.840.113763.1.2.1.3]
[] ]
]
[3]: ObjectId: 2.5.29.15 Criticality=true
KeyUsage [
Key_CertSign
Crl_Sign
]
[4]: ObjectId: 2.5.29.19 Criticality=true
BasicConstraints:[
CA:true
PathLen:5
]
]
Algorithm: [SHA1withRSA]
Signature:
0000: 41 3A D4 18 5B DA B8 DE 21 1C E1 8E 09 E5 F1 68 A:..[...!......h
0010: 34 FF DE 96 F4 07 F5 A7 3C F3 AC 4A B1 9B FA 92 4.......<..J....
0020: FA 9B ED E6 32 21 AA 4A 76 C5 DC 4F 38 E5 DF D5 ....2!.Jv..O8...
0030: 86 E4 D5 C8 76 7D 98 D7 B1 CD 8F 4D B5 91 23 6C ....v......M..#l
0040: 8B 8A EB EA 7C EF 14 94 C4 C6 F0 1F 4A 2D 32 71 ............J-2q
0050: 63 2B 63 91 26 02 09 B6 80 1D ED E2 CC B8 7F DB c+c.&...........
0060: 87 63 C8 E1 D0 6C 26 B1 35 1D 40 66 10 1B CD 95 .c...l&.5.@f....
0070: 54 18 33 61 EC 13 4F DA 13 F7 99 AF 3E D0 CF 8E T.3a..O.....>...
0080: A6 72 A2 B3 C3 05 9A C9 27 7D 92 CC 7E 52 8D B3 .r......'....R..
0090: AB 70 6D 9E 89 9F 4D EB 1A 75 C2 98 AA D5 02 16 .pm...M..u......
00A0: D7 0C 8A BF 25 E4 EB 2D BC 98 E9 58 38 19 7C B9 ....%..-...X8...
00B0: 37 FE DB E2 99 08 73 06 C7 97 83 6A 7D 10 01 2F 7.....s....j.../
00C0: 32 B9 17 05 4A 65 E6 2F CE BE 5E 53 A6 82 E9 9A 2...Je./..^S....
00D0: 53 0A 84 74 2D 83 CA C8 94 16 76 5F 94 61 28 F0 S..t-.....v_.a(.
00E0: 85 A7 39 BB D7 8B D9 A8 B2 13 1D 54 09 34 24 7D ..9........T.4$.
00F0: 20 81 7D 66 7E A2 90 74 5C 10 C6 BD EC AB 1B C2 ..f...t\.......
]|#]
[#|2013-09-18T09:42:37.193-0400|WARNING|oracle-glassfish3.1.2|org.apache.catalina.connector.Request|_ThreadID=24;_ThreadName=Thread-2;|PWC4011: Unable to set request character encoding to UTF-8 from context , because request parameters have already been read, or ServletRequest.getReader() has already been called|#]
[#|2013-09-18T09:42:37.340-0400|INFO|oracle-glassfish3.1.2|javax.enterprise.system.tools.admin.com.sun.enterprise.container.common|_ThreadID=25;_ThreadName=Thread-2;|User [] from host ftmsi does not have administration access|#]
[#|2013-09-18T09:43:02.598-0400|SEVERE|oracle-glassfish3.1.2|javax.enterprise.system.ssl.security.com.sun.enterprise.security.ssl.impl|_ThreadID=26;_ThreadName=Thread-2;|SEC5054: Certificate has expired: [
[
Version: V3
Subject: CN=GTE CyberTrust Root 5, OU="GTE CyberTrust Solutions, Inc.", O=GTE Corporation, C=US
Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
Key: Sun RSA public key, 2048 bits
modulus: 23741889829347261660812437366387754385443431973861114865490414153884050331745811968523116847625570146592736935209718565296053386842135985534863157983128812774162998053673746470782252407673402238146869994438729551246768368782318393878374421033907597162218758024581735139682087126982809511479059100617027892880227587855877479432885604404402435662802390484099065871430585284534529627347717530352189612077130606642676951640071336717026459037542552927905851171460589361570392199748753414855675665635003335769915908187224347232807336022456537328962095005323382940080676931822787496212635993279098588863972868266229522169377
public exponent: 65537
Validity: [From: Fri Aug 14 10:50:00 EDT 1998,
To: Wed Aug 14 19:59:00 EDT 2013]
Issuer: CN=GTE CyberTrust Root 5, OU="GTE CyberTrust Solutions, Inc.", O=GTE Corporation, C=US
SerialNumber: [ 01b6]
Certificate Extensions: 4
[1]: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 76 0A 49 21 38 4C 9F DE F8 C4 49 C7 71 71 91 9D v.I!8L....I.qq..
]
]
[2]: ObjectId: 2.5.29.32 Criticality=false
CertificatePolicies [
[CertificatePolicyId: [1.2.840.113763.1.2.1.3]
[] ]
]
[3]: ObjectId: 2.5.29.15 Criticality=true
KeyUsage [
Key_CertSign
Crl_Sign
]
[4]: ObjectId: 2.5.29.19 Criticality=true
BasicConstraints:[
CA:true
PathLen:5
]
]
Algorithm: [SHA1withRSA]
Signature:
0000: 41 3A D4 18 5B DA B8 DE 21 1C E1 8E 09 E5 F1 68 A:..[...!......h
0010: 34 FF DE 96 F4 07 F5 A7 3C F3 AC 4A B1 9B FA 92 4.......<..J....
0020: FA 9B ED E6 32 21 AA 4A 76 C5 DC 4F 38 E5 DF D5 ....2!.Jv..O8...
0030: 86 E4 D5 C8 76 7D 98 D7 B1 CD 8F 4D B5 91 23 6C ....v......M..#l
0040: 8B 8A EB EA 7C EF 14 94 C4 C6 F0 1F 4A 2D 32 71 ............J-2q
0050: 63 2B 63 91 26 02 09 B6 80 1D ED E2 CC B8 7F DB c+c.&...........
0060: 87 63 C8 E1 D0 6C 26 B1 35 1D 40 66 10 1B CD 95 .c...l&.5.@f....
0070: 54 18 33 61 EC 13 4F DA 13 F7 99 AF 3E D0 CF 8E T.3a..O.....>...
0080: A6 72 A2 B3 C3 05 9A C9 27 7D 92 CC 7E 52 8D B3 .r......'....R..
0090: AB 70 6D 9E 89 9F 4D EB 1A 75 C2 98 AA D5 02 16 .pm...M..u......
00A0: D7 0C 8A BF 25 E4 EB 2D BC 98 E9 58 38 19 7C B9 ....%..-...X8...
00B0: 37 FE DB E2 99 08 73 06 C7 97 83 6A 7D 10 01 2F 7.....s....j.../
00C0: 32 B9 17 05 4A 65 E6 2F CE BE 5E 53 A6 82 E9 9A 2...Je./..^S....
00D0: 53 0A 84 74 2D 83 CA C8 94 16 76 5F 94 61 28 F0 S..t-.....v_.a(.
00E0: 85 A7 39 BB D7 8B D9 A8 B2 13 1D 54 09 34 24 7D ..9........T.4$.
00F0: 20 81 7D 66 7E A2 90 74 5C 10 C6 BD EC AB 1B C2 ..f...t\.......
Hi,
I get below error when I redeploy. Please help
Error occurred during deployment: Keys cannot be duplicate. Old value of this key property, nullwill be retained.
Please see server.log for more details.
java.lang.LinkageError: loader (instance of org/glassfish/web/loader/WebappClassLoader): attempted duplicate class definition for name: "org/glassfish/web/loader/JdbcLeakPrevention"
Hello,
I am experimenting with the servlet async support in Java EE7 and Glassfish 4.0 and just can't seem to get this to work.
So far, I've done the following:
I have created an AsyncReaderServlet class with the following definition:
@WebServlet(urlPatterns = {"/async-reader-servlet"}, asyncSupported = true)
public class AsyncReaderServlet extends HttpServlet {
/**
* Processes requests for both HTTP
* GET
and
* POST
methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
out.println("");
out.println("");
out.println("
");
out.println("
Look at the server log to see data that was read asynchronously from a file
");
AsyncContext asyncContext = request.startAsync();
ServletInputStream servletInputStream = request.getInputStream();
servletInputStream.setReadListener(new AsyncReadListener(servletInputStream, asyncContext, request.getServletContext()));
out.println("
"); /**
* Handles the HTTP
* GET
method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP
* POST
method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}
with the AsyncReadListener class being the following:
public class AsyncReadListener implements ReadListener {
private ServletInputStream servletInputStream;
private AsyncContext asyncContext;
private ServletContext servletContext;
public AsyncReadListener(ServletInputStream servletInputStream, AsyncContext asyncContext,
ServletContext servletContext) {
this.servletInputStream = servletInputStream;
this.asyncContext = asyncContext;
this.servletContext = servletContext;
}
@Override
public void onDataAvailable() throws IOException {
servletContext.log("OnDataAvailable()");
try {
int length = -1;
byte[] buffer = new byte[1024];
while (servletInputStream.isReady() && (length = servletInputStream.read(buffer)) != -1) {
String readContent = new String(buffer, 0, length);
servletContext.log(readContent);
}
} catch (IOException ioex) {
ioex.printStackTrace();
}
}
@Override
public void onAllDataRead() throws IOException {
servletContext.log("All data read...");
asyncContext.complete();
}
@Override
public void onError(Throwable t) {
t.printStackTrace();
asyncContext.complete();
}
}
The client initiating the request in this experimental setup is the following:
public class AsyncReaderDriver {
public static void main(String[] args) {
try {
Path path = Paths.get("/home/savvas/tmp/demo-file");
BufferedReader fileReader = new BufferedReader(new FileReader(path.toFile()));
URL url = new URL("http://localhost:8080/JavaEE7/async-reader-servlet");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setChunkedStreamingMode(1024);
conn.setDoOutput(true);
conn.connect();
String line = "";
try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(conn.getOutputStream()))) {
while ((line = fileReader.readLine()) != null) {
writer.write(line);
System.out.println("read line:" + line);
writer.flush();
}
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
which simply reads a text file and makes an HTTP request to the above servlet.
Now, every time I run the above main method I get the following exception in my NetBeans console:
SEVERE: java.lang.IllegalStateException: Request is within the scope of a filter or servlet that does not support asynchronous operations
at org.apache.catalina.connector.Request.startAsync(Request.java:4259)
at org.apache.catalina.connector.Request.startAsync(Request.java:4221)
at org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031)
..........................................................................................................................................................................................................................................................
............................................................................................................................................................................................
............................................................................................................................................................................................
The interesting detail is that if I comment out the following bit as in:
// conn.setChunkedStreamingMode(1024);
I am no longer getting the above exception but the listener doesn't get called either since nothing gets written to the console
so I'm assuming the client needs to be setting the correct headers along with the request which would make perfect sense!
Does anyone know what those headers should be or if I'm doing something completely wrong?
I have already tried the solution of declaring my servlet in web.xml with the correct element set to true but that didn't have any effect.
Any ideas, much appreciated.
Cheers,
Savvas
Hi all,
I'm trying to create a servlet to test Basic Authentication. I'm using Arquillian with Glassfish Embedded.
I have some questions:
1. I created a user in a separate Glassfish, I saw that it put my user in a file named keyfile. Where should I put this file in my project?
2. I put this in my web.xml (the file is in src/test/resources/security), is it correct?
3. I create a file name sun-web.xml (the file is in src/test/resources/security) with the code below, is it correct?
4. I copy the file domain.xml from the separeted Glassfish and put it in the directory src/test/resources/security, is it correct?
Below, the code from my AuthenticationServlet.
public class AuthenticationServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
@Inject
private SecurityContext securityContext;
@Inject
private Credentials credentials;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
credentials.setUsername("asdrubal");
credentials.setPassword("asdrubal");
securityContext.login();
response.setStatus(HttpStatus.SC_OK);
}
}
Below, my keyfile content.
asdrubal;{SSHA256}xYbabe0zKCOUrsH4SNQ+MK75W7FxJujcDcAJ9iXruHm1uT5mn+yktw==;users
Below, my test class:
@RunWith(Arquillian.class)
public class SecurityTest {
private static final String PATH = "src/test/resources/security";
@ArquillianResource
private URL deploymentUrl;
@Deployment(testable = false)
public static WebArchive createDeployment() {
return Tests.createDeployment().addClass(AuthenticationServlet.class)
.add(Tests.createFileAsset(PATH + "/keyfile"), "keyfile")
.addAsWebInfResource(Tests.createFileAsset(PATH + "/domain.xml"), "domain.xml")
.addAsWebInfResource(Tests.createFileAsset(PATH + "/sun-web.xml"), "sun-web.xml")
.addAsWebInfResource(Tests.createFileAsset(PATH + "/web.xml"), "web.xml");
}
@Test
public void authentication() throws Exception {
HttpClient client = new HttpClient();
GetMethod method = new GetMethod(deploymentUrl + "/AuthenticationServlet");
try {
int status = client.executeMethod(method);
assertEquals(HttpStatus.SC_OK, status);
} catch (Exception e) {
fail();
}
}
}
Where I'm going wrong?
Hello,
I'm new on java technologie and glassfish administration and i encounter a problem with the client authentification in glassfish v3.1.2.2
I need to use a self-signed CA for a pool of embedded system, but i cannot add my CA cert file in glassfish.
There are no problem for check the server ssl.
There are functionnal if i add directly the client certificate in the cacert.jks.
But that doesn't work if i use the CA (self-signed) for control my client certificate.
The ssl sequence is stop just after the server receive the client certificate with a TCP reset.
My configuration :
On glassfish :
- set client auth (that work because if i use directly certificate is ok.
- Disable http et set https (that work)
I have import my root certificate in :
java/jre/lib/security/cacert
java/jdk/jre/lib/securty/cacert
glassfish_server/glassfish/lib/template/cacert.jks
glassfish_server/glassfish/domain/domain1/config/cacert.jks
in windows 7
My certifcate seem to be valid i have control them with :
openssl verify -CAfile caSwiss.crt rainbow.crt
thanks for help
I not understand what it is the node form the panel admin of glassfsih.
I have read from the node config that it is present the propertie node name that it is set uo at localhost at default .
If i would create a new server instance (not virtual host) at name for example myexample.org i have to crfeate a new config and a newe node with the name for the host myexamople.org?
I not understand.
I know that the orb of glassfiht return always the ip of the machine into is installed glassfish.
.
So for test i have thinking to create a new instance server with the name for the host like writed above.
BUt not understand the concepts of server instance shared (not cluster) and a the concpt of node with own properties.
A example of its ?
tank you .
I`m using Netbeans 7.3.1, Glassfish and MySql. When I try to run my application the Glassfish only look in the 1527 port, although the connecting pool, data source and connection from the application are set to 3306. Anyone can help?
Thanks in advance.
I have been using a stub for soap webservice call generated using the Axis 2 framework.
The same code has worked in Glassfish 2.1 and Glassfish 3.0.1.
But in Glassfish 3.1.2 it encounters the following exceptions:
[ INFO] 2013-09-18 17:08:02,435 (HTTPSender.java:sendViaPost:202)Unable to sendViaPost to url[https://...]
org.apache.axis2.AxisFault: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:83)
at org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:84)
at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:557)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:438)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
Caused by: com.ctc.wstx.exc.WstxIOException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate
at com.ctc.wstx.sw.BaseStreamWriter._finishDocument(BaseStreamWriter.java:1408)
at com.ctc.wstx.sw.BaseStreamWriter.close(BaseStreamWriter.java:249)
at org.apache.axiom.util.stax.wrapper.XMLStreamWriterWrapper.close(XMLStreamWriterWrapper.java:46)
at org.apache.axiom.om.impl.MTOMXMLStreamWriter.close(MTOMXMLStreamWriter.java:188)
at org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:197)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:79)
... 50 more
Caused by: javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.java:1325)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkWrite(SSLSocketImpl.java:1337)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:44)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at org.apache.commons.httpclient.ChunkedOutputStream.flush(ChunkedOutputStream.java:191)
at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:103)
at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:225)
at com.ctc.wstx.sw.BufferingXmlWriter.close(BufferingXmlWriter.java:198)
at com.ctc.wstx.sw.BaseStreamWriter._finishDocument(BaseStreamWriter.java:1406)
... 55 more
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:136)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1806)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:986)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1170)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:637)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:88)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at org.apache.commons.httpclient.ChunkedOutputStream.flush(ChunkedOutputStream.java:191)
at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:103)
at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:225)
at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:261)
at org.apache.axiom.util.stax.wrapper.XMLStreamWriterWrapper.flush(XMLStreamWriterWrapper.java:50)
at org.apache.axiom.om.impl.MTOMXMLStreamWriter.flush(MTOMXMLStreamWriter.java:198)
at org.apache.axis2.databinding.utils.writer.MTOMAwareXMLSerializer.flush(MTOMAwareXMLSerializer.java:79)
at org.apache.axis2.databinding.ADBDataSource.serialize(ADBDataSource.java:94)
at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:695)
at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:563)
at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:874)
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:283)
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:245)
at org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:193)
... 51 more
Any idea? Initial thought was the cert needs to be imported. But error persists even after the import.
ccing users mailing list
On 9/24/13 3:40 PM, Armel Fabrice Ndjobo wrote:
> Hello everyone,
> I am writing a book about putting glassfish in production and I wonder
> if there is some documents available about glassfish Application
> server architecture and if some of you have specific issues they want
> to see in the book. Thank
>
> --
> Developpez.com copywriter
>
> Java EE developer
>
> Oracle Certified Java Programmer 6
>
> Oracle Certified Expert, Java EE 6 Java Persistence API Developer
>
> Technical Reviewer of *Apress **- USA*
>
> * *Pro Spring Integration*
> * **Beginning EJB BOOK*
> *
>
Hi All,
We have a requirement to have an OSGI service handle a logging event. We have produced an OSGI bundle that implements the java.util.logging.Handler interface and the plan was for this to pass the LogRecord to another OSGI service that would actually process it. We deployed the Handler by adding the implementation class to the handlers= line in logging.properties. Glassfish doesn't seem to like the Handler being an OSGI bundle, however. A NoClassDefFoundError on org/osgi/util/tracker/ServiceTracker was raised fairly early in the boot suggesting the OSGI runtime is not available at the point that Handlers get configured. Can anyone suggest how me might get this working or alternatively suggest an efficient way to pass a LogRecord between a non-OSGI Handler and an OSGI service.
Thanks
Greetings,
I'm wondering if anyone has experienced a problem similar to ours. After running fine for a period of time, with no errors in server.log and low CPU load, our DAS begins generating lots of GMS-related errors and the load gets quite high. Restarting the DAS and all clusters makes the problem go away for a couple days until it returns again. Increasing the java VM memory helped, but only by making the problem take longer to recur. Some info about the system:
* Three VMs - one as the DAS server and the other two as nodes where all instances are hosted
* 11 clusters, each with two instances (one per node)
* Memory limit upped to 2G: -Xmx2048m, -Xms2048m
* ulimit -n 65536 (open files limit, this is Solaris 10)
* ulimit -s 65536 (stack size limit)
The java process for the DAS domain itself is the one that starts using all the CPU time. Are the threads mentioned in the log messages below part of a particular thread pool? It seemed to me that they are not. Multicast is enabled and in use for these servers.
Any ideas on what I need to adjust to correct this? Here's an example of the error messages that I see:
[#|2013-09-24T09:38:14.122-0700|SEVERE|glassfish3.1.2|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=423;_ThreadName=Thread-2;|Connection timed out|#]
[#|2013-09-24T09:38:19.873-0700|SEVERE|glassfish3.1.2|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=520;_ThreadName=Thread-2;|Connection timed out|#]
[#|2013-09-24T09:38:25.062-0700|WARNING|glassfish3.1.2|ShoalLogger|_ThreadID=32;_ThreadName=Thread-2;|GMS1042: failed to send heartbeatmessage with state=aliveandready to member 169.254.182.77:9197:228.9.114.120:7221:Cluster1:Cluster1-Node1-Instance. Reason: IOException:failed to connect to 169.254.182.77:9197:228.9.114.120:7221:Cluster1:Cluster1-Node1-Instance|#]
[#|2013-09-24T09:38:44.164-0700|WARNING|glassfish3.1.2|ShoalLogger|_ThreadID=421;_ThreadName=Thread-2;|failed to send a pong message
java.io.IOException: failed to connect to 169.254.182.77:9111:228.9.0.164:18979:Cluster2:Cluster2-Node1-Instance
at com.sun.enterprise.mgmt.transport.grizzly.grizzly1_9.GrizzlyTCPConnectorWrapper.send(GrizzlyTCPConnectorWrapper.java:132)
at com.sun.enterprise.mgmt.transport.grizzly.grizzly1_9.GrizzlyTCPConnectorWrapper.doSend(GrizzlyTCPConnectorWrapper.java:96)
at com.sun.enterprise.mgmt.transport.AbstractMessageSender.send(AbstractMessageSender.java:74)
at com.sun.enterprise.mgmt.transport.grizzly.GrizzlyNetworkManager.send(GrizzlyNetworkManager.java:288)
at com.sun.enterprise.mgmt.transport.grizzly.PingMessageListener.receiveMessageEvent(PingMessageListener.java:82)
at com.sun.enterprise.mgmt.transport.AbstractNetworkManager.receiveMessage(AbstractNetworkManager.java:144)
at com.sun.enterprise.mgmt.transport.grizzly.grizzly1_9.GrizzlyMessageDispatcherFilter.execute(GrizzlyMessageDispatcherFilter.java:75)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.net.ConnectException: Connection timed out
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:692)
at com.sun.grizzly.TCPConnectorHandler.finishConnect(TCPConnectorHandler.java:297)
at com.sun.grizzly.connectioncache.client.CacheableConnectorHandler.finishConnect(CacheableConnectorHandler.java:230)
at com.sun.enterprise.mgmt.transport.grizzly.grizzly1_9.GrizzlyTCPConnectorWrapper$CloseControlCallbackHandler.onConnect(GrizzlyTCPConnectorWrapper.java:185)
at com.sun.grizzly.CallbackHandlerContextTask.doCall(CallbackHandlerContextTask.java:70)
... 5 more
|#]
[#|2013-09-24T09:38:44.163-0700|SEVERE|glassfish3.1.2|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=423;_ThreadName=Thread-2;|Connection timed out|#]
[#|2013-0924T09:38:44.163-0700|SEVERE|glassfish3.1.2|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=548;_ThreadName=Thread-2;|Connection timed out|#]
Thanks in advance for any suggestions!
I have been asked to help 'clusterize' a deployment and can't deploy our app due to JMS issues. Please have some patience I am new to clustering and know jms from a dev viewpoint. But I am trying to include complete info as efficiently as possible.
I keep getting the following errors on our nodes when deploying from the central DAS:
[2013-09-24T22:33:14.821+0000] [glassfish 4.0] [WARNING] [] [javax.jms] [tid: _ThreadID=34 _ThreadName=admin-listener(3)] [timeMillis: 1380061994821] [levelValue: 900] [[
[C4003]: Error occurred on connection creation [staging_jms_backend.myserver.com:27676]. - cause: java.net.ConnectException: Connection refused]]
[2013-09-24T22:33:19.823+0000] [glassfish 4.0] [WARNING] [] [javax.jms] [tid: _ThreadID=34 _ThreadName=admin-listener(3)] [timeMillis: 1380061999823] [levelValue: 900] [[
[C4003]: Error occurred on connection creation [staging_jms_backend.myserver.com:27676]. - cause: java.net.ConnectException: Connection refused]]
[2013-09-24T22:33:19.827+0000] [glassfish 4.0] [SEVERE] [] [] [tid: _ThreadID=34 _ThreadName=Thread-4] [timeMillis: 1380061999827] [levelValue: 1000] [[
com.sun.messaging.jms.JMSException: [C4003]: Error occurred on connection creation [staging_jms_backend.myserver.com:27676]. - cause: java.net.ConnectException: Connection refused
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.throwConnectionException(ExceptionHandler.java:280)
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.handleConnectException(ExceptionHandler.java:226)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.readBrokerPorts(PortMapperClient.java:278)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.init(PortMapperClient.java:156)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.
at com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPConnectionHandler.
at com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler.openConnection(TCPStreamHandler.java:141)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionInitiator.java:785)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnectionNew(ConnectionInitiator.java:260)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionInitiator.java:214)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionInitiator.java:164)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.init(ProtocolHandler.java:874)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.openConnection(ConnectionImpl.java:2470)
(I have attached a more complete log snippet).
I am trying to set up two servers as 'front end' servers in a cluster (glassfish jms client servers). There is a separate server used as a DAS. i.e. One controller and two nodes all on separate Amazon AWS instances.
The two servers use MDBs to get information from several Topics on a singe REMOTE back end server that collects data from external services. So the front end clustered servers need to connect using JMS to the back end server.
The topics have been created by the devs in glassfish-resources.xml. No ports were configured.
I set up the config on the glassfish clients to 'hit' the remote backend server on port 27676 but when I tried to ping from the jms connector pool in the DAS it failed.
When I set up them up to hit 7676 it worked. And I can see this when monitoring the two nodes' server.log
Then I try to deploy the app and for some reason the glassfish clients want to try to connect to 27676. Then deploy fails with the messages above.
When I telnet the backend I see the status of jms I see this:
ubuntu@ip-10-0-0-126:/opt/glassfish/glassfish/domains/domain1/logs$ telnet 10.0.0.126 27676
Trying 10.0.0.126...
telnet: Unable to connect to remote host: Connection refused
ubuntu@ip-10-0-0-126:/opt/glassfish/glassfish/domains/domain1/logs$ telnet 10.0.0.126 7676
Trying 10.0.0.126...
Connected to 10.0.0.126.
Escape character is '^]'.
101 imqbroker 301
portmapper tcp PORTMAPPER 7676 [imqvarhome=/opt/glassfish4/glassfish/domains/domain1/imq,imqhome=/opt/glassfish4/mq,sessionid=4592899014103577344]
cluster_discovery tcp CLUSTER_DISCOVERY 0
jmxrmi rmi JMX 0 [url=service:jmx:rmi://ip-10-0-0-126/jndi/rmi://ip-10-0-0-126.ec2.internal:7776/ip-10-0-0-126.ec2.internal/7676/jmxrmi]
admin tcp ADMIN 46048
jms tcp NORMAL 33603
cluster tcp CLUSTER 42126
.
Connection closed by foreign host.
The 10... address is the backend server, and I get this response if I run it on this on the backend or the front end.
So I have to conclude the front end is not trying to connect correctly.... it is trying to choose port 27676 when the back end is clearly only set up to receive jms connections on 7676. Even remotely.
I'll attach the domain.xml for the front and back ends as well. I inherited this and hope someone can help me out. :)
Hi everybody,
I`m working with Linux systems for a few years and now i have opportunity to make a step up in my career and that includes learning a new things ofcourse.
I got a task that i have to finish and that includes glassfish, oracle db and java environment and i really need help with that cause this looks like a new world for me. :) Anyway, i dont want to post my task here cause i think thats not a way, i want to finish it by my self but i would appreciate help when i stuck at something and i cant find solution by my self. So if there is anyone here with a good will to help me i would appreciate some kind of contact so i can ask a few begginers questions.
Thanks!
Hi guys,
I`m trying to solve a problem that i have.
Lets have an example, if i need to create 3 instances localy which will form a cluster, should i create them under same node or under different nodes?
Also, manual says that when i create instances it will automaticaly create brokers for each of them and one broker cluster but i dont see that happening.
Thanks
I am looking for some guidance on how to get the http access log to write to a database instead of the log file.
I have found examples on how to do this with the general server log files, but not much on how to change just the access logs.
Any information or links to blogs etc would be helpful.
Thanks!
I am looking for some guidance on how to get the http access log to write to a database instead of the log file.
I have found examples on how to do this with the general server log files, but not much on how to change just the access logs.
Any information or links to blogs etc would be helpful.
Thanks!
I would like to securely pass an aliased password to my application.
1) I have setup a password alias:
asadmin> create-password-alias
Enter the value for the aliasname operand> my_password_alias
Enter the alias password> *******
Enter the alias password again> ******
2) I have configured the password in domain.xml for a jvm option
3) My application accesses the decrypted password through the jvm arg:
String password = System.getEnv("my_password")
...
// use password to access resource, for example a password protected keystore
4) However, password returned from the getEnv call was `null`
Question:
Will glassfish allow me to provide the password through the JVM arg? If not, do I have another option for securely passing the aliased password?