Change Max http thread count jboss AS6.1.0.Final - java

I want to know where can I increase the Max thread count in Jboss AS 6.1.0.Final.
I surf through google but can not find exact answer and the files and locations mentioned there is not correct.

This is done with the Tomcat Executor. You can read the details in Thread Pool Configuration in AS 6.x.
A standalone descriptor may be written, whose name is, or ends with, "jboss-threads.xml". The format of such a descriptor will look like this:
<?xml version="1.0" encoding="UTF-8"?>
<threads xmlns="urn:jboss:threads:2.0">
<thread-factory name="MyThreadFactory" thread-name-pattern="My Thread %t">
<thread-group name="MyThreadGroup"/>
</thread-factory>
<!-- This is the Executor instance -->
<thread-factory-executor name="MyExecutor">
<thread-factory name="MyThreadFactory"/>
<max-threads count="100" per-cpu="100"/>
</thread-factory-executor>
</threads>
ALTERNATIVELY: You can include it in a Microcontainer Deployment.
Due to the way that the Microcontainer processes XML deployments, it is possible to include your threads descriptor in the midst of a regular POJO deployment, like this:
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="urn:jboss:bean-deployer:2.0">
<!-- JBossMC elements here -->
<threads xmlns="urn:jboss:threads:2.0">
<thread-factory name="MyThreadFactory" thread-name-pattern="My Thread %t">
<thread-group name="MyThreadGroup"/>
</thread-factory>
<!-- This is the Executor instance -->
<thread-factory-executor name="MyExecutor">
<thread-factory name="MyThreadFactory"/>
<max-threads count="100" per-cpu="100"/>
</thread-factory-executor>
</threads>
</deployment>

Related

Spring Boot 2.2.6 No context given for SizeAndTimeBasedRollingPolicy at Logback

When I use these configuration:
logging:
file:
name: app.log
total-size-cap: 50MB
max-size: 2MB
max-history: 7
path: logs
I get this information at application startup:
LOGBACK: No context given for c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy#1818544933
When I create a dummy logback-spring.xml file there are no errors but application properties are ignored:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
</configuration>
What I am missing at the configuration?
Looks like a legitimate issue. https://github.com/spring-projects/spring-boot/issues/21056 has a bugfix targeted to the next 2.2.x release. Sounds like adding logback-spring.xml to y
Firsyly, you can not use both 'name' and 'path'. It's either of them.
Secondly, you need to set logging.config=/path/to/logback.xml
Here is my source of information: https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-logging-file-output

Google App Engine ThreadSafe

I have a Java project which is hosted through Google App Engine. I mistakenly changed ThreadSafe to false in the appengine-web.xml file, and since have changed it back to true. My application is now acting much slower and is throwing time out errors, which did not occur before I altered the appengine-web.xml file. Could it be the switching of ThreadSafe to false that is causing this behavior? Here is the configuration file:
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>my_application_id</application>
<version>1</version>
<threadsafe>true</threadsafe>
<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
</system-properties>
<sessions-enabled>true</sessions-enabled>
</appengine-web-app>
You can try to shutdown all existing instances and restarting the app. This will ensure that the latest version is running.

How to deploy one .war after another on JBoss

Is there a way to define order of .war deployments on JBoss 7?
What I would like to accomplish is that on startup of JBoss it first deploys .war A and then .war B.
I need this because .war A is a service which is consumed on a startup of .war B!
You have to specify the dependency on the B war by creating a jboss-all.xml file on the META-INF folder,with a content like this:
<jboss umlns="urn:jboss:1.0">
<jboss-deployment-dependencies xmlns="urn:jboss:deployment-dependencies:1.0">
<dependency name="A.war" />
</jboss-deployment-dependencies>
</jboss>
The procedure is explained here Control the order of Deployed Applications on JBoss
As mentioned in this JBoss's Forum thread, in order to ensure that A.war is deployed first than B.war, you should create a MANIFEST file under your B.war's src/main/webapp/META-INF folder, with the following entry:
dependencies: deployment.A.war
Furthermore, if you need to access A.war classes from B.war, you should also add a jboss-deployment-structure.xml, under your B.war's src/main/webapp/WEB-INF folder, with the following contents:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:jboss:deployment-structure:1.2 http://www.jboss.org/schema/jbossas/jboss-deployment-structure-1_2.xsd">
<deployment>
<dependencies>
<module name="deployment.A.war" export="true"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
You can also take a look at JBoss AS 7 class loading documentation.

Managed VM not running Cloud SQL Proxy

Launching a Managed VM with a Java application, the following appengine-web.xml
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>thmadmin-ben</application>
<version>master</version>
<threadsafe>true</threadsafe>
<vm>true</vm>
<manual-scaling>
<instances>1</instances>
</manual-scaling>
</appengine-web-app>
I don't appear to have a Cloud SQL proxy running on the managed VM. Do I need to add an app.yaml file or define something else in appengine-web.xml?
Per the documentation, you need to specify the instances which you will be connecting to as follows and redeploy your application.
When using appengine-web.xml, the syntax would be:
<beta-settings>
<setting name="cloud_sql_instances" value="<PROJECT-ID>:<REGION-NAME>:<SQL-INSTANCE-NAME>[, ...]" />
</beta-settings>
If this setting is not present, the Cloud SQL Proxy won't start.

multiple DBs with Jboss 4.2.3

We are using Jboss 4.2.3 with EJBs and hibernate.
Currently we defined 3 db connections in our persistence.xml file (one for reads (tx-local), one for writes (no-tx) and one for statistics (no-tx)), and when we add a forth db connection which is also (no-tx) and map a couple of entities to it, the machine starts to show an unusual load.
If we remove this connection (no one is using it still) the load get back to normal.
I guess it is some sort of configuration problem with JBoss, but I'm not sure.
any assistance will be appreciated.
thanks.
this is the ds.xml file content:
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: feedback-ds.xml 71535 2008-04-01 07:05:03Z adrian#jboss.org $ -->
<!-- Datasource config for MySQL using 3.0.9 available from:
http://www.mysql.com/downloads/api-jdbc-stable.html
-->
<datasources>
<no-tx-datasource>
<jndi-name>FeedbackDS</jndi-name>
<connection-url>jdbc:mysql://m6sdb:3306/m6sFeedbacks?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<password>password</password>
<min-pool-size>10</min-pool-size>
<!-- The maximum connections in a pool/sub-pool -->
<max-pool-size>1000</max-pool-size>
<property name="hibernate.show.sql" value="true"></property>
<idle-timeout-minutes>10</idle-timeout-minutes>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
<!-- should only be used on drivers after 3.22.1 with "ping" support -->
<valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</no-tx-datasource>
</datasources>

Categories