Win a copy of Event Streams in Action this week in the Java in General forum!

Ryan Kostrzewa

Ranch Hand
+ Follow
since Dec 29, 2014
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
1
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 Ryan Kostrzewa

Hey Jeanne, thanks for the response! I am using Maven - I've actually seen the plugin before, but I'm hoping to get even more granular. Running features in parallel has already cut down on a lot of time, but since the examples within a Scenario Outline still run sequentially, I was hoping to run the examples in parallel. Have you heard of anything with that kind of functionality?

-Ryan
2 years ago
The company I work at is big on ATDD, and my team currently uses Gherkin and Cucumber as the primary testing framework. For the most part, it works great, and we are able to everything we need to do. Generally, the testing we are doing consists of submitting an application, waiting for it to approve (~12 seconds), getting JSON responses from a URL, and then parsing values out of that JSON and ensuring they match the expected values, in that order.

Cucumber and our testing framework has been great for this functionally, but for large (100+ test case) implementations, this takes a LONG time, and I'm wondering if there is a framework that would allow us to run test cases in parallel instead. There's no reason to run these test cases sequentially; the apps could all be dropped simultaneously, and the infrastructure behind the URLs is robust enough to be hit more than once every 30 seconds (I think... :P). I'm kind of green at testing and automations, do ya'll have any suggestions? Much appreciated!
I've never used hibernate but I've read it's an alternative to jdbc. would it be possible to set that up, or would it fail for similar reasons? I'm assuming it doesn't use jdbc drivers right?
Thank ya sir! Yeah, it's an interesting problem. I'll definitely talk to the team that owns that server and see if they've had to deal with this in the past. I wonder if there's any alternate way to upload files into the db but I'd like to be consistent and I've been using prepared statements for non-blob stuff all over my code already.
Actually, let me take a step back here - I get what you're saying about a mismatch between the driver and the JRE....but since both are set on the server, and I don't have control of the server, does that mean I'm essentially powerless to solve this problem? I'd need to be able to change the driver the server is using or the JRE version, right?
Yeah, it actually occurred to me that that didn't make sense, so I took ojdbc6 out of my application now entirely. Generically speaking, how would you go about debugging this?
I haven't done any tests outside of a weblogic environment, but in a separate dev environment on a slightly newer (10.3.6) version of Weblogic, it does work...different version of weblogic, differnet drivers, etc., but I dont have control over the QA environment that's giving me this issue.
Hey everyone,

I have a template file which I'm trying to upload into a database using setBlob or setBinaryStream but I'm getting the following error:

####<May 28, 2015 1:41:57 PM EDT> <Error> <HTTP> <server-name-redacted> <msp_bpmsp_qas_01_m00> <[ACTIVE] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1432834917685> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext@85c0ec3 - appName: 'katet_qa', name: 'katet_qa.war', context-path: '/katet_qa', spec-version: '2.5'] Root cause of ServletException.
java.lang.AbstractMethodError: setBlob
at weblogic.jdbc.wrapper.PreparedStatement.setBlob(PreparedStatement.java:1005)
at com.redacted.citrix.ssp.dao.KatetDaoImpl.uploadReport(KatetDaoImpl.java:1694)
at com.redacted.citrix.ssp.services.FileOpsImpl.generateDownload(FileOpsImpl.java:823)
at com.credacted.citrix.ssp.controller.JSONController.display(JSONController.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:175)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:446)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:434)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:821)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:176)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
>

The database version is Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production.
I'm using a Weblogic Server, version WebLogic Server Version: 10.3.0.0
The driver class name for the datasource is weblogic.jdbcx.oracle.OracleDataSource
Edit: Initiailly, my application was using Java 1.5. I updated it to 1.6 to be consistent with the version of Weblogic server I'm using, but that didn't resolve the issue.

Initially, I had ojdbc14.jar included in my application and I used the setBlob method as seen below for the prepared statement.



That returned the error I copied at the top. I then changed

ps.setBlob(1, is);

to

ps.setBinaryStream(1,is);

which yielded the same "AbstractMethodError", just for setBinaryStream instead of setBlob.

Finally, I replaced ojdbc14.jar with ojdbc6.jar in my application and tried setBlob again, but got the same error.

I'm just at a loss. There's so many moving parts here, and I'm confused about what versions matter, between the database, the drivers, the jars, and I have no idea how to make them correlate. Any ideas? Thanks all!
Resolved! By complete and total dumb luck...

In the getTemplate function, I changed the segment of code from



to



No idea why it worked, but it does. Hooray for not getting fired!
4 years ago
Just for kicks (ignoring convention, for a moment) I tried just hardcoding the getTemplate() function into the code instead of calling it, and handling the streams, connections, and statements all from there, but still no dice. It's bizarre because this does work when I'm running the code locally, so I'm getting the feeling more and more that it's a Weblogic issue. I'm also not 100% sure it's a timeout, because the error seems to come up immediately upon clicking the "download" button. It's not like it's sitting there thinking for a few seconds and then it crashes.

Man, this is tough.
4 years ago
Claude - about 3 seconds when it's run locally - I can't imagine it would be too much longer in other environments, but possibly a little bit more.

Rob - ahhh, that makes sense! Let me add that in. In that case, when SHOULD I close the connection? Seems like maybe returning an inputstream isn't a good idea then, because you'd have to manage that connection in whichever method is calling "getTemplate()" in this case, right?
4 years ago
I'm actually suspicious that this might be a Weblogic issue, something about how it's handling the JNDI connection while retrieving something out of the database larger than, say, a set of Strings, but that's just a guess at this point.
4 years ago
Indeed -

4 years ago
Hi everyone!

In my code, I am using the Apache POI libraries to generate some Excel and Word documents from templates, which are stored in a database as BLOBs. I load the template as an InputStream, and then use that stream to create the objects the Apache POI library uses. It works in full when I run my code locally. The issue I'm running into is when I deploy my code to a Dev or QA server, I'm getting the exception below. Line 7 in my sample code below the exception is Line 659 in "FileOpsImpl.java", as referenced in the exception. It looks to me like somehow that input stream is being closed before I get to that line in the code. Does that make sense? Is that possible? Is there any way to resolve this? I'm obviously not manually closing it until wayyy later in the code. Is there anything I can do about this?

Thanks a ton!


java.io.IOException: [BEA][Oracle JDBC Driver]Object has been closed.
at weblogic.jdbc.base.BaseInputStreamWrapper.validateClosedState(Unknown Source)
at weblogic.jdbc.base.BaseInputStreamWrapper.read(Unknown Source)
at java.io.FilterInputStream.read(FilterInputStream.java:116)
at java.io.PushbackInputStream.read(PushbackInputStream.java:169)
at java.util.zip.ZipInputStream.readFully(ZipInputStream.java:397)
at java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:230)
at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:74)
at org.apache.poi.openxml4j.util.ZipInputStreamZipEntrySource.(ZipInputStreamZipEntrySource.java:51)
at org.apache.poi.openxml4j.opc.ZipPackage.(ZipPackage.java:83)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:228)
at org.apache.poi.util.PackageHelper.open(PackageHelper.java:39)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.(XSSFWorkbook.java:187)
at com.capitalone.citrix.ssp.services.FileOpsImpl.generateDownload(FileOpsImpl.java:659)
at com.capitalone.citrix.ssp.controller.DownloadController.display(DownloadController.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:781)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:721)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)



My code is as follows:



4 years ago