EDITED :
I edited my swagger path. But i am getting below error now.
[main] INFO io.swagger.parser.Swagger20Parser - reading from https://SWAGGERFILE/api
[main] INFO io.swagger.parser.Swagger20Parser - reading from https://SWAGGERFILE/api
Exception in thread "main" java.lang.RuntimeException: missing swagger input or config!
at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:764)
at io.swagger.codegen.cmd.Generate.run(Generate.java:299)
at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Below is the command i am using in mac to generate dart package
java -jar /Users/PATH/modules/swagger-codegen-cli/src/main/target/swagger-codegen-cli.jar generate -i https://SWAGGERFILE/api-docs/#/ -l dart -o /Users/PATH/STORE/DART/PACKAGE
It works fine for
java -jar /Users/PATH/modules/swagger-codegen-cli/src/main/target/swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l dart -o /Users/PATH/STORE/DART/PACKAGE
Below is the error i am getting :
[main] INFO io.swagger.parser.Swagger20Parser - reading from https://SWAGGERFILE/api-docs/#/
[main] WARN io.swagger.parser.util.DeserializationUtils - Error snake-parsing yaml content
io.swagger.parser.util.DeserializationUtils$SnakeException: Exception safe-checking yaml content (maxDepth 2000)
at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:300)
at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:525)
at org.yaml.snakeyaml.Yaml.load(Yaml.java:438)
at io.swagger.parser.util.DeserializationUtils.readYamlTree(DeserializationUtils.java:137)
at io.swagger.parser.Swagger20Parser.deserializeYaml(Swagger20Parser.java:83)
at io.swagger.parser.Swagger20Parser.convertToSwagger(Swagger20Parser.java:125)
at io.swagger.parser.Swagger20Parser.read(Swagger20Parser.java:109)
at io.swagger.parser.SwaggerParser.read(SwaggerParser.java:69)
at io.swagger.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:437)
at io.swagger.codegen.cmd.Generate.run(Generate.java:297)
at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Caused by: mapping values are not allowed here
in 'string', line 14, column 17:
box-sizing: border-box;
^
at org.yaml.snakeyaml.scanner.ScannerImpl.fetchValue(ScannerImpl.java:869)
at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:358)
at org.yaml.snakeyaml.scanner.ScannerImpl.peekToken(ScannerImpl.java:250)
at org.yaml.snakeyaml.parser.ParserImpl$ParseDocumentEnd.produce(ParserImpl.java:253)
at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:168)
at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:87)
at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:108)
at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:279)
... 10 more
[main] INFO io.swagger.parser.Swagger20Parser - reading from https://production.user-api.api.findnemo.in/api-docs/#/
[main] WARN io.swagger.parser.util.DeserializationUtils - Error snake-parsing yaml content
io.swagger.parser.util.DeserializationUtils$SnakeException: Exception safe-checking yaml content (maxDepth 2000)
at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:300)
at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:525)
at org.yaml.snakeyaml.Yaml.load(Yaml.java:438)
at io.swagger.parser.util.DeserializationUtils.readYamlTree(DeserializationUtils.java:137)
at io.swagger.parser.Swagger20Parser.deserializeYaml(Swagger20Parser.java:83)
at io.swagger.parser.Swagger20Parser.convertToSwagger(Swagger20Parser.java:125)
at io.swagger.parser.Swagger20Parser.read(Swagger20Parser.java:109)
at io.swagger.parser.SwaggerParser.read(SwaggerParser.java:83)
at io.swagger.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:437)
at io.swagger.codegen.cmd.Generate.run(Generate.java:297)
at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Caused by: mapping values are not allowed here
in 'string', line 14, column 17:
box-sizing: border-box;
^
at org.yaml.snakeyaml.scanner.ScannerImpl.fetchValue(ScannerImpl.java:869)
at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:358)
at org.yaml.snakeyaml.scanner.ScannerImpl.peekToken(ScannerImpl.java:250)
at org.yaml.snakeyaml.parser.ParserImpl$ParseDocumentEnd.produce(ParserImpl.java:253)
at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:168)
at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:87)
at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:108)
at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:279)
... 10 more
[main] ERROR io.swagger.parser.SwaggerCompatConverter - failed to read resource listing
com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (String)"
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" >
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" /><link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
<style>
html
{
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}"[truncated 2632 chars]; line: 2, column: 2]
at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1840)
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:712)
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:637)
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1917)
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:773)
at com.fasterxml.jackson.databind.ObjectMapper._readTreeAndClose(ObjectMapper.java:4231)
at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:2711)
at io.swagger.parser.SwaggerCompatConverter.readResourceListing(SwaggerCompatConverter.java:194)
at io.swagger.parser.SwaggerCompatConverter.read(SwaggerCompatConverter.java:123)
at io.swagger.parser.SwaggerParser.read(SwaggerParser.java:83)
at io.swagger.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:437)
at io.swagger.codegen.cmd.Generate.run(Generate.java:297)
at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Exception in thread "main" java.lang.RuntimeException: missing swagger input or config!
at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:764)
at io.swagger.codegen.cmd.Generate.run(Generate.java:299)
at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
shwetadodiya#shwetas-MBP swagger-codegen-master % java -jar /Users/shwetadodiya/Documents/FlutterProjects/Swagger/swagger-codegen-master/modules/swagger-codegen-cli/src/main/target/swagger-codegen-cli.jar generate -i https://production.user-api.api.findnemo.in/api-docs/#/ -l dart -o /Users/shwetadodiya/Documents/FlutterProjects/Swagger/SwaggerCode
[main] INFO io.swagger.parser.Swagger20Parser - reading from https://production.user-api.api.findnemo.in/api-docs/#/
[main] WARN io.swagger.parser.util.DeserializationUtils - Error snake-parsing yaml content
io.swagger.parser.util.DeserializationUtils$SnakeException: Exception safe-checking yaml content (maxDepth 2000)
at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:300)
at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:525)
at org.yaml.snakeyaml.Yaml.load(Yaml.java:438)
at io.swagger.parser.util.DeserializationUtils.readYamlTree(DeserializationUtils.java:137)
at io.swagger.parser.Swagger20Parser.deserializeYaml(Swagger20Parser.java:83)
at io.swagger.parser.Swagger20Parser.convertToSwagger(Swagger20Parser.java:125)
at io.swagger.parser.Swagger20Parser.read(Swagger20Parser.java:109)
at io.swagger.parser.SwaggerParser.read(SwaggerParser.java:69)
at io.swagger.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:437)
at io.swagger.codegen.cmd.Generate.run(Generate.java:297)
at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Caused by: mapping values are not allowed here
in 'string', line 14, column 17:
box-sizing: border-box;
^
at org.yaml.snakeyaml.scanner.ScannerImpl.fetchValue(ScannerImpl.java:869)
at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:358)
at org.yaml.snakeyaml.scanner.ScannerImpl.peekToken(ScannerImpl.java:250)
at org.yaml.snakeyaml.parser.ParserImpl$ParseDocumentEnd.produce(ParserImpl.java:253)
at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:168)
at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:87)
at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:108)
at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:279)
... 10 more
[main] INFO io.swagger.parser.Swagger20Parser - reading from https://production.user-api.api.findnemo.in/api-docs/#/
[main] WARN io.swagger.parser.util.DeserializationUtils - Error snake-parsing yaml content
io.swagger.parser.util.DeserializationUtils$SnakeException: Exception safe-checking yaml content (maxDepth 2000)
at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:300)
at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:525)
at org.yaml.snakeyaml.Yaml.load(Yaml.java:438)
at io.swagger.parser.util.DeserializationUtils.readYamlTree(DeserializationUtils.java:137)
at io.swagger.parser.Swagger20Parser.deserializeYaml(Swagger20Parser.java:83)
at io.swagger.parser.Swagger20Parser.convertToSwagger(Swagger20Parser.java:125)
at io.swagger.parser.Swagger20Parser.read(Swagger20Parser.java:109)
at io.swagger.parser.SwaggerParser.read(SwaggerParser.java:83)
at io.swagger.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:437)
at io.swagger.codegen.cmd.Generate.run(Generate.java:297)
at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Caused by: mapping values are not allowed here
in 'string', line 14, column 17:
box-sizing: border-box;
^
at org.yaml.snakeyaml.scanner.ScannerImpl.fetchValue(ScannerImpl.java:869)
at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:358)
at org.yaml.snakeyaml.scanner.ScannerImpl.peekToken(ScannerImpl.java:250)
at org.yaml.snakeyaml.parser.ParserImpl$ParseDocumentEnd.produce(ParserImpl.java:253)
at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:168)
at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:87)
at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:108)
at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:279)
... 10 more
[main] ERROR io.swagger.parser.SwaggerCompatConverter - failed to read resource listing
com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (String)"
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" >
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" /><link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
<style>
html
{
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}"[truncated 2632 chars]; line: 2, column: 2]
at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1840)
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:712)
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:637)
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1917)
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:773)
at com.fasterxml.jackson.databind.ObjectMapper._readTreeAndClose(ObjectMapper.java:4231)
at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:2711)
at io.swagger.parser.SwaggerCompatConverter.readResourceListing(SwaggerCompatConverter.java:194)
at io.swagger.parser.SwaggerCompatConverter.read(SwaggerCompatConverter.java:123)
at io.swagger.parser.SwaggerParser.read(SwaggerParser.java:83)
at io.swagger.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:437)
at io.swagger.codegen.cmd.Generate.run(Generate.java:297)
at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Exception in thread "main" java.lang.RuntimeException: missing swagger input or config!
at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:764)
at io.swagger.codegen.cmd.Generate.run(Generate.java:299)
at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
The -i parameter expects the path to the OpenAPI YAML/JSON file. It looks like https://SWAGGERFILE/api-docs/#/ points to an HTML page (e.g. Swagger UI) and not the actual OpenAPI YAML/JSON file.
If you use Swagger UI, here's how you can get the YAML/JSON file link:
How to export a Swagger JSON/YAML file from Swagger UI?
Related
This is my project demo, I want to use MyBatis xml configuration. But I got a SAXParseException error, like this
Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:260)
at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:126)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.<init>(XMLMapperBuilder.java:80)
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:519)
... 56 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1472)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:994)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:258)
... 59 more
this is my mapper xml file:
<?xml version="1.0" encoding="UTF-8" ?>
<mapper namespace="com.ryanqy.mapper.UserMapper" xmlns="http://mybatis.org/schema/mybatis-mapper">
<resultMap id="userResultMap" type="com.ryanqy.entity.UserEntity">
<result column="username" property="username"/>
<result column="password" property="password"/>
</resultMap>
<select id="findUserByUserName" resultMap="userResultMap">
select * from uuc_user where username = #{userName}
</select>
</mapper>
Problem is with your mybatis config:
mybatis:
configuration:
map-underscore-to-camel-case: true
type-aliases-package: com.ryanqy.entity
mapper-locations: mapper
change mapper-locations to:
mapper-locations: mapper/UserMapper.xml
#OR
mapper-locations: mapper/*.xml
If you change, you receive error with missing DOCTYPE in your mapper XML, so add something like this
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
I'm trying to deploy a sample JSF 2.3 Application in development, using Eclipse 2018-09 and Payara 5 but it returns me this error:
2018-10-14T15:19:42.783-0300|Severe: Exception during lifecycle processing java.io.IOException: org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 15; Deployment descriptor file META-INF/persistence.xml in archive [classes]. cvc-complex-type.2.4.b: The content of element 'persistence' is not complete. One of '{"http://xmlns.jcp.org/xml/ns/persistence":persistence-unit}' is expected.
Here is my persistence.xmlfile:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"
version="2.2">
<!-- JPA configuration here. -->
</persistence>
And here is an excerpt of my Console output:
2018-10-14T15:19:38.525-0300|Info: Virtual server server loaded default web module 2018-10-14T15:19:42.779-0300|Severe:enterprise.deployment.backend.invalidDescriptorFailure
2018-10-14T15:19:42.781-0300|Severe: enterprise.deployment.backend.saxParserError
2018-10-14T15:19:42.782-0300|Severe: Exception while deploying the app [project]
2018-10-14T15:19:42.783-0300|Severe: Exception during lifecycle processing
java.io.IOException: org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 15; Deployment descriptor file META-INF/persistence.xml in archive [classes]. cvc-complex-type.2.4.b: The content of element 'persistence' is not complete. One of '{"http://xmlns.jcp.org/xml/ns/persistence":persistence-unit}' is expected.
at org.glassfish.javaee.core.deployment.DolProvider.processDOL(DolProvider.java:207)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:223)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:91)
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:933)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:873)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepare(ApplicationLifecycle.java:383)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:540)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:549)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:545)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:544)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:575)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:567)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:566)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1475)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:111)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1857)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1733)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:564)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:251)
at org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:166)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:516)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:213)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:182)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:156)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:218)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:95)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:260)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:177)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:109)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:88)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:53)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:524)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:89)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:94)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:33)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:114)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:569)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:549)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 15; Deployment descriptor file META-INF/persistence.xml in archive [classes]. cvc-complex-type.2.4.b: The content of element 'persistence' is not complete. One of '{"http://xmlns.jcp.org/xml/ns/persistence":persistence-unit}' is expected.
at com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:331)
at com.sun.enterprise.deployment.archivist.ExtensionsArchivist.open(ExtensionsArchivist.java:179)
at com.sun.enterprise.deployment.archivist.PersistenceArchivist.readPersistenceDeploymentDescriptor(PersistenceArchivist.java:158)
at com.sun.enterprise.deployment.archivist.WarPersistenceArchivist.open(WarPersistenceArchivist.java:99)
at com.sun.enterprise.deployment.archivist.Archivist.readRestDeploymentDescriptors(Archivist.java:403)
at com.sun.enterprise.deployment.archivist.Archivist.readDeploymentDescriptors(Archivist.java:394)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:269)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:278)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:239)
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openArchive(ApplicationFactory.java:161)
at org.glassfish.javaee.core.deployment.DolProvider.processDOL(DolProvider.java:199)
... 42 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 15; cvc-complex-type.2.4.b: The content of element 'persistence' is not complete. One of '{"http://xmlns.jcp.org/xml/ns/persistence":persistence-unit}' is expected.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:453)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3231)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidComplexType(XMLSchemaValidator.java:3207)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidType(XMLSchemaValidator.java:3154)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processElementContent(XMLSchemaValidator.java:3056)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleEndElement(XMLSchemaValidator.java:2135)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:854)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2967)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
at com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:321)
... 52 more
How can I fix this?
Thanks.
You need to provide persistence-unit information to persistence.xml file
Here is an example: https://www.thoughts-on-java.org/jpa-persistence-xml/
Hope it help!
Using GSS in a UiBinder template (GWT 2.8.1), the following is parsed and works:
#media ( max-width: 767px) {
...
}
However, when a space appears between max-width and : (which in my case is inserted by the IDE's formatter), GSS parsing fails:
#media ( max-width : 767px) {
...
}
The resulting GWT compilation error looks like this:
binding: formfactor=desktop
binding: user.agent=safari
Compiling module com.example.ExampleDev
Computing all possible rebind results for 'com.example.client.views.desktop.DesktopShellView.DesktopShellViewUiBinder'
Rebinding com.example.client.views.desktop.DesktopShellView.DesktopShellViewUiBinder
Invoking generator com.google.gwt.uibinder.rebind.UiBinderGenerator
[ERROR] Unable to parse CSS
com.google.gwt.thirdparty.common.css.compiler.ast.GssParserException: Parse error in uiBinder_com.example.client.views.desktop_DesktopShellView_DesktopShellViewUiBinderImpl_GenCss_style7318912838006262484.gss at line 18 column 22:
#media ( max-width : 767px) {
^
at com.google.gwt.thirdparty.common.css.compiler.ast.GssParserCC.parse(GssParserCC.java:227)
at com.google.gwt.thirdparty.common.css.compiler.ast.GssParserCC.parse(GssParserCC.java:247)
I have tried the following jsp file in both IDEs. It is working good in NetBeans, but it is not working in Eclipse. The program is to get the time from a NTP server.
Code is as follows
<%--
Document : GetNTP
Created on : May 21, 2013, 2:21:29 PM
Author : Maximin
--%>
<%#page import="java.net.InetAddress"%>
<%#page import="java.text.SimpleDateFormat"%>
<%#page import ="java.util.Date"%>
<%#page import="org.apache.commons.net.ntp.NTPUDPClient"%>
<%#page import="org.apache.commons.net.ntp.TimeInfo"%>
<%#page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1><%
String TIME_SERVER = "time.nist.gov";
NTPUDPClient timeClient = new NTPUDPClient();
InetAddress inetAddress = InetAddress.getByName(TIME_SERVER);
TimeInfo timeInfo = timeClient.getTime(inetAddress);
long returnTime = timeInfo.getReturnTime();
Date time = new Date(returnTime);
SimpleDateFormat sdf= new SimpleDateFormat("dd-MM-yyyy");
out.println(sdf.format(time));
%></h1>
</body>
</html>
When i run this in eclipse I get as
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 17 in the generated java file
Only a type can be imported. org.apache.commons.net.ntp.NTPUDPClient resolves to a package
An error occurred at line: 18 in the generated java file
Only a type can be imported. org.apache.commons.net.ntp.TimeInfo resolves to a package
An error occurred at line: 18 in the jsp file: /GetTime.jsp
NTPUDPClient cannot be resolved to a type
15: <body>
16: <h1><%
17: String TIME_SERVER = "time.nist.gov";
18: NTPUDPClient timeClient = new NTPUDPClient();
19: InetAddress inetAddress = InetAddress.getByName(TIME_SERVER);
20: TimeInfo timeInfo = timeClient.getTime(inetAddress);
21: long returnTime = timeInfo.getReturnTime();
Why is it so?
What should I do to make it run on Eclipse?
Worked for me:
"Right click on your project and choose Properties (it's at the bottom...probably). Deployment Assembly is one of the pages. If the jar with the NTP classes is not in WebContent/WEB-INF/lib or otherwise on the server, make sure it is on this page."
Answered by nitind
I have an error when deploying manually my symfony project into my server. I can't do any console command even cache:clear. I have used the :
php app/console cache:clear --no-warmup
PHP Notice: Undefined index: argv in /app/vendor/symfony/src/Symfony/Component/Console/Input/ArgvInput.php on line 57
PHP Warning: array_shift() expects parameter 1 to be array, null given in /app/vendor/symfony/src/Symfony/Component/Console/Input/ArgvInput.php on line 61
PHP Warning: array_shift() expects parameter 1 to be array, null given in /app/vendor/symfony/src/Symfony/Component/Console/Input/ArgvInput.php on line 294
PHP Warning: Invalid argument supplied for foreach() in /app/vendor/symfony/src/Symfony/Component/Console/Input/ArgvInput.php on line 269
Status: 500 Internal Server Error
X-Powered-By: PHP/5.3.8-pl0-gentoo
cache-control: no-cache
date: Fri, 10 Feb 2012 15:31:08 GMT
content-type: text/html; charset=UTF-8
<br />
<b>Notice</b>: Undefined index: argv in <b>/app/vendor/symfony/src/Symfony/Component/Console/Input/ArgvInput.php</b> on line <b>57</b><br />
<br />
<b>Warning</b>: array_shift() expects parameter 1 to be array, null given in <b>/app/vendor/symfony/src/Symfony/Component/Console/Input/ArgvInput.php</b> on line <b>61</b><br />
<br />
<b>Warning</b>: array_shift() expects parameter 1 to be array, null given in <b>/app/vendor/symfony/src/Symfony/Component/Console/Input/ArgvInput.php</b> on line <b>294</b><br />
<br />
<b>Warning</b>: Invalid argument supplied for foreach() in <b>/app/vendor/symfony/src/Symfony/Component/Console/Input/ArgvInput.php</b> on line <b>269</b><br />
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="robots" content="noindex,nofollow" />
<title>Whoops, looks like something went wrong.</title>
<style>
/* Copyright (c) 2010, Yahoo! Inc. All rights rese
I have printed the app/logs/dev.log error:
[2012-02-10 13:04:58] event.DEBUG: Notified event "kernel.controller" to listener "Acme\DemoBundle\ControllerListener::onKernelController". [] []
[2012-02-10 13:04:58] event.DEBUG: Notified event "kernel.controller" to listener "JMS\SecurityExtraBundle\Controller\ControllerListener::onCoreController". [] []
[2012-02-10 13:04:59] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Component\Security\Http\Firewall\ContextListener::onKernelResponse". [] []
[2012-02-10 13:04:59] security.DEBUG: Write SecurityContext in the session [] []
[2012-02-10 13:04:59] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\ResponseListener::onKernelResponse". [] []
[2012-02-10 13:04:59] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Bundle\SecurityBundle\EventListener\ResponseListener::onKernelResponse". [] []
[2012-02-10 13:04:59] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Bridge\Monolog\Handler\FirePHPHandler::onKernelResponse". [] []
[2012-02-10 13:04:59] event.DEBUG: Notified event "kernel.response" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\CacheListener::onKernelResponse". [] []
[2012-02-10 13:04:59] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelResponse". [] []
[2012-02-10 13:04:59] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener::onKernelResponse". [] []
I have no idea and no description in the web
Please help me
Thanks
Sam
Here is an issue track which have brought some light to me:
https://github.com/symfony/symfony/issues/3323
After reading that I researched and I've found that the problem raises in PHP CLI configuration (php.ini file). The register_argc_argv directive must be enabled:
register_argc_argv=On
Or if you cannot modify the php.ini file, you can change it in time execution pasing as an argument to php:
php -d register_argc_argv=On your_script.php
did you try :
php-cli app/console cache:clear
instead of :
php app/console cache:clear
I have solved my problem. I have reinstall my server and now I use a debian one in order to use a gentoo distribution.
I have now no problem.
It works perfectly...
Thanks for all