I'm trying to run a simple hello world web application to make sure I've got the structure of everything right.
Here's what I've got:
ear_test.ear
ear_test.ear/META-INF
ear_test.ear/META-INF/application.xml
ear_test.ear/META-INF/MANIFEST.MF
ear_test.ear/META-INF/weblogic-application.xml
ear_test.ear/test_web_project_1.war
ear_test.ear/test_web_project_1.war/META-INF
ear_test.ear/test_web_project_1.war/META-INF/MANIFEST.MF
ear_test.ear/test_web_project_1.war/WEB-INF/classes
ear_test.ear/test_web_project_1.war/WEB-INF/lib
ear_test.ear/test_web_project_1.war/WEB-INF/web.xml
ear_test.ear/test_web_project_1.war/helloWorld.jsp
application.xml
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" version="5">
<display-name>ear_test</display-name>
<module>
<web>
<web-uri>test_web_project_1.war</web-uri>
<context-root>/test_web_project_1</context-root>
</web>
</module>
</application>
weblogic-application.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<weblogic-application>
<session-descriptor>
<cookie-name>WLSSessionID</cookie-name>
<cookie-http-only>false</cookie-http-only>
<debug-enabled>false</debug-enabled>
<sharing-enabled>true</sharing-enabled>
</session-descriptor>
</weblogic-application>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>test_web_project_1</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
<welcome-file>helloWorld.jsp</welcome-file>
</welcome-file-list>
</web-app>
I can deploy this to weblogic and it shows as active.
However when I try access the webapp, via:
http://myserver:7011/test_web_project_1
I get a 404 error.
Any suggestions for resolving this?
Check your URL again, make sure you are actually referencing the right URL for the server your application is deployed on.
Related
grails version 3.3.1
cache-ehcache:3.0.0.M1
can somebody send me a valid ehcache.xmlplease?
My file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd"
updateCheck="true"
monitoring="autodetect"
dynamicConfig="true">
<diskStore path="java.io.tmpdir"/>
<cache name="sevenSeconds"
maxEntriesLocalHeap="100"
maxEntriesLocalDisk="1000"
eternal="false"
timeToLiveSeconds="7"
timeToIdleSeconds="0"
memoryStoreEvictionPolicy="LFU"
transactionalMode="off">
<persistence strategy="localTempSwap" />
</cache>
<defaultCache
maxElementsInMemory="50000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"
/>
</ehcache>
and i get this error while startup:
Caused by: org.ehcache.xml.exceptions.XmlConfigurationException: Error parsing XML configuration at file:/home/user/workspaces/api2-grails/grails-app/conf/ehcacheCustom.xml
Caused by: org.xml.sax.SAXParseException: cvc-elt.1.a: Cannot find the declaration of element 'ehcache'.
thanks for suggestions
Since ehcache 3.0.0 the xml format changed. This is my base version:
<?xml version="1.0" encoding="UTF-8"?>
<config
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns='http://www.ehcache.org/v3'
xsi:schemaLocation="ehcache-core.xsd">
<persistence directory="java.io.tmpdir"/>
<cache alias="twentySeconds">
<expiry>
<ttl unit="seconds">20</ttl>
</expiry>
<heap>2</heap>
</cache>
</config>
After struggling with the same issue I found this link and just took it as a base to get the following working example:
<ehcache:config xmlns:ehcache="http://www.ehcache.org/v3" xmlns:jcache="http://www.ehcache.org/v3/jsr107">
<ehcache:cache alias="books">
<ehcache:key-type>java.lang.String</ehcache:key-type>
<ehcache:value-type>hello.Book</ehcache:value-type>
<ehcache:resources>
<ehcache:heap unit="MB">1</ehcache:heap>
<!--ehcache:offheap unit="MB">10</ehcache:offheap-->
</ehcache:resources>
</ehcache:cache>
</ehcache:config>
Here is my configration:
Tomcat 6<br/>
jdk1.6<br/>
MyEclipse
Win 7
HTTP Status 404 -
type Status report
I have a Dynamic Web Project set up in MyEclipse titled "ch21" with following structure. The web application works well local.But when I upload it to website.Then I can't call any jsp file.Such as index.jsp ,regist.jsp.
The error message is following.
HTTP Status 404
message
description The requested resource () is not available.
Apache Tomcat/6.0.29
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
</web-app>
struts.xml
<constant name="struts.i18n.encoding" value="gb2312"></constant>
<package name="struts2" extends="struts-default">
<action name="regist" class="regAction">
<result name="success" >/login.jsp</result>
<result name="input">/regist.jsp</result>
<result name="error">/regist.jsp</result>
</action>
</package>
I added the following in web.xml.
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>register.jsp</welcome-file>
</welcome-file-list>
I call http://example.net/index.jsp .But It can't work.
The error message :HTTP Status 404 .
I search other questions and then just now I asked the hosting.He help me and updata a jar(he didn't tell me detail),and he solve the question.Thank you very much!
I have some issues with BulkDataExchangeRequest/ReviseInventoryStatus(using the Large Merchant Sevices api) when trying to modify the quantities of listed products. I managed to successfully make all the prerequisite requests in order to upload and process the BulkDataExchange xml (createUploadJob, uploadFileRequest, startUploadJob) but the quantities of the products did not modified on the ebay shop. I've found out that in order to get the errors of the xml itself ,not the upload jobs, I must use the DownloadFileRequest, but I am failing to fix the errors returned by it. For the 3 products that I've tried to modify the quantity with ReviseInventoryStatus I am getting a 'Missing required container' with the error code 21916253. I've checked the xml that I send but I can't figure out what exactly what it is missing. Here is the xml, any tips would be appreciated:
<?xml version="1.0" encoding="UTF-8"?>
<BulkDataExchangeRequests>
<Header>
<SiteID>77</SiteID>
<Version>955</Version>
</Header>
<ReviseInventoryStatusRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<errorlanguage>en_US</errorlanguage>
<warninglevel>High</warninglevel>
<version>955</version>
<inventorystatus>
<itemid>281077289788</itemid>
<quantity>500</quantity>
<sku>MGA10003</sku>
<startprice>6.90</startprice>
</inventorystatus>
</ReviseInventoryStatusRequest>
<ReviseInventoryStatusRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<errorlanguage>en_US</errorlanguage>
<warninglevel>High</warninglevel>
<version>955</version>
<inventorystatus>
<itemid>271171602595</itemid>
<quantity>500</quantity>
<sku>MGA10215</sku>
<startprice>20.90</startprice>
</inventorystatus>
</ReviseInventoryStatusRequest>
<ReviseInventoryStatusRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<errorlanguage>en_US</errorlanguage>
<warninglevel>High</warninglevel>
<version>955</version>
<inventorystatus>
<itemid>281449929626</itemid>
<quantity>8</quantity>
<sku>MGA12496.3</sku>
<startprice>18.90</startprice>
</inventorystatus>
</ReviseInventoryStatusRequest>
</BulkDataExchangeRequests>
Here is the response from DownloadFileRequest:
<?xml version="1.0" encoding="utf-8"?>
<BulkDataExchangeResponses xmlns="urn:ebay:apis:eBLBaseComponents">
<ReviseInventoryStatusResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2016-04-15T07:39:41.431Z</Timestamp>
<Ack>Failure</Ack>
<Errors>
<ShortMessage>Erforderlicher Container fehlt.</ShortMessage>
<LongMessage>Erforderlicher Container fehlt.</LongMessage>
<ErrorCode>21916253</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Version>961</Version>
<Build>E961_UNI_API5_17901460_R1</Build>
</ReviseInventoryStatusResponse>
<ReviseInventoryStatusResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2016-04-15T07:39:41.565Z</Timestamp>
<Ack>Failure</Ack>
<Errors>
<ShortMessage>Erforderlicher Container fehlt.</ShortMessage>
<LongMessage>Erforderlicher Container fehlt.</LongMessage>
<ErrorCode>21916253</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Version>961</Version>
<Build>E961_UNI_API5_17901460_R1</Build>
</ReviseInventoryStatusResponse>
<ReviseInventoryStatusResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2016-04-15T07:39:41.660Z</Timestamp>
<Ack>Failure</Ack>
<Errors>
<ShortMessage>Erforderlicher Container fehlt.</ShortMessage>
<LongMessage>Erforderlicher Container fehlt.</LongMessage>
<ErrorCode>21916253</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Version>961</Version>
<Build>E961_UNI_API5_17901460_R1</Build>
</ReviseInventoryStatusResponse>
</BulkDataExchangeResponses>
Field names are case sensitive. I've spotted a few fields in your request that are all in lowercase. For example, <inventorystatus> should be <InventoryStatus>, and <itemid> needs to be <ItemID>.
I know this is an old question, but maybe it could help someone else.
Maybe you have to remove ErrorLanguage, WarningLevel and Version and leave your XML like this:
<?xml version="1.0" encoding="UTF-8"?>
<BulkDataExchangeRequests>
<Header>
<SiteID>77</SiteID>
<Version>955</Version>
</Header>
<ReviseInventoryStatusRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<inventorystatus>
<itemid>281077289788</itemid>
<quantity>500</quantity>
<sku>MGA10003</sku>
<startprice>6.90</startprice>
</inventorystatus>
</ReviseInventoryStatusRequest>
<ReviseInventoryStatusRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<inventorystatus>
<itemid>271171602595</itemid>
<quantity>500</quantity>
<sku>MGA10215</sku>
<startprice>20.90</startprice>
</inventorystatus>
</ReviseInventoryStatusRequest>
<ReviseInventoryStatusRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<inventorystatus>
<itemid>281449929626</itemid>
<quantity>8</quantity>
<sku>MGA12496.3</sku>
<startprice>18.90</startprice>
</inventorystatus>
</ReviseInventoryStatusRequest>
</BulkDataExchangeRequests>
when i log from testlog.jsp and fill the form with incorrect password, i am moved to err.jsp. So authorization mechanism working good.
when i fill form with login and password correct i moved to index.jsp, but i want to moved to page git.html.
has somebody a similar project??
btw. i use glassfish 4.1 and netbeans 8.0.2.
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>stronaretail</realm-name>
<form-login-config>
<form-login-page>/testlog.jsp</form-login-page>
<form-error-page>/err.jsp</form-error-page>
</form-login-config>
</login-config>
<security-constraint>
<web-resource-collection>
<web-resource-name>Authorization Mechanism</web-resource-name>
<url-pattern>/git.html</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>administrator</role-name>
</auth-constraint>
</security-constraint>
</web-app>
glassfish-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
<class-loader delegate="true"/>
<security-role-mapping>
<role-name>administrator</role-name>
<group-name>admin</group-name>
</security-role-mapping>
</glassfish-web-app>
Today, I integrate Log4jdbc 1.2 with Spring 3.1 Struts 2.1 Hibernate 4.1 in order to see the real SQL in console.
My project run normally,however, I don't get the real SQL.The amazing
thing is that I do get the SQL when I test with JUnit.
here is my log4j.properties
log4j.debug=true
log4j.logger.jdbc.audit=INFO,jdbc
log4j.additivity.jdbc.audit=true
log4j.logger.jdbc.resultset=INFO,jdbc
log4j.additivity.jdbc.resultset=true
log4j.logger.jdbc.sqlonly=DEBUG,sql
log4j.additivity.jdbc.sqlonly=true
log4j.logger.jdbc.sqltiming=DEBUG,sqltiming
log4j.additivity.jdbc.sqltiming=true
log4j.logger.jdbc.connection=FATAL,connection
log4j.additivity.jdbc.connection=true
log4j.appender.sql=org.apache.log4j.FileAppender
log4j.appender.sql.File=./logs/sql.log
log4j.appender.sql.Append=false
log4j.appender.sql.layout=org.apache.log4j.PatternLayout
log4j.appender.sql.layout.ConversionPattern=-----> %d{yyyy-MM-dd HH:mm:ss.SSS} %m%n%n
log4j.appender.sqltiming=org.apache.log4j.FileAppender
log4j.appender.sqltiming.File=./logs/sqltiming.log
log4j.appender.sqltiming.Append=false
log4j.appender.sqltiming.layout=org.apache.log4j.PatternLayout
log4j.appender.sqltiming.layout.ConversionPattern=-----> %d{yyyy-MM-dd HH:mm:ss.SSS} %m%n%n
log4j.appender.jdbc=org.apache.log4j.FileAppender
log4j.appender.jdbc.File=./logs/jdbc.log
log4j.appender.jdbc.Append=false
log4j.appender.jdbc.layout=org.apache.log4j.PatternLayout
log4j.appender.jdbc.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %m%n
log4j.appender.connection=org.apache.log4j.FileAppender
log4j.appender.connection.File=./logs/connection.log
log4j.appender.connection.Append=false
log4j.appender.connection.layout=org.apache.log4j.PatternLayout
log4j.appender.connection.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %m%n
And my web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<display-name>Spring14HibernateStruts2</display-name>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:log4j.properties</param-value>
</context-param>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
</web-app>