While opening the window getting this error in version 9.0.1.2. And it's working fine in 8.5.0 version. After upgrading the version from 8.5.0 to 9.0.1.2 this error occurred.
window = (Window) Executions.createComponents(url, parent, params);
window.doModal();
java.lang.NumberFormatException: For input string: "auto"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.parseInt(Integer.java:615)
at org.zkoss.zul.Grid.isVflex(Grid.java:420)
at org.zkoss.zkmax.zul.impl.LiveGridDataLoader.isCropper(LiveGridDataLoader.java:392)
at org.zkoss.zul.Grid.renderProperties(Grid.java:1791)
at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2175)
at org.zkoss.zk.ui.AbstractComponent.redrawChildren(AbstractComponent.java:2266)
at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2207)
at org.zkoss.zk.ui.AbstractComponent.redrawChildren(AbstractComponent.java:2266)
at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2207)
at org.zkoss.zk.ui.AbstractComponent.redrawChildren(AbstractComponent.java:2266)
at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2207)
at org.zkoss.zk.ui.AbstractComponent.redrawChildren(AbstractComponent.java:2266)
at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2207)
at org.zkoss.zk.ui.impl.UiVisualizer.redraw(UiVisualizer.java:1016)
at org.zkoss.zk.ui.impl.UiVisualizer.redrawComponents(UiVisualizer.java:1030)
at org.zkoss.zk.ui.impl.UiVisualizer.addResponsesForCreatedPerSiblings(UiVisualizer.java:882)
at org.zkoss.zk.ui.impl.UiVisualizer.getResponses(UiVisualizer.java:746)
at org.zkoss.zk.ui.impl.UiEngineImpl.getResponses(UiEngineImpl.java:1575)
at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1345)
at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:611)
at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:487)
at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:495)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
you forgot to ask a question that can be answered / solved.
The error can be explained by the source code of the isVflex method on grid itself (however that information might not help your actual problem, whatever that might be)
v8.5.0: https://github.com/zkoss/zk/blob/v8.5.0/zul/src/org/zkoss/zul/Grid.java#L399-L408
v9.0.1.2:
https://github.com/zkoss/zk/blob/v9.0.1.2/zul/src/org/zkoss/zul/Grid.java#L412-L421
The value 'auto' is not handled by this method, leading to this error.
If you provide a correct value (null, '', 'true', 'min' or a number) the error will go away.
The same exception should have happened in both versions 8.5.0 and 9.0.1.2 given the value 'auto'.
Unfortunately you didn't provide a working/failing example to investigate so I can't comment on that.
Related
I have made a simple Repository containing all the persons in my system, everything seems to work fine. I can add, remove and even retrieve single persons based on a given key and value but for some reason i can't retrieve all persons stored in the Repository directly. I tried do it by using the findAll() method, which should return an iterable. I then try to iterate with the iterable and store each person in an arraylist which i want the function to return.
public List<Person> getAllPersons() {
Iterable<Person> p = personRepository.findAll();
System.out.println("person count: " + personRepository.count());
List<Person> persons = new ArrayList<Person>();
for (Person person : p) {
System.out.println("person");
persons.add(person);
}
return persons;
}
The printline prints "3" so the repository is not empty but still i get a nullpointerexception in the error below.
apr 16, 2014 3:45:54 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [bmsapp] in context with path [/bmsapp] threw exception [Request processing failed; nested exception is org.neo4j.graphdb.TransactionFailureException: Failed to mark transaction as rollback only.] with root cause
java.lang.NullPointerException
at org.neo4j.kernel.TopLevelTransaction.markAsRollbackOnly(TopLevelTransaction.java:93)
at org.neo4j.kernel.TopLevelTransaction.failure(TopLevelTransaction.java:86)
at org.neo4j.cypher.internal.spi.v2_0.TransactionBoundExecutionContext.close(TransactionBoundExecutionContext.scala:58)
at org.neo4j.cypher.internal.compiler.v2_0.spi.DelegatingQueryContext.close(DelegatingQueryContext.scala:32)
at org.neo4j.cypher.internal.compiler.v2_0.spi.ExceptionTranslatingQueryContext.org$neo4j$cypher$internal$compiler$v2_0$spi$ExceptionTranslatingQueryContext$$super$close(ExceptionTranslatingQueryContext.scala:34)
at org.neo4j.cypher.internal.compiler.v2_0.spi.ExceptionTranslatingQueryContext$$anonfun$close$1.apply$mcV$sp(ExceptionTranslatingQueryContext.scala:34)
at org.neo4j.cypher.internal.compiler.v2_0.spi.ExceptionTranslatingQueryContext$$anonfun$close$1.apply(ExceptionTranslatingQueryContext.scala:34)
at org.neo4j.cypher.internal.compiler.v2_0.spi.ExceptionTranslatingQueryContext$$anonfun$close$1.apply(ExceptionTranslatingQueryContext.scala:34)
at org.neo4j.cypher.internal.compiler.v2_0.spi.ExceptionTranslatingQueryContext.org$neo4j$cypher$internal$compiler$v2_0$spi$ExceptionTranslatingQueryContext$$translateException(ExceptionTranslatingQueryContext.scala:149)
at org.neo4j.cypher.internal.compiler.v2_0.spi.ExceptionTranslatingQueryContext.close(ExceptionTranslatingQueryContext.scala:34)
at org.neo4j.cypher.internal.compiler.v2_0.ClosingIterator.failIfThrows(ClosingIterator.scala:94)
at org.neo4j.cypher.internal.compiler.v2_0.ClosingIterator.next(ClosingIterator.scala:45)
at org.neo4j.cypher.internal.compiler.v2_0.PipeExecutionResult.next(PipeExecutionResult.scala:168)
at org.neo4j.cypher.internal.compiler.v2_0.PipeExecutionResult.next(PipeExecutionResult.scala:34)
at scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
at scala.collection.convert.Wrappers$IteratorWrapper.next(Wrappers.scala:30)
at org.neo4j.cypher.internal.compiler.v2_0.PipeExecutionResult$$anon$1.next(PipeExecutionResult.scala:76)
at org.neo4j.helpers.collection.IteratorWrapper.next(IteratorWrapper.java:47)
at org.neo4j.helpers.collection.IteratorWrapper.next(IteratorWrapper.java:47)
at bmsapp.repository.NeoPersonDao.getAllPersons(NeoPersonDao.java:33)
at bmsapp.service.SimplePersonManager.getPersons(SimplePersonManager.java:32)
at bmsapp.web.HelloController.HelloHandler(HelloController.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
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:938)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:744)
I already wasted hours in order to fix this but without any luck. Can anybody please help me out here?
Try mark your personRepository.findAll() as #Transactional.
If it still doesn't work, can you post your personRepository.findAll() method plz?
Thanks for the answers! I have managed to solve the problem by adding
"<tx:annotation-driven mode="proxy"/>
to my application context xml file. It's working perfectly now! However i'm still not sure what this statemant does and why i only need it for the findAll() method and not any of the other's i've used. (count(), findOne(), findBySchemaPropertyValue() etc)
I tried the mode="proxy" and it didn't work for me, this should only have an impact if you are using non-injected transactional methods to call each other (explanation here).
This 'TransactionFailureException' is probably related to the issue: https://jira.spring.io/browse/DATAGRAPH-531. If that's the case, you need to change
service.findAll()
to:
service.findAll().as(Collection.class)
... and the it should go away.
I'm receiving this error while accessing in the index page of my JSP project.
Sep 3, 2013 12:03:14 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [jsp] in context with path [/MyProject] threw exception [java.lang.NullPointerException] with root
cause
java.lang.NullPointerException
at org.apache.jsp.index_jsp._jspService(index_jsp.java:126)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
I guess this is a "standard error" from TomCat but I can't find out what is the real problem.
It's a java.lang.NullPointerException in your JSP page, but I take it you'd figured that out already.
JSP pages are converted/compiled to Java - thus the (index_jsp.java:126) in the stacktrace - but unfortunately you can't use the line number for figuring out the problem as it doesn't relate to your JSP file, but the resulting Java source.
You should, however, be able to figure out where the NPE happens by inspection, since your JSP is of course a thin presentation layer, right :-) A usual mistake could be referencing attributes that aren't provided on entry to the page, eg. request.getParameter( "something" ).equals( "somethingelse" ) <-- possible NPE on .equals()
If you were to share the JSP page (perhaps in the form of an SSCCE), this community can help much better.
Cheers,
It's not a "Tomcat standard" error. Its an error in your source code. JSP is translated to java and java.lang.NullPointerException signifies that somewhere you are trying to use some variable without properly initializing it. Or you may have expected it to be initialized but it hasn't due to some resource being unavailable.
You CAN use the line number to find the error. (The answer by Anders R. Bystrup incorrectly says the opposite "...unfortunately you can't use the line number for figuring out the problem".)
It's true the JSP pages are converted to Java and thus the line number does not correspond to the line number in your JSP, but you can find the converted Java file in your work directory, somewhere like:
${TOMCAT_HOME}/work/Catalina/localhost/_/org/apache/jsp/index_jsp.java
and looking at the given line number (126) in that file should point you toward the problem in your JSP (there will likely be an identical line in your JSP).
As others have already pointed out, in this case you have an NPE.
I have created a new web service project which works fine, when trying to access using correct url i am able to view the wsdl on the browser.
But when a wrong url is typed stack trace is being shown on the browser as below :
org.apache.axis2.AxisFault: The endpoint reference (EPR) for the Operation not found is //services/TestService?wsdlkdfl and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator.
at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:102)
at org.apache.axis2.engine.Phase.invoke(Phase.java:329)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:262)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:168)
at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:144)
at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:139)
at org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:837)
at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:273)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947)
how to handle this scenario to show a blank page rather than showing stack trace?
I was able to solve this issue by changes in axis2.xml file as below :
"sendStacktraceDetailsWithFaults" parameter to > false
"DrillDownToRootCauseForFaultReason" parameter to > false
Previously these two parameters were true, due to which whole of the stack trace was getting displayed.
Hope this helps for some one with same issue. I couldn't find much in the internet.
I'm trying to create a table from servlet. But wen i run, it was showing the error java.sql.SQLException: ORA-00902: invalid datatype. But when i execute the same query in sql plus it was executing .
stack trace :
java.sql.SQLException: ORA-00902: invalid datatype
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:194)
at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1000)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1307)
at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1814)
at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1779)
at oracle.jdbc.driver.OracleStatementWrapper.executeUpdate(OracleStatementWrapper.java:277)
at skypark.CreateUserAc.doGet(CreateUserAc.java:126)
at skypark.CreateUserAc.doPost(CreateUserAc.java:345)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
at skypark.Registration.doPost(Registration.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:931)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
And my code is :
Statement stC=con.createStatement();
StringBuilder sbC=new StringBuilder(1024);
sbC.append("create table ").append(uname).append("COMMENTS(UNAME VARCHAR2(50),COMMENTS VARCHAR2(1100),ITEMID NUMBER)");
String QueryC=sbC.toString();
stC.executeUpdate(QueryC); //stack trace showing error
Statement stCH=con.createStatement();
StringBuilder sbCH=new StringBuilder(1024);
sbCH.append("create table ").append(uname).append("CHAT(ID NUMBER NOT NULL,FROM VARCHAR2(50),TO VARCHAR2(50),MESSAGE VARCHAR2(500) DEFAULT NULL NOT NULL,SENT DATE NOT NULL, RECD NUMBER)");
String QueryCH=sbCH.toString();
stCH.executeUpdate(QueryCH); //stack trace showing error
Please anyone tell me what mistake i made.........thanks.......
I guess you are missing a closing ')' in both statements, try to delete the opening '(' before the table name.
EDIT:
In the second statement you are using arods like ID, FROM, TO, etc, these are often keywords which can cause conflicts. The column MESSAGE ist defined as default null then not null:
create table (CHAT(ID NUMBER NOT NULL,
FROM VARCHAR2(50),
TO VARCHAR2(50),
MESSAGE VARCHAR2(500) DEFAULT NULL NOT NULL,
SENT DATE NOT NULL, RECD NUMBER)
Looks like you're a victim of a cut'n'paste error somewhere;
sbC.append("create table ").append(uname)
.append("(COMMENTS(UNAME VARCHAR2(50),COMMENTS VARCHAR2(1100),ITEMID NUMBER)");
...will lead to an SQL statement similar to;
create table uname_table (
COMMENTS(UNAME VARCHAR(50), <-- strange indeed, cut'n'paste?
COMMENTS VARCHAR2(1100),
ITEMID NUMBER
)
Something more reasonable would be;
sbC.append("create table ").append(uname)
.append("(UNAME VARCHAR2(50),COMMENTS VARCHAR2(1100),ITEMID NUMBER)");
...which would give;
create table uname_table (
UNAME VARCHAR(50),
COMMENTS VARCHAR2(1100),
ITEMID NUMBER
)
I'm trying to make some search using youtube gdata api for java but i'm having some errors.
I set max. result to 20 and started to make test searches and occasionally there is no result back.
Then i started to make one by one searches and i noticed that some single search results have problems and when i set max. results to 20, there is no result back even one result has a problem.
Stack trace is:
Haz 29, 2012 2:45:40 PM com.wattalist.gdata.youtube.GdataYoutube Search
SEVERE: null
com.google.gdata.util.ParseException: [Line 1, Column 101152, element yt:state] Invalid value for attribute : 'name'
at com.google.gdata.util.XmlParser.throwParseException(XmlParser.java:739)
at com.google.gdata.util.XmlParser.parse(XmlParser.java:702)
at com.google.gdata.util.XmlParser.parse(XmlParser.java:585)
at com.google.gdata.data.BaseFeed.parseAtom(BaseFeed.java:867)
at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:68)
at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:39)
at com.google.gdata.wireformats.input.CharacterParser.parse(CharacterParser.java:100)
at com.google.gdata.wireformats.input.XmlInputParser.parse(XmlInputParser.java:52)
at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:66)
at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:34)
at com.google.gdata.client.Service.parseResponseData(Service.java:2165)
at com.google.gdata.client.Service.parseResponseData(Service.java:2098)
at com.google.gdata.client.Service.getFeed(Service.java:1136)
at com.google.gdata.client.Service.getFeed(Service.java:1077)
at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:676)
at com.google.gdata.client.Service.query(Service.java:1237)
at com.google.gdata.client.Service.query(Service.java:1178)
at com.wattalist.gdata.youtube.GdataYoutube.Search(GdataYoutube.java:47)
at com.wattalist.servlets.PlayerAjaxServlet.writeSearchResults(PlayerAjaxServlet.java:137)
at com.wattalist.servlets.PlayerAjaxServlet.doPost(PlayerAjaxServlet.java:108)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: com.google.gdata.util.ParseException: Invalid value for attribute : 'name'
at com.google.gdata.data.AttributeHelper.consumeEnum(AttributeHelper.java:592)
at com.google.gdata.data.youtube.YtPublicationState.consumeAttributes(YtPublicationState.java:184)
at com.google.gdata.data.AbstractExtension$AttributesHandler.processEndElement(AbstractExtension.java:263)
at com.google.gdata.util.XmlParser.endElement(XmlParser.java:1013)
at org.xml.sax.helpers.ParserAdapter.endElement(ParserAdapter.java:650)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:598)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1741)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2898)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
at org.xml.sax.helpers.ParserAdapter.parse(ParserAdapter.java:429)
at com.google.gdata.util.XmlParser.parse(XmlParser.java:694)
... 39 more
i made some research about it i noticed that in older versions of gdata youtbe api there was this problem but can be solved with a workaround like this:
A temporary fix would be to copy the source for
com.google.gdata.data.youtube.YtPublicationState and add restricted type like below.
Then adding it higher in the classpath.
public static enum State {
/**
* The video has not been completely defined yet, but it's been stored
* already.
* Either the video data or the description is missing.
*/
INCOMPLETE,
/** The video has just been uploaded and is not yet publicly available. */
PROCESSING,
/** The video has been rejected. */
REJECTED,
/** The video was not successfully processed. */
FAILED,
/** Video was removed by the owner. */
DELETED,
RESTRICTED,
;
}
But i'm using the latest version gdata-src.java-1.47.1 version.
i have the jars:
gdata-core-1.0.jar
gdata-youtube-2.0.jar
gdata-youtube-meta-2.0.jar
gdata-client-1.0.jar
gdata-client-meta-1.0.jar
gdata-media-1.0.jar
guava-11.0.2.jar
jsr305.jar
mail.jar
i checked the YtPublicationState in the source code and the enum State has RESTRICTED element.
but i still get the exception.
The source code i'm getting the exception is:
public VideoFeed Search(String criteria, int maxResults, int startIndex)
{
try
{
YouTubeQuery youtubeQuery = new YouTubeQuery(new URL("http://gdata.youtube.com/feeds/api/videos"));
youtubeQuery.setFullTextQuery(criteria);
youtubeQuery.setMaxResults(_maxResults);
youtubeQuery.setStartIndex(_startIndex);
VideoFeed videoFeed = _youtubeService.query(youtubeQuery, VideoFeed.class);
return videoFeed;
} catch (IOException ex)
{
Logger.getLogger(GdataYoutube.class.getName()).log(Level.SEVERE, null, ex);
} catch (ServiceException ex)
{
Logger.getLogger(GdataYoutube.class.getName()).log(Level.SEVERE, null, ex);
}
return null;
}
anyone knows how to fix it or any alternative?
(i thougt of getting the results one by one and eliminate the broken result on my own on the server but it will have so much communication overheads.)