My last two changesets in changelog.xml are not getting executed on application startup. There are no errors in the log file, but when I look at the databasechangelog, I do not see the statements. Nor do I see the tables. (These are simple create table changesets.)
Any tips on how to troubleshoot or debug would be much appreciated. Below are my changeset. I've simplified them once I realized migration wasn't happening. But what I really want to figure out is how to turn on logging, as I am mystified about what happened. (This was working fine 2 days ago.)
<changeSet author='rtrei' id='test1'>
<createTable tableName="foo">
<column autoIncrement="true" name="id" type="bigint">
<constraints nullable="false" primaryKey="true" primaryKeyName="fooPK"/>
</column>
<column name="version" type="bigint">
<constraints nullable="false"/>
</column>
</createTable>
<createTable tableName="foo2">
<column autoIncrement="true" name="id" type="bigint">
<constraints nullable="false" primaryKey="true" primaryKeyName="foo2PK"/>
</column>
<column name="version" type="bigint">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
Related
I am trying to run a query similar to
/contacts?$filter=LastModified gt 2022-03-19T12:50:54.219Z
To the following entity:
<EntityType Name="Entity" Abstract="true">
<Key>
<PropertyRef Name="Id" />
</Key>
<Property Name="Id" Type="Edm.Guid" Nullable="false" />
<Property Name="ConcurrencyToken" Type="Edm.Guid" />
<Property Name="LastModified" Type="Edm.DateTimeOffset" />
</EntityType
The query seems to work but it is not filtering anything for me. I have also tried a lot of alternatives but nothing works. Think this is an issue with the server?
This URL
https://logging.apache.org/log4j/log4j-2.0/manual/appenders.html
has this example:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="error">
<Appenders>
<JDBC name="databaseAppender" tableName="dbo.application_log">
<DataSource jndiName="java:/comp/env/jdbc/LoggingDataSource" />
<Column name="eventDate" isEventTimestamp="true" />
<Column name="level" pattern="%level" />
<Column name="logger" pattern="%logger" />
<Column name="message" pattern="%message" />
<Column name="exception" pattern="%ex{full}" />
</JDBC>
</Appenders>
<Loggers>
<Root level="warn">
<AppenderRef ref="databaseAppender"/>
</Root>
</Loggers>
</Configuration>
When I try to wire up to a sqlserver database......
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<JDBC name="SQLServerAppender" tableName="dbo.LogEntry">
<DataSource jndiName="jdbc:sqlserver://MyMachine\\MyInstance:1433;databaseName=LoggingDB;applicationName=myappname;integratedSecurity=true;" />
<Column name="EntryDateUtc" isEventTimestamp="true" />
<Column name="LOGGER" pattern="%C" />
<Column name="Level" pattern="%level" />
<Column name="Message" pattern="%m" />
<Column name="UserName" pattern="%x" />
<Column name="Priority" pattern="%p" />
<Column name="ElapsedMilliseconds" pattern="%r" />
<Column name="ThreadName" pattern="%t" />
<Column name="ThrowableMessage" pattern="%throwable " />
</JDBC>
I get errors like:
ERROR No ConnectionSource provided: connectionSource
ERROR Could not create plugin of type class org.apache.logging.log4j.core.appender.db.jdbc.JdbcAppender for element JDBC org.apache.logging.log4j.core.config.ConfigurationException: Arguments given for element JDBC are invalid: field 'connectionSource' has invalid value 'null'
How do I set up a connection string in the xml-configuration to talk to sqlserver?
Even though it doesn't match the documentation, I tried this:
<Appenders>
<JDBC name="SQLServerAppender" tableName="dbo.LogEntry">
<ConnectionSource jndiName="jdbc:sqlserver
It didn't work of course.
What is the magic syntax sugar?? #help
Thanks.
The value of DataSource jndiName is not a SQL Server connection string. If you want to use a SQL Server connection string then put in Log4J configuration put something like:
<appender name="SQLServer" class="org.apache.log4j.jdbc.JDBCAppender">
<param name="url" value="jdbc:sqlserver://MyMachine\\MyInstance:1433;databaseName=LoggingDB;applicationName=myappname;"/>
<param name="driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<param name="user" value="user_id"/>
<param name="password" value="password"/>
<param name="sql" value="INSERT INTO LOG4J_TABLE VALUES('%x','%d','%C','%p','%m')"/>
<layout class="org.apache.log4j.PatternLayout"></layout>
</appender>
<logger name="log4j.rootLogger" additivity="false">
<level value="DEBUG"/>
<appender-ref ref="SQLServer"/>
</logger>
Which will write to a table that you must have created previously like:
CREATE TABLE LOG4J_TABLE (
User_Id VARCHAR(20) NOT NULL,
Date_Stamp DATETIME NOT NULL,
Logger VARCHAR(100) NOT NULL,
Level VARCHAR(10) NOT NULL,
Message VARCHAR(8000) NOT NULL
)
Note that you canĀ“t use integratedSecurity=true straightforward from Java but must specify the user + password.
I think the problem is that JNDI is not enabled.
This is my configuration log4j2.xml:
<bean id="dataSourceProxy" class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
<constructor-arg ref="dataSource"/>
</bean>
<bean name="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSourceProxy"/>
</bean>
<bean id="jdbcTemplate" class="xx.com.xxxxx.framework.database.xxxxxJDBCTemplate">
<constructor-arg ref="dataSourceProxy"/>
</bean>
<bean id="DBSession" class="xx.com.xxxxx.framework.database.DBConnectionManager" lazy-init="true">
<constructor-arg type="java.lang.String" value="DBSession"/>
<constructor-arg ref="dataSourceProxy"/>
<constructor-arg ref="transactionManager"/>
<property name="template" ref="jdbcTemplate"/>
</bean>
It worked normally before we had upgraded log4j to log4j2. After upgrading, there was an error output from my weblogic console:
ERROR Could not create plugin of type class org.apache.logging.log4j.core.appender.db.jdbc.JdbcAppender for element JDBC org.apache.logging.log4j.core.config.ConfigurationException: Arguments given for element JDBC are invalid: field 'connectionSource' has invalid value 'null'
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.injectFields(PluginBuilder.java:210)
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:121)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1120)
....
According to Apache documentation ,
a Log4j JDBC Appender configured with a DataSource is disabled by default. You may try to add java option -Dlog4j2.enableJndiJdbc=true to use JNDI's java protocol.
When we added set JAVA_OPTIONS=-Dlog4j2.enableJndiJdbc=true into our weblogic, the error was gone.
I hope it is helpful for you.
We did an upgrade from TFS 2013 to 2017.
When running the "Configure Features" wizard I get this error:
[Error] TF400654: Unable to configure Planning Tools. The following element contains an error: TaskBacklog/States. TF400587: This element defines the states for work items that appear on your backlog. Each state must exist in at least one of the work item types belong to category defined in: 'TaskBacklog/States'. The following state does not exist in any of the work item types: Committed, Resolved, Rejected, Reopen, Approved.
here is my categories export for TASK:
<CATEGORY refname="Microsoft.TaskCategory" name="Task Category">
<DEFAULTWORKITEMTYPE name="Task" />
<WORKITEMTYPE name="Bug" />
</CATEGORY>
here is my processconfig export (i do have those states...)
<TaskBacklog category="Microsoft.TaskCategory" pluralName="Tasks" singularName="Task" workItemCountLimit="500">
<AddPanel>
<Fields>
<Field refname="System.Title" />
</Fields>
</AddPanel>
<Columns>
<Column width="50" refname="Microsoft.VSTS.Scheduling.Effort" />
<Column width="400" refname="System.Title" />
<Column width="100" refname="System.State" />
<Column width="100" refname="System.AssignedTo" />
<Column width="50" refname="Microsoft.VSTS.Scheduling.RemainingWork" />
<Column width="50" refname="System.ID" />
</Columns>
<States>
<State type="Proposed" value="New" />
<State type="Proposed" value="Committed" />
<State type="InProgress" value="In Progress" />
<State type="InProgress" value="Resolved" />
<State type="InProgress" value="Rejected" />
<State type="InProgress" value="Reopen" />
<State type="InProgress" value="Approved" />
<State type="Complete" value="Done" />
</States>
</TaskBacklog>
I am clearly missing something but I don't know what... some help?
Thanks
You need to make sure those states exist in either of the work item types defined in your Task category, which are Task and Bug.
The TaskCategory is saying "work items that are or can be considered Tasks should have these states available". If the work items don't have those states, it's a problem.
The solution is to export your Task and Bug work items and look at the available states. If the required states don't exist, add them.
While importing a newly customized Work Item Type Definition into TFS 2017.3, I am receiving the error:
VS403073: Group {GroupName} violates the rule that a group can only
contain a single HTML or WebPage control preceded by label controls.
My question is three-fold:
1) Where are these styling/schema rules documented? I was unable to find any information on this, or any other schema rule, on Microsoft's site here.
2) I am trying to keep several FieldControls and a single HTMLFieldControl grouped together under one heading on the WebForm for organization purposes. Why would there be a rule put in place to prevent this type of organization?
3) Is it possible to, and what would be the consequences of, bypassing this rule and importing the WITD anyway?
Please let me know if any further information/clarification is needed.
Edit:
Psudo code would be something to this effect:
<WebLayout>
...
<Page>
<Section>
<Group Label="Group 1">
<Control type="FieldControl" Label="G1C1" FieldName="X.G1Field1" />
<Control type="FieldControl" Label="G1C2" FieldName="X.G1Field2" />
<Control type="FieldControl" Label="G1C3" FieldName="X.G1Field3" />
<Control type="HTMLFieldControl" Label="G1C4" FieldName="X.G1Field4" />
</Group>
</Section>
</Page>
</WebLayout>
I ran into this as well. I moved the HTMLFieldControl to its own group and that resolved the issue.
Example from Microsoft's documentation
Error:
<Section>
<Group Label="Description:">
<Control Label="Reason For Request:" Type="HtmlFieldControl" FieldName="System.Description" />
<Control Label="Business Case For Request:" Type="HtmlFieldControl" FieldName="MB.BusinessCase" />
</Group>
</Section>
Resolution:
<Section>
<Group Label="Reason for Request">
<Control Label="Reason For Request:" Type="HtmlFieldControl" FieldName="System.Description" />
</Group>
<Group Label="Business Case">
<Control Label="Business Case For Request" Type="HtmlFieldControl" FieldName="Custom.BusinessCase" />
</Group>
</Section>
Documentation can be found HERE
I am using TFS 2015.4, Agile template. I want to alter my workflow states to include Analysis as an option. I have modified the User Story WIT and ProcessConfiguration, Workflow nodes and valid states, etc. I reuploaded the template successfully and set the new template to default. All is well with regard to setting user story states. However, on the Kanban board, I want to add a tab that maps to the newly added Analysis. This new option is not showing up. Is there something else I'm missing?
You need to modify the process configuration to map new workflow states to metastates. Try the steps below:
Export ProcessConfiguration file:
witadmin exportprocessconfig /collection:http://tfsserver:8080/tfs/teamprojectcollection /p:teamproject /f:C:\Users\username\Desktop\ProcessConfiguration.xml
Modify the XML definition file. In your case, you should modify RequirementBacklog by adding your Analysis state:
<RequirementBacklog category="Microsoft.RequirementCategory" parent="Microsoft.FeatureCategory" pluralName="Stories" singularName="User Story" workItemCountLimit="1000">
<AddPanel>
<Fields>
<Field refname="System.Title" />
</Fields>
</AddPanel>
<Columns>
<Column width="100" refname="System.WorkItemType" />
<Column width="400" refname="System.Title" />
<Column width="100" refname="System.State" />
<Column width="50" refname="Microsoft.VSTS.Scheduling.StoryPoints" />
<Column width="100" refname="Microsoft.VSTS.Common.ValueArea" />
<Column width="200" refname="System.IterationPath" />
<Column width="200" refname="System.Tags" />
</Columns>
<States>
<State type="Proposed" value="New" />
<State type="InProgress" value="Active" />
<State type="InProgress" value="Resolved" />
<State type="InProgress" value="Analysis" />
<State type="Complete" value="Closed" />
</States>
</RequirementBacklog>
Import ProcessConfiguration file:
witadmin importprocessconfig /collection:http://tfsserver:8080/tfs/teamprojectcollection /p:teamproject /f:C:\Users\username\Desktop\ProcessConfiguration.xml
In this way, you can add a Column and choose Analysis state, it's similar to the screenshot below: