#tomcat7
Explore tagged Tumblr posts
Text
Share SSH US 28/08/2022 - 8:45
Share SSH US 28/08/2022 – 8:45
166.254.29.237|admin|admin|US|XShare.Pro 65.20.135.218|admin|admin|US|XShare.Pro 74.195.20.230|ubnt|ubnt|US|XShare.Pro 12.23.40.164|operator|operator|US|XShare.Pro 172.105.196.53|support|support|US|XShare.Pro 166.142.15.67|test|test|US|XShare.Pro 108.58.123.210|admin|admin|US|XShare.Pro 75.127.205.91|admin|admin|US|XShare.Pro 52.89.140.33|tomcat7|tomcat7|US|XShare.Pro 166.150.200.7|username|passw…
View On WordPress
#2022 ssh us#Share SSH#share ssh 2022#SSH#ssh 2022#ssh 2022 fresh#ssh all countries#ssh checker#ssh free#ssh free 2022#ssh fresh 2022#ssh fresh checker#ssh update#SSH update daily#ssh vietnam#ssh xshare
0 notes
Text
Java Developer
[ad_1] Gob title: Java Developer Company: BirjaSoft Technologies Gob description: Java Developer 0-2 Bhopal,Vidisha 10 BE/B.Tech/ B.Sc (IT)/ BCA/ MCA Core Java, HTML5, CSS3, Bootstrap, JSP, Servlet, JDBC, Struts, Spring, Hibernate, Web Services, XML, XSLT, JSON, JavaScript, Ajax, MySQL, Tomcat7, Unix & Linux Other deta… Expected salary: Location: Bhopal, Madhya Pradesh Job date: Thu, 20 Sep 2018…
View On WordPress
0 notes
Text
Atlassian Crowd 3.1 Release Notes
The Atlassian Crowd team is pleased to bring you Crowd 3.1, which comes with some amazing features:
Autoadding users to groups per application
Support for Microsoft SQL 2016
Support for PostgreSQL 9.6
56 votes satisfied
4 feature and improvement requests fulfilled
Thank you for your feedback!
We recommend that you read the upgrade notes for important information about this release before installing the newest version.
Automatically assigning groups per application
We are excited to announce a new feature that will help you to optimize license usage of Atlassian products connected to Crowd.
While mapping directories to applications, for each directory in the application you may define a set of groups that will be automatically assigned to the user upon first successful login to this application using such directory.
If the directory is shared among different application in Crowd, you may define a different set of auto-assigned groups per application, contrary to an existing directory default groups functionality.
For more about use cases and feature description, see Automatically assigning users to groups.
Support for newer databases versions
We've added support for Microsoft SQL 2016 and Postgres 9.6. For a full list of supported platforms, you can check out our supported platforms page.
Issues in Release
Improvement: All auto group add per application vs user directory
Improvement: Add support for Microsoft SQL Server 2016
Improvement: Postgres 9.6 support for Crowd
Improvement: Default group memberships for Applications
Fixed: HTTP Compression with Java 8 update 151 breaks the Crowd UI
Fixed: Users without an userExpired attribute get removed when synchronising ActiveDirectory with the 'Filter out expired users' setting enabled
Fixed: Crowd load ALL groups to dropdown list - app freezes
Fixed: Groups tab under applications takes time to load when number of groups is large
Fixed: Max password attempts acording to documentation will disable user, but user will still be active with flag to change password.
Fixed: Groups in directories selected as "Allow all to authenticate" for the Crowd application can be added individually as well
Task: Upgrade to Hibernate 5
New Feature: Allow granting admin permissions to Crowd for groups not explicitly allowed to log in
Task: Bump Support Tools Plugin (STP) to 4.0.1
New Feature: Add new users to different groups upong login depending on the crowd url used
Fixed: Tomcat7 produces corrupted gzip response with newest zlib (1.2.11) library
Source
0 notes
Text
TheDiginewz
DSA-3754-1 tomcat7 https://t.co/l8VM3N7fIs #Security
— TheDigiNewz (@TheDigiNewz) January 9, 2017
from Twitter https://twitter.com/TheDigiNewz January 09, 2017 at 11:32AM via IFTTT
0 notes
Text
Resolved: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener #fix #dev #computers
Resolved: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener #fix #dev #computers
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
I included:
all Spring libs,
Apache Tomcat 7.0 library
in Build Path
but it still gives errors:
SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener at…
View On WordPress
0 notes
Text
How to: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
I included:
all Spring libs,
Apache Tomcat 7.0 library
in Build Path
but it still gives errors:
SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener at…
View On WordPress
0 notes
Link
Easy step-by-step instructions on installing and configuring Tomcat 7 and using Eclipse to start/stop it and deploy apps to it
0 notes
Text
Installing and configuring the Apache Tomcat 7 admin interface
Install and configure the webinterface of Apache Tomcat7 (including examples and tomcat7 docs). The installation is simple, since we use standard available packages within Debian Wheezy.
sudo apt-get install tomcat7-admin tomcat7-examples tomcat7-docs
With this you just installed the java applets for administration and the manual of your tomcat server, aswell as some example java applications.
By default, Tomcat 7 supports the following user roles that you can use to set up multiple logins for different level of accesses:
manager-gui - allows access to the HTML GUI and the status pages
manager-script - allows access to the text interface and the status pages
manager-jmx - allows access to the JMX proxy and the status pages
manager-status - allows access to the status pages only
To be able to really use the admin interface, you have to edit the following file using your favorite editor and add users that are allowed to administer the java applications that will be published using Apache Tomcat 7.
vi /etc/tomcat7/tomcat-users.xml
We will see the folowing:
<?xml version='1.0' encoding='utf-8'?> <!-- ... license info ... --> <tomcat-users> <!-- NOTE: By default, no user is included in the "manager-gui" role required to operate the "/manager/html" web application. If you wish to use this app, you must define such a user - the username and password are arbitrary. --> <!-- NOTE: The sample user and role entries below are wrapped in a comment and thus are ignored when reading this file. Do not forget to remove <!.. ..> that surrounds them. --> <!-- <role rolename="tomcat"/> <role rolename="role1"/> <user username="tomcat" password="tomcat" roles="tomcat"/> <user username="both" password="tomcat" roles="tomcat,role1"/> <user username="role1" password="tomcat" roles="role1"/> --> </tomcat-users>
Now we will add the role for administration (manager-gui) and create a user for it right above the </tomcat-users> tag.
<role rolename="manager-gui"/> <user username="admin" password="password" roles="manager-gui"/>
(You can name the user and define the password as you like but keep in mind that the password is stored in plain text, the rolename has to be manager-gui.)
Save the file and restart your tomcat service using:
service tomcat7 restart
We can test the install by pointing your favorite browser to http://<servername or ip-address>:8080/manager/html
You will see the following screen.
Next Up: Reverse Proxies and loadbalancing of web applications
Creating Solutions and Implementations in Technology
0 notes
Text
Share SSH US 26/08/2022 - 10:43
Share SSH US 26/08/2022 – 10:43
12.23.40.164|operator|operator|United States (US)|XShare.Pro 104.235.68.24|root|12345|United States (US)|XShare.Pro 12.167.67.164|operator|operator|United States (US)|XShare.Pro 75.127.205.91|admin|admin|United States (US)|XShare.Pro 64.184.37.185|user|user|United States (US)|XShare.Pro 52.89.140.33|tomcat7|tomcat7|United States (US)|XShare.Pro 64.184.100.143|user|user|United States…
View On WordPress
#2022 ssh us#Share SSH#share ssh 2022#share ssh us 2022#SSH#ssh 2022#ssh 2022 fresh#ssh all countries#ssh checker#ssh free#ssh free 2022#ssh fresh 2022#ssh fresh checker#ssh update#SSH update daily#ssh vietnam#ssh xshare
0 notes
Text
Persistenza in java con Hibernate!
Non perderò tempo a spiegarvi cosa sono java, hibernate o tomcat.
Sia chiaro che non mi sono perso in sofismi e ho deliberatamente preso ispirazione dal seguente articolo:
http://entjavastuff.blogspot.it/2012/03/jsf-21-and-jpa-2-on-tomcat-7.html
Chi non usa JSF può andare direttamente alla sezione JPA per capire come effettuare il setup delle librerie necessarie, il datasource setup, come scrivere un resources/META-INF/persistence.xml file con riferimenti a hibernate.
Punto dritto al sodo e vi spiattelo il codice di seguito:
import java.util.Map; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; import org.apache.log4j.Logger; /** * Class to manage Entity manager factory and Entity manager in persistence * context without Context Listener. <br/> * Class takes care of following basic things: <br/> * <ul> * <li>using one time on-demand initialization, it sets up the * EntityManagerFactory</li> * <li>it provides a way to create, obtain and properly close an EntityManager</li> * <li>it provides a way to create, obtain and properly close an EntityManager * overriding the default configuration read in persistence.xml</li> * <li>the DBManager class provides an explicit "readOnly" mode which you should * use when you are not going to persist any changes (effectively no JPA * transaction is created in readonly mode)</li> * <li>it provides a way for you to trigger a commit or rollback</li> * </ul> * * @author Alessio Flaviani 19/set/2013 DBManager.java */ public class DBManager { protected static String CLASS_NAME = DBManager.class.getName(); protected static Logger logger = Logger.getLogger(DBManager.class); private static volatile boolean initialized = false; private static Boolean lock = new Boolean(true); private static EntityManagerFactory emf = null; private EntityManager outer; private static volatile boolean initializedOver = false; private static Boolean lockOver = new Boolean(true); private static EntityManagerFactory emfOver = null; private EntityManager outerOver; /** * Default constructor */ public DBManager() { } /** * Open Dba; if readonly no JPA transaction is actually started, meaning you * will have no persistence store. You can still persist stuff, but the * entities won't become managed. */ public DBManager(boolean readOnly) { logger.debug("initializing entity manager factory ..."); initialize(); logger.debug("opening entity manager ..."); openEm(readOnly); } /** * Open Dba; if readonly no JPA transaction is actually started, meaning you * will have no persistence store. You can still persist stuff, but the * entities won't become managed. * * @param entityFactoryConfig * new properties to override previous configuration, if exist. */ public DBManager(Map<String, Object> entityFactoryConfig) { logger .debug("initializing entity manager factory overriding default configuration ..."); initialize(entityFactoryConfig); logger .debug("opening entity manager overriding default configuration ..."); openEmOver(false); } /** * Thread safe way to initialize the entity manager factory. */ private void initialize() { if (initialized) { return; } synchronized (lock) { if (initialized) { return; } initialized = true; try { emf = Persistence.createEntityManagerFactory("VDH_DB"); logger.info("entity manager factory created at once ..."); } catch (Throwable t) { logger.error("Failed to setup persistence unit!", t); return; } } } /** * Thread safe way to initialize the entity manager factory with new * properties to override previous configuration * * @param entityFactoryConfig * void */ private void initialize(Map<String, Object> entityFactoryConfig) { if (initializedOver) { return; } synchronized (lockOver) { if (initializedOver) { return; } initializedOver = true; try { emfOver = Persistence.createEntityManagerFactory( "com.tiscali.hosting.dns", entityFactoryConfig); logger.info("entity manager factory overrides ..."); } catch (Throwable t) { logger .error( "Failed to setup persistence unit with configuration overrides!", t); return; } } } /** * Create an entity manager. if readonly no JPA transaction is actually * started. * * @param readOnly * void */ public void openEm(boolean readOnly) { if (outer != null) { return; } outer = emf.createEntityManager(); if (!readOnly) { logger.debug("opening transaction ..."); outer.getTransaction().begin(); } } /** * Create an entity manager. if readonly no JPA transaction is actually * started. * * @param readOnly * void */ public void openEmOver(boolean readOnly) { if (outerOver != null) { return; } outerOver = emfOver.createEntityManager(); if (!readOnly) { logger.debug("opening ovveride transaction ..."); outerOver.getTransaction().begin(); } } /** * Get the outer transaction; an active transaction must already exist for * this to succeed. * @return EntityManager */ public EntityManager getActiveEm() { if (outer == null) { throw new IllegalStateException("No transaction was active!"); } return outer; } /** * Get the outer transaction; an active transaction must already exist for * this to succeed. */ public EntityManager getActiveEmOver() { if (outerOver == null) { throw new IllegalStateException( "No override transaction was active!"); } return outerOver; } /** * Commit the transaction only if there is an active one * * void */ public void commit() { if (outer != null && outer.getTransaction().isActive() && !outer.getTransaction().getRollbackOnly()) { logger.debug("commiting ..."); this.outer.getTransaction().commit(); this.outer.getTransaction().begin(); } else { logger.error("commit failed, outer is null"); } } /** * Commit the transaction only if there is an active one * * void */ public void commitOver() { if (outerOver != null && outerOver.getTransaction().isActive() && !outerOver.getTransaction().getRollbackOnly()) { logger.debug("override commiting ..."); this.outerOver.getTransaction().commit(); this.outerOver.getTransaction().begin(); } else { logger.error("commit override failed, outer is null"); } } /** * Mark the transaction as rollback only, if there is an active transaction * to begin with. */ public void markRollback() { if (outer != null) { logger.debug("mark rollback ..."); outer.getTransaction().setRollbackOnly(); } } /** * Mark the transaction as rollback only, if there is an active transaction * to begin with. */ public void markRollbackOver() { if (outerOver != null) { logger.debug("mark rollback override..."); outerOver.getTransaction().setRollbackOnly(); } } /** * True if the transaction has marked as rollback * * @return boolean */ public boolean isRollbackOnly() { return outer != null && outer.getTransaction().getRollbackOnly(); } /** * True if the transaction has marked as rollback * * @return boolean */ public boolean isRollbackOnlyOver() { return outerOver != null && outerOver.getTransaction().getRollbackOnly(); } /** * Close the entity manager, properly committing or rolling back a * transaction if one is still active. */ public void closeEm() { if (outer == null) { return; } try { if (outer.getTransaction().isActive()) { if (outer.getTransaction().getRollbackOnly()) { logger.debug("rollbacking ..."); outer.getTransaction().rollback(); } else { logger.debug("commiting ..."); outer.getTransaction().commit(); } } } finally { if (outer.isOpen()) outer.close(); outer = null; } } /** * Close the entity manager, properly committing or rolling back a * transaction if one is still active. */ public void closeEmOver() { if (outerOver == null) { return; } try { if (outerOver.getTransaction().isActive()) { if (outerOver.getTransaction().getRollbackOnly()) { logger.debug("rollbacking override ..."); outerOver.getTransaction().rollback(); } else { logger.debug("commiting override ..."); outerOver.getTransaction().commit(); } } } finally { if (outerOver.isOpen()) outerOver.close(); outerOver = null; } } }
Ho apportato pochi cambi alla classe riportata nell'articolo precedentemente citato.
La classe permette di gestire l'entity factory manager e l'entity manager in un contesto di persistenza senza implementare un context listener per la creazione, gestione e chiusura della factory stessa in fase di startup e shutdown del server container. La classe permette di
sfruttare l'inizializzazione one-time della factory su richiesta
creare, utilizzare e chiudere un'entity manager
creare, utilizzare e chiudere un'entity manager sovrascrivendo la configurazione di default letta nel persistence.xml utilizzato da hibernate
un metodo di gestione delle istanze senza persistenza
una gestione dei commit e dei rollback delle transazioni ottimizzato
Ho introdotto la possibilità di creare entity manager con la configurazione passata a runtime. Nel mio specifico caso ho la necessità di creare l'entity manager leggendo la configurazione del db a cui connettermi in base a delle discriminanti passate come parametro. E' una situazione molto utile per chi deve lavorare su basi dati differenti nello stesso algoritmo. Ho modificato la gestione dei commit riaprendo la transazione dopo la chiusura della precedente. La spiegazione è semplice: ho un'architettura complessa costituita da più webservice. Alcuni di essi sono invocati da altri webservice da 1 a n volte. I metodi dei webservice inglobati in altri webservice gestiscono l'intero ciclo di vita della transazione: apertura entity e transaction, commit o rollback, chiusura entity. Di conseguenza il metodo inglobante (passatemi il termine :) ) si ritroverebbe la transazione chiusa al completamento del ciclo di vita del metodo inglobato perchè l'entity manager è gestita a livello globale!
Da qui la decisione di riaprire la transazione dopo un commit! Come scritto da Gimby (l'autore dell'articolo postato in alto):
Simple = better
That's all folks! Alessio Flaviani
0 notes
Text
Modify Xms Xmx in Tomcat 7
Create a file setenv.sh in the same directory as catalina.sh and add the following:
$ JAVA_OPTS="-Xms512m -Xmx1024m -XX:+UseConcMarkSweepGC"
or whatever value you want!
0 notes
Text
Moving a Spring application from Jboss 7.0.2 to Tomcat 7.0.26
Here are steps to move a spring 2.5.6 application from Jboss 7 to tomcat 7.
The biggest issue is that tomcat doesn't come with its own JTA implementation.
Modify the spring version and the spring test jar version from 3.1.0 to 2.5.6.SEC02 for spring-expression and spring-asm updated to version 2.5.6.RELEASE Downgrading to 2.5.6 allows the JOTM tansaction manager to be used in the persistence.xml Remove all the Redirect attributes usages Change hibernate-jpa.jar file to be compile time in pom.xml Remove <mvc:business-context-bean /> call from the spring-business-context.xml Changed the TilesConfigurer with the patched up version to work with spring2.5.6 and tiles2.1.2
Put the following Java file in your project and configure this in your spring context xml file,
/* * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
package com.sumequal.web.tiles2;
import java.util.Enumeration; import java.util.Properties;
import javax.servlet.ServletConfig; import javax.servlet.ServletContext;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.tiles.TilesApplicationContext; import org.apache.tiles.TilesContainer; import org.apache.tiles.TilesException; import org.apache.tiles.access.TilesAccess; import org.apache.tiles.context.AbstractTilesApplicationContextFactory; import org.apache.tiles.definition.DefinitionsFactory; import org.apache.tiles.definition.digester.DigesterDefinitionsReader; //import org.apache.tiles.evaluator.el.ELAttributeEvaluator; import org.apache.tiles.factory.AbstractTilesContainerFactory; import org.apache.tiles.factory.TilesContainerFactory; import org.apache.tiles.preparer.BasicPreparerFactory; import org.apache.tiles.servlet.context.ServletTilesApplicationContext; //import org.apache.tiles.servlet.context.wildcard.WildcardServletTilesApplicationContextFactory; import org.apache.tiles.web.util.ServletContextAdapter;
import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.InitializingBean; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; import org.springframework.web.context.ServletContextAware; import org.springframework.web.servlet.view.tiles2.SpringLocaleResolver; import org.springframework.web.servlet.view.tiles2.TilesView;
/** * Helper class to configure Tiles2 for the Spring Framework. See * <a href="http://tiles.apache.org">http://tiles.apache.org</a> * for more information about Tiles, which basically is a templating * mechanism for JSP-based web applications. * * <p>The TilesConfigurer simply configures a TilesContainer using a set * of files containing definitions, to be accessed by {@link TilesView} * instances. * * <p>TilesViews can be managed by any {@link org.springframework.web.servlet.ViewResolver}. * For simple convention-based view resolution, consider using * {@link org.springframework.web.servlet.view.UrlBasedViewResolver} with the * "viewClass" property set to "org.springframework.web.servlet.view.tiles2.TilesView". * * <p>A typical TilesConfigurer bean definition looks as follows: * * <pre> * <bean id="tilesConfigurer"> * <property name="definitions"> * <list> * <value>/WEB-INF/defs/general.xml</value> * <value>/WEB-INF/defs/widgets.xml</value> * <value>/WEB-INF/defs/administrator.xml</value> * <value>/WEB-INF/defs/customer.xml</value> * <value>/WEB-INF/defs/templates.xml</value> * </list> * </property> * </bean></pre> * * The values in the list are the actual files containing the definitions. * * @author Juergen Hoeller * @author Richard Jr Barabé * @since 2.5 * @see TilesView * @see org.springframework.web.servlet.view.UrlBasedViewResolver */ public class SpringTilesConfigurer implements ServletContextAware, InitializingBean, DisposableBean {
protected final static Log logger = LogFactory.getLog(SpringTilesConfigurer.class);
private final Properties tilesPropertyMap = new Properties();
private ServletContext servletContext;
private TilesApplicationContext tilesContext;
public SpringTilesConfigurer() { // this.tilesPropertyMap.put( // AbstractTilesApplicationContextFactory.APPLICATION_CONTEXT_FACTORY_INIT_PARAM, // WildcardServletTilesApplicationContextFactory.class.getName()); this.tilesPropertyMap.put( TilesContainerFactory.PREPARER_FACTORY_INIT_PARAM, BasicPreparerFactory.class.getName()); this.tilesPropertyMap.put( DefinitionsFactory.LOCALE_RESOLVER_IMPL_PROPERTY, SpringLocaleResolver.class.getName()); // this.tilesPropertyMap.put(TilesContainerFactory.ATTRIBUTE_EVALUATOR_INIT_PARAM, ELAttributeEvaluator.class.getName()); this.tilesPropertyMap.put(TilesContainerFactory.CONTAINER_FACTORY_MUTABLE_INIT_PARAM, Boolean.toString(false)); }
/** * Set the Tiles definitions, i.e. the list of files containing the definitions. * Default is "/WEB-INF/tiles.xml". */ public void setDefinitions(String[] definitions) { if (definitions != null) { String defs = StringUtils.arrayToCommaDelimitedString(definitions); if (logger.isInfoEnabled()) { logger.info("TilesConfigurer: adding definitions [" + defs + "]"); } this.tilesPropertyMap.put(DefinitionsFactory.DEFINITIONS_CONFIG, defs); } }
/** * Set whether to validate the Tiles XML definitions. Default is "true". */ public void setValidateDefinitions(boolean validateDefinitions) { this.tilesPropertyMap.put(DigesterDefinitionsReader.PARSER_VALIDATE_PARAMETER_NAME, Boolean.toString(validateDefinitions)); }
/** * Set the {@link org.apache.tiles.definition.DefinitionsFactory} implementation to use. * Default is {@link org.apache.tiles.definition.UrlDefinitionsFactory}, * operating on definition resource URLs. * <p>Specify a custom DefinitionsFactory, e.g. a UrlDefinitionsFactory subclass, * to customize the creation of Tiles Definition objects. Note that such a * DefinitionsFactory has to be able to handle {@link java.net.URL} source objects, * unless you configure a different TilesContainerFactory. */ public void setDefinitionsFactoryClass(Class<?> definitionsFactoryClass) { this.tilesPropertyMap.put(TilesContainerFactory.DEFINITIONS_FACTORY_INIT_PARAM, definitionsFactoryClass.getName()); }
/** * Set the {@link org.apache.tiles.preparer.PreparerFactory} implementation to use. * Default is {@link org.apache.tiles.preparer.BasicPreparerFactory}, creating * shared instances for specified preparer classes. * <p>Specify {@link SimpleSpringPreparerFactory} to autowire * {@link org.apache.tiles.preparer.ViewPreparer} instances based on specified * preparer classes, applying Spring's container callbacks as well as applying * configured Spring BeanPostProcessors. If Spring's context-wide annotation-config * has been activated, annotations in ViewPreparer classes will be automatically * detected and applied. * <p>Specify {@link SpringBeanPreparerFactory} to operate on specified preparer * <i>names</i> instead of classes, obtaining the corresponding Spring bean from * the DispatcherServlet's application context. The full bean creation process * will be in the control of the Spring application context in this case, * allowing for the use of scoped beans etc. Note that you need to define one * Spring bean definition per preparer name (as used in your Tiles definitions). * @see SimpleSpringPreparerFactory * @see SpringBeanPreparerFactory */ public void setPreparerFactoryClass(Class<?> preparerFactoryClass) { this.tilesPropertyMap.put(TilesContainerFactory.PREPARER_FACTORY_INIT_PARAM, preparerFactoryClass.getName()); }
/** * Set whether to use a MutableTilesContainer for this application. * Default is "false". */ public void setUseMutableTilesContainer(boolean useMutableTilesContainer) { this.tilesPropertyMap.put(TilesContainerFactory.CONTAINER_FACTORY_MUTABLE_INIT_PARAM, Boolean.toString(useMutableTilesContainer)); }
/** * Set Tiles properties (equivalent to the ServletContext init-params in * the Tiles documentation), overriding the default settings. */ public void setTilesProperties(Properties tilesProperties) { CollectionUtils.mergePropertiesIntoMap(tilesProperties, this.tilesPropertyMap); }
public void setServletContext(ServletContext servletContext) { this.servletContext = servletContext; }
/** * Creates and exposes a TilesContainer for this web application. * @throws TilesException in case of setup failure */ public void afterPropertiesSet() throws TilesException { TilesContainer container = createTilesContainer(); TilesAccess.setContainer(this.tilesContext, container); }
/** * Create a TilesContainer for this web application. * @param context this web application's ServletContext * @return the TilesContainer to expose * @throws TilesException in case of setup failure */ protected TilesContainer createTilesContainer() throws TilesException { ServletContextAdapter adaptedContext = new ServletContextAdapter(new DelegatingServletConfig()); TilesApplicationContext preliminaryContext = new ServletTilesApplicationContext(adaptedContext); AbstractTilesApplicationContextFactory contextFactory = AbstractTilesApplicationContextFactory.createFactory(preliminaryContext); this.tilesContext = contextFactory.createApplicationContext(adaptedContext); AbstractTilesContainerFactory factory = AbstractTilesContainerFactory.getTilesContainerFactory(this.tilesContext); return factory.createContainer(this.tilesContext); }
/** * Removes the TilesContainer from this web application. * @throws TilesException in case of cleanup failure */ public void destroy() throws TilesException { TilesAccess.setContainer(this.tilesContext, null); }
/** * Internal implementation of the ServletConfig interface, to be passed * to the wrapped servlet. Delegates to ServletWrappingController fields * and methods to provide init parameters and other environment info. */ private class DelegatingServletConfig implements ServletConfig {
public String getServletName() { return "TilesConfigurer"; }
public ServletContext getServletContext() { return servletContext; }
public String getInitParameter(String paramName) { return tilesPropertyMap.getProperty(paramName); }
public Enumeration<?> getInitParameterNames() { return tilesPropertyMap.keys(); } }
}
/WEB-INF/tiles-definitions.xml
downgraded from tiles 2.2.1 to 2.1.2
removed the following line from spring-business-context.xml
<bean id="validator" />
Changed version in persistence.xml from 2.0 to 1.0
After all this change, I've got the following issue,
21:14:56,369 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/sumequal]] (MSC service thread 1-3) Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/spring-business-context.xml]: Invocation of init method failed; nested exception is java.lang.AbstractMethodError
Then I've changed using two application context file, one for web and another for server configurations into one and configured that in ServletDispatcher init param. Everything worked fine.
0 notes
Text
Installing Apache Tomcat 7 on Debian Wheezy (using Oracle Java 7)
When installing applications within DTAP (Development, Test, Acceptance, Production) environments, I prefer doing as little compiling als possible to prevent incompatibility with the packages installed and updated with the aptitude package manager within Debian / Ubuntu.
NOTE:
First install Oracle Java 7 using my post on howto Install ORACLE Java 7 on Debian Wheezy
With Java 7 installed we install Tomcat7. Since Tomcat 7 is part of the standard repository of Debian wheezy, we just execute the following command as root or using sudo:
apt-get install tomcat7
You will see the following error:
Setting up tomcat7 (7.0.28-4+deb7u1) ... Creating config file /etc/default/tomcat7 with new version Adding system user `tomcat7' (UID 105) ... Adding new user `tomcat7' (UID 105) with group `tomcat7' ... Not creating home directory `/usr/share/tomcat7'. Creating config file /etc/logrotate.d/tomcat7 with new version [....] no JDK found - please set JAVA_HOME ... failed! invoke-rc.d: initscript tomcat7, action "start" failed.
The reason for this error is that we use Oracle Java 7 instead of OpenJDK Java 6 that is defined in the standard packages within Debian Wheezy.
To solve this we have to define JAVA_HOME in /etc/default/tomcat7
vi /etc/default/tomcat7
# Run Tomcat as this user ID. Not setting this or leaving it blank will use the # default of tomcat7. TOMCAT7_USER=tomcat7 # Run Tomcat as this group ID. Not setting this or leaving it blank will use # the default of tomcat7. TOMCAT7_GROUP=tomcat7 # The home directory of the Java development kit (JDK). You need at least # JDK version 1.5. If JAVA_HOME is not set, some common directories for # OpenJDK, the Sun JDK, and various J2SE 1.5 versions are tried. #JAVA_HOME=/usr/lib/jvm/openjdk-6-jdk JAVA_HOME=/usr/lib/jvm/java-7-oracle # You may pass JVM startup parameters to Java here. If unset, the default # options will be: -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC # # Use "-XX:+UseConcMarkSweepGC" to enable the CMS garbage collector (improved # response time). If you use that option and you run Tomcat on a machine with # exactly one CPU chip that contains one or two cores, you should also add # the "-XX:+CMSIncrementalMode" option. JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC" # To enable remote debugging uncomment the following line. # You will then be able to use a java debugger on port 8000. #JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" # Java compiler to use for translating JavaServer Pages (JSPs). You can use all # compilers that are accepted by Ant's build.compiler property. #JSP_COMPILER=javac # Use the Java security manager? (yes/no, default: no) #TOMCAT7_SECURITY=no # Number of days to keep logfiles in /var/log/tomcat7. Default is 14 days. #LOGFILE_DAYS=14 # Location of the JVM temporary directory # WARNING: This directory will be destroyed and recreated at every startup ! #JVM_TMP=/tmp/tomcat7-temp # If you run Tomcat on port numbers that are all higher than 1023, then you # do not need authbind. It is used for binding Tomcat to lower port numbers. # NOTE: authbind works only with IPv4. Do not enable it when using IPv6. # (yes/no, default: no) #AUTHBIND=no
Start Tomcat with the following command:
service tomcat7 start
root@server:# service tomcat7 start
[....] Starting Tomcat servlet engine: tomcat7.
root@server:#
Tomcat is now installed.
We can test the install by pointing your favorite browser to http://<servername or ip-address>:8080
You will see the following screen.
This is all there is to it, to be able to be able to run Apache Tomcat 7 on Debian Wheezy.
In a future post we will explain how to install and configure the admin interface.

Creating Solutions and Implementations in Technology
0 notes