Difficulty using XMLView in codenameone - codenameone

I am trying to use XMLView to display small html. This is the html
<?xml version="1.0" encoding="windows-1252"?>
<doc><body><p uiid="headline"> Election Result</b></p><p>Ward -- W1001<br>
</p><p>Votes For -- ABP,200<br> -- A,100<br></p><carousel> <img src="http://res.cloudinary.com/okwui/image/upload/v1545561341/pukuxkn2pgmgbcplqgi8.png"/><br>
<img src="http://res.cloudinary.com/okwui/image/upload/v1545561342/zkwfawmolbvta3lfd2ld.png"/><br></carousel><p>
Additional Notes -- <br></p><p>Election -- Presidential2019<br></p><p>Date of Election -- Sun Dec 23 11:35:14 WAT 2018<br></p><p>Booth -- B001<br></p>
<p>Constituency -- C001<br></p><p>State -- Abia<br></p> </body></doc
I keep getting this error
java.lang.NullPointerException
at com.codename1.xml.Element.iterator(Element.java:767)
at com.codename1.components.xmlview.ParagraphView.getText(ParagraphView.java:66)
at com.codename1.components.xmlview.ParagraphView.getText(ParagraphView.java:68)
at com.codename1.components.xmlview.ParagraphView.getText(ParagraphView.java:68)
at com.codename1.components.xmlview.ParagraphView.getText(ParagraphView.java:68)
at com.codename1.components.xmlview.ParagraphView.getText(ParagraphView.java:68)
at com.codename1.components.xmlview.ParagraphView.getText(ParagraphView.java:68)
at com.codename1.components.xmlview.ParagraphView.getText(ParagraphView.java:75)
at com.codename1.components.xmlview.ParagraphView.createView(ParagraphView.java:50)
at com.codename1.components.xmlview.XMLView.createView(XMLView.java:377)
at com.codename1.components.xmlview.XMLView.setXML(XMLView.java:356)
at com.codename1.components.xmlview.XMLView.setXML(XMLView.java:302)
Obviously there is something wrong with the XML file but I am unable to pinpoint. Pls help.

You need to follow the syntax mentioned in the XMLView project e.g. <br> isn't valid XML. I'm not sure if body is necessary or not:
See https://github.com/shannah/cn1-xmlview/blob/master/src/SampleNewsFeed.xml

Related

MuleSoft 4 http request

I am new to MuleSoft
when i am giving output expression like below i am getting an data sense error, can you please help
#[output application/json --- {errorType:error.errorType, error:error.description}]
Description Resource Path Location Type Scripting language error on
expression '#[output application/json --- {errorType:error.errorType,
error:error.descrip...'. Reason: Invalid input '#', expected using,
if, ???, unless or not (line 1, column 1): . validations.xml
/validations/src/main/mule Listener Message Flow Error
It is hard to know without a snippet from the configuration XML exactly what your issue is, but one problem I see is that your dataweave does not start with a
"%dw 2.0" In mule 4 there are two languages. Mule Expression language, which is default in most components (ie #[vars.name] is MEL), and dataweave 2.0 which is default in Transform Message components. You can however, as you've attempted to do, use dataweave inside of Mule Expressions. You have it mostly right, but it must start with "%dw 2.0" at the beginning. So it should look like this.
#[%dw 2.0 output application/json --- {errorType:error.errorType, error:error.description}]
However, judging by the error message, it looks like you're attempting to use MEL in a place where it is not allowed. If you provide a snippet of the configuration XML for this component, I can be more helpful.
There is no MEL in Mule 4. It is migrated to DW2.0. Please refer link https://docs.mulesoft.com/mule-runtime/4.2/migration-mel

SSMS Snippets and Shortcuts

I'm using SSMS 2014. I am able to insert a snippet but they don't seem to respond to shortcuts (ie crproc[tab])
Is this feature known to work?
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>prod1</Title>
<Description>testing</Description>
<Author> dale </Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Shortcut>crproc</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>DatabaseName</ID>
<ToolTip>Name of database.</ToolTip>
<Default>DB</Default>
</Literal>
</Declarations>
<Code Language="SQL">
<![CDATA[
------------------------------------------------------
-- FILENAME: Template-Expansion.snippet
-- PURPOSE: Template for Expansion (Insert) snippets.
-- AUTHOR: Ken O. Bonn
-- DATE: May 15, 2013
------------------------------------------------------
SET NOCOUNT ON;
EXEC SP_HELPDB $DatabaseName$;
]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
No, for some reason Microsoft seem to have no interest in actually implementing this feature, despite code snippets being totally useless without it (because of the number of mouse clicks and key presses you need to insert a snippet).
How many times a day do you type "SELECT * FROM..." or "SELECT TOP 10 * FROM "... etc..??!
Very frustrating!
Even SSMS 2016 Release Candidate still does not support it.
"ApexSQL Complete" (a free tool) apparently will do it, but this does not support SSMS 2016 yet!
Add your snippet to the "Functions" folder where other SurroundsWith snippets are found. Then press press CTRL + K, CTRL + S (shortcut for SurroundsWith Snippets) and type a few letters from your snippet name and press enter. If only the "Functions" folder has SurroundsWith snippets then no other folders will show in the context menu. Otherwise you can type a few letters from the appropriate folder name and press tab. This process is much like this answer.
For my environment the Begin, If and While snippets are located:
C:\Program Files (x86)\Microsoft SQL
Server\130\Tools\Binn\ManagementStudio\SQL\Snippets\1033\Function
Here is an example snippet for SELECT * FROM:
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Select</Title>
<Shortcut>sel</Shortcut>
<Description>SELECT * FROM _ WHERE 1=1 AND</Description>
<Author/>
<SnippetTypes>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Code Language="SQL">
<![CDATA[
SELECT * FROM dbo.$selected$$end$
WHERE 1=1
--AND
]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
In ApexSQL Complete you have possibility to do this and of course that support SSMS 2016 and even new SSMS 17 RC, except that it is totally free
Don't worry about giving it a specific shortcut.
Just add it under the my snippets folder.
Make sure to save as .snippet
Hit ctrl+K, Ctrl+S
down arrow to my snippets enter
down arrow to the snippet you want enter
your snippet will surround the code you wanted it to.

Issue with stock update on amazon with mws

We are using the following details for updating the quantity of a product in amazon. Wile using scratch pad, option Feeds->SubmitFeed
Set the required parameters and pass the following XML
<?xml version="1.0" encoding="utf-8" ?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>$merchantID</MerchantIdentifier>
</Header>
<MessageType>Inventory</MessageType>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
<Inventory>
<SKU>$SKU</SKU>
<Quantity>8</Quantity>
</Inventory>
</Message>
</AmazonEnvelope>
feed type : _POST_INVENTORY_AVAILABILITY_DATA_
we are getting in response for the same - submissionid. I know it takes sometime to update. But i waited and waited .. 4 atleast 15 hrs (not minutes) but it still was in process and the quantity was never updated.
Am getting in the following response
<?xml version="1.0"?>
<SubmitFeedResponse xmlns="http://mws.amazonaws.com/doc/2009-01-01/">
<SubmitFeedResult>
<FeedSubmissionInfo>
<FeedSubmissionId>6791310806</FeedSubmissionId>
<FeedType>_POST_INVENTORY_AVAILABILITY_DATA_</FeedType>
<SubmittedDate>2013-03-21T19:48:37+00:00</SubmittedDate>
<FeedProcessingStatus>_SUBMITTED_</FeedProcessingStatus>
</FeedSubmissionInfo>
</SubmitFeedResult>
<ResponseMetadata>
<RequestId>fd07bf18-4f6a-4786-bdf9-9d4db50956d0</RequestId>
</ResponseMetadata>
</SubmitFeedResponse>
and getting in following response on checking the status of the feed
<?xml version="1.0"?>
<ErrorResponse xmlns="http://mws.amazonaws.com/doc/2009-01-01/">
<Error>
<Type>Sender</Type>
<Code>FeedProcessingResultNotReady</Code>
<Message>Feed Submission Result is not ready for Feed Submission Id: 6791310806</Message>
<Detail/>
</Error>
<RequestID>2c86128d-b53a-4fc3-80d1-6b41b53a8977</RequestID>
</ErrorResponse>
Can any1 guide me.. where did i go wrong .. in here? or if there is any better way to look on for the same.
The time it seems to be taking isn't normal. Submitted feeds usually switch to _IN_PROGRESS_ within a few minutes and then take another few minutes to complete, when the status switches to _DONE_. Short feeds like your example feed should take less than a minute to process.
In the past, I've seen one feed upload blocking another though. It seems that sometimes the MWS won't start processing one feed until a previous feed of the same user has gone trough (or for that matter: failed). Please check if you have other request that might block yours (GetFeedSubmissionList)
Apart from this, the answers you are getting from Amazon MWS are perfectly normal. Your feed was accepted and put into the processing queue. The queue status was set to _SUBMITTED_, and as long as it hasn't switched to DONE, you will get the FeedProcessingResultNotReady answer you were seeing.

Jetty - Form too large Error

I have been working on Solr and running some load tests on it. After some point, I keep getting
Nov 29, 2012 3:34:43 PM org.apache.solr.common.SolrException log
SEVERE: null:java.lang.IllegalStateException: Form too large275768>200000
at org.eclipse.jetty.server.Request.extractParameters(Request.java:279)
at org.eclipse.jetty.server.Request.getParameterMap(Request.java:705)
at org.apache.solr.request.ServletSolrParams.<init>(ServletSolrParams.java:29)
at org.apache.solr.servlet.StandardRequestParser.parseParamsAndFillStreams(SolrRequestParsers.java:394)
at org.apache.solr.servlet.SolrRequestParsers.parse(SolrRequestParsers.java:115)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:260)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1337)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:484)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.eclipse.jetty.server.Server.handle(Server.java:351)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:47)
at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:900)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:954)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:857)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:66)
at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:254)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
at java.lang.Thread.run(Unknown Source)
Basically I made searches on google and stackoverflow too, and all I could find was this and applying the solutions there didnt helped at all..
I have tried to modify that value from org.apache.solr.client.solrj.embedded.JettySolrRunnertoo but even changing value from that file didnt helped at all.
anyone knows how to change max allowed form size for an embedded Jetty?
After checking the source code of Solr, I found one place where I can set the form size. The class I have modified is org.apache.solr.client.solrj.embedded.JettySolrRunner.java , basically adding some large number for the form size...
although it works, I am still confused why I cant set this value via config files

Tomcat 6.0.32 error coming while running my application

I have created a war file of my application using maven.the build was successful.Now i have deployed the same build on my tomcat server.But when i try to access my application i receive the following error message..
org.apache.jasper.JasperException: Mandatory TLD element tlib-version missing or empty in TLD /WEB-INF/struts-html.tld
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:164)
org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:281)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:164)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:386)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:450)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1397)
org.apache.jasper.compiler.Parser.parse(Parser.java:130)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:185)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:347)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:326)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
any one having any clue please update
Thanks in advance..
It's telling you that it can't find a valid tlib-version element.
Open /WEB-INF/struts-html.tld ... It probably has a valid <taglib> root element, but does it have a tlib-version subelement, such as:
<taglib>
<tlib-version>1.0</tlib-version>
....
....
</taglib>
You can read more about tag library descriptors here:
http://docs.oracle.com/javaee/1.4/tutorial/doc/JSPTags6.html
You need to make sure your taglib is like below
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/jsee/web-jsptagLibrary_2_0.xsd" version="2.0">

Resources