The published message could not be routed because no subscribers were found - biztalk

I have the following error when running my BizTalk package in the server:
The published message could not be routed because no subscribers were found
Package Description:
Import a CSV flat file into SQL Server using a stored procedure.
Breakdown:
Create Table Code:
CREATE TABLE [dbo].[Accounts](
[Id] [int] IDENTITY(1,1) NOT NULL,
[AccountName] [nvarchar](150) NULL,
[ServiceAddress] [nvarchar](150) NULL,
[AccountNumber] [nvarchar](50) NULL,
CONSTRAINT [PK_Accounts] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
Create Stored Procedure Code:
CREATE PROCEDURE [dbo].[InsertAccount]
#AccountName AS NVARCHAR(150) ,
#ServiceAddress AS NVARCHAR(150) ,
#AccountNumber AS NVARCHAR(50)
AS
INSERT INTO dbo.accounts
( AccountName ,
ServiceAddress ,
AccountNumber
)
SELECT #AccountName ,
#ServiceAddress ,
#AccountNumber
Flat File: Named it sample.csv
Account Name,Service Address,Account Number
JOE BLOW,ADDRESS X CITYX IL 61999,932F623Y52
I am using WCF to connect to the database
I am using a stored procedure
I created a schema for the flat file
Receive Port Configuration
Send port configuration
I created a message to receive the flat file
I created a message to send the XML to SQL
I dropped the Receive component and assigned the Flat File Message
I dropped the Send component and assigned the Stored Proc Message
I dropped a receive response component for the stored proc
Then I dropped a Construct Message component to initialize the XML document and create the map.
I deployed the package to the server, without deploying to the GAC,
Then I registered the component in the GAC manually.
In the server:
I set all the receive and send ports:
Send port
The I configure the application
I started the application:
Receive Location Enable
Send Port Started
I completely stop and restarted the application.
I drop the file, the file disappears and I get the error
I get the following errors
The Messaging engine failed to process a message submitted by adapter:FILE Source URL:C:\Biztalk Test\Sales\SampleFile*.csv. Details:The published message could not be routed because no subscribers were found. This error occurs if the subscribing orchestration or send port has not been enlisted, or if some of the message properties necessary for subscription evaluation have not been promoted. Please use the Biztalk Administration console to troubleshoot this failure.
A message received by adapter "FILE" on receive location "ServerReceiveLocation" with URI "C:\Biztalk Test\Sales\SampleFile*.csv" is suspended.
Error details: The published message could not be routed because no subscribers were found. This error occurs if the subscribing orchestration or send port has not been enlisted, or if some of the message properties necessary for subscription evaluation have not been promoted. Please use the Biztalk Administration console to troubleshoot this failure.

Basically the subscription on your Orchestrations does not match the context properties on the received message.
Always when you get that error what you need to do is look at the Suspended message and see what it looks like and compare it's context properties with the Subscriptions in BizTalk Administrator.
In you case the issue appears to be that you don't have a Receive Pipeline that has a Flat File Dissasembler with the flat file scheme specified on it which would convert it to XML and publish it with Message Type context property with the schema name
So what is happening is that it it publishing the raw flat file to the message box without a message type, and Message Type is what the Orchestration is subscribing too, and you have no specific subscription rules to are listening for messages from that port that can then process the raw message. So it does not know what to do with the message and suspends it with the above error.

You state:
"I deployed the package to the server, without deploying to the GAC, Then I registered the component in the GAC manually."
However, this indicates an incorrect deployment procedure for BizTalk Server. You should not have to GAC manually. Also, you do not indicate anywhere that you registered (Import) the components with BizTalk Server.
Without importing, none of your artifacts are visible to the runtime so there is no schema to be found.
If you are running locally (and you should be at this point) just Deploy from Visual Studio and everything will be registered and GAG'd automatically.
If you are deploying to a remote server (which cannot be you DEV/TEST BizTalk Instance), then you must either export a .msi from you build machine or create a deployment package with BizTalk Deployment Framework.

Related

APEX_MAIL.SEND function not working though its not giving any error

Have to send email from oracle apex using APEX_MAIL.SEND() method.
I am using the code:
BEGIN
apex_mail.send(p_to => 'tanmoydawn#gmail.com'/*l_to_addr*/,
p_from => 'tanmoydawn#gmail.com'/*l_from_addr*/,
p_bcc => l_bcc_addr,
p_subj => l_mail_sub,
p_body => 'Service Request ' || :mail_body ||
'Note:- This is a system generated Email. Please DO NOT REPLY to it.');
apex_mail.push_queue;
EXCEPTION
when others then
INSERT INTO send_mail_error_test VALUES ('Send_mail',systimestamp,:service_request_id||'-err:'||seq_service_req_error_id.NEXTVAL);
COMMIT;
END;
*** all the variables contain correct values
Working with a database and that database has ACL(access control list) access
In apex administrative services, Configured instance settings for email as hostname, port , email provisioning enabled.
UTL_SMTP package is installed
From the same process, at the same point of control flow a code to send mail using utl_Smtp is working fine, though that apex_mail.send() is not working.
That apex_mail.send() is not giving any error or exception, but i am not recieving email from it.
Have one confusion, got some solutions like that, 'APEX_040200' should have been added to ACL. But the database I am using and implementing the code on it, say 'apex_user' is already added to ACL. Even now do I have to add 'APEX_040200' or 'APEX_050200' to ACL?
can anyone help me out and give me a fruitful solution? I am using apex 5.0.2.00.07.
As can be found in the apex_mail api documentation:
Before you can send email from an Application Builder application, you
must:
Log in to Oracle Application Express Administration Services and
configure the email settings on the Instance Settings page. See
"Configuring Email" in Oracle Application Express Administration Guide.
If you are running Oracle Application Express with Oracle Database 11g
release 1 (11.1), you must enable outbound mail. In Oracle Database
11g release 1 (11.1), the ability to interact with network services is
disabled by default. See "Enabling Network Services in Oracle Database
11g" in Oracle Application Express Application Builder User's Guide.
You specified instance settings are ok. Your "database has ALC access" doesn't mean anything. Do you mean you have a database which uses network ACLs? (11g or higher)
That same documentation links to "the Enabling Network Services in Oracle Database 11g or Later" documentation
This document does not leave you guessing:
By default, the ability to interact with network services is disabled
in Oracle Database 11g Release 1 or 2 or later. Therefore, if you are
running Oracle Application Express with Oracle Database 11g Release 1
or 2 or later, you must use the new DBMS_NETWORK_ACL_ADMIN package to
grant connect privileges to any host for the APEX_050000 database
user. Failing to grant these privileges results in issues with:...
If you have an older version of apex, eg 4.2, the user to grant to is another one, and can be found in the documentation. Alternatively, you can just find out
by for example querying the ALL_USERS view and find the APEX_###### users, pick the one with the highest version number:
select *
from all_users
where username like 'APEX%'
order by username;
in our case, it was a job, ORACLE_APEX_MAIL_QUEUE, which had status 'RUNNING' for 8 days. Apparently, it held some kind of lock on the queue or mailprocess
We killed the job and that was it.
(see dba_scheduler_jobs for the job & status)
I guess you should do as they say here, but with the proper APEX version, as you guessed... try various, with APEX_050000 (rather than APEX_050200 that would imply APEX 5.2 - not released yet):
DECLARE
ACL_PATH VARCHAR2(4000);
BEGIN
-- Look for the ACL currently assigned to '*' and give APEX_050000
-- the "connect" privilege if APEX_050000
-- does not have the privilege yet.
SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE (ACL_PATH,'APEX_050000','connect') IS NULL THEN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,'APEX_050000', TRUE, 'connect');
END IF;
EXCEPTION
-- When no ACL has been assigned to '*'.
WHEN NO_DATA_FOUND THEN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml',
'ACL that lets power users to connect to everywhere',
'APEX_050000', TRUE, 'connect');
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
END;
/
COMMIT;
I had this same problem. Could send email using utl_smtp, but could not with apex_mail.send. Turned out I had an extra space in the smtp server url.
Email server for APEX is setup in the APEX Instance workspace. Check "Manage Instance' > 'Instance Settings' > 'Email' > 'SMTP Host Address'
Also try checking the Logs in 'Monitor Activity' in the Instance Workspace.

MSDTC between Windows 7 (32bit) and Windows Server 2003

I am currently attempting to create a test environment for a website which is using a mixture of classic ASP and ASP.NET. (The original machines are running old versions of Windows Server, so the configuration is not to easy to mimic)
Unfortunately, I am having problems interacting from Windows 7 to the Server 2003.
The error I am getting from my test application (which simply fires a stored procedure) is as follows:
New transaction cannot enlist in the specified transaction coordinator.
After reading various articles online, I believe I have set-up the COM+ side of things on the Windows 7 machine correctly. If I change my connection string to target the old server, it succeeds.
I then ran MSDTC Simulation V1.9 and the error I recieved was as follows:
DTCping log file: C:\Users\whelans\Desktop\dtping\[servername].log
RPC server is ready
Please Start Partner DTCping before pinging
++++++++++++Validating Remote Computer Name++++++++++++
Please refer to following log file for details:
C:\Users\whelans\Desktop\dtping\[servername].log
Invoking RPC method on [servername]
Problem:fail to invoke remote RPC method
Error(0x6D9) at dtcping.cpp #303
-->RPC pinging exception
-->1753(There are no more endpoints available from the endpoint mapper.)
RPC test failed
I then tried changing my connection string password and it fails due to invalid login, so I believe the COM is reaching the server's database. The user also has full permissions on the database.
I notice in the COM+ Window, that the component in use is spinning as if communicating with the server, however, it seems the server is rejection the connection.
Any ideas?
EDIT: I have now also ran DTCTester, as i read that DTCPing will always fail on Windows 7, here was the result:
C:\Users\whelans\Desktop\dtping>dtctester.exe TestDatabase username password
Executed: dtctester.exe
DSN: TestDatabase
User Name: username
Password: password
tablename= #dtc9033
Creating Temp Table for Testing: #dtc9033
Warning: No Columns in Result Set From Executing: 'create table #dtc9033 (ival i
nt)'
Initializing DTC
Beginning DTC Transaction
Enlisting Connection in Transaction
Executing SQL Statement in DTC Transaction
Inserting into Temp...insert into #dtc9033 values (1)
Warning: No Columns in Result Set From Executing: 'insert into #dtc9033 values (
1) '
Verifying Insert into Temp...select * from #dtc9033 (should be 1): 1
Press enter to commit transaction.
Commiting DTC Transaction
Releasing DTC Interface Pointers
Successfully Released pTransaction Pointer.
Disconnecting from Database and Cleaning up Handles

Session management in ASP.NET with SQL Server 2005

I am getting the following error while executing InstallSqlSate.sql file
Msg 14261, Level 16, State 1, Procedure sp_add_category, Line 32
The specified #name ('[Uncategorized (Local)]') already exists.
SQLServerAgent is not currently running so it cannot be notified of
this action.
I want details about what is that error and how to fix it?
InstallState.sql is not intended to be run directly. Use aspnet_regsql.exe instead.
I had the same issue in SQL2000. Might work for 2005.
If you receive this error message, first make sure that the SQL Server
Agent service is running. To do this, follow these steps:
Click Start, click Run, type Services.msc, and then
click OK.
In the Services window, locate the SQL Server Agent
service.
Make sure that the value of the Status column of the SQL
Server Agent service is Running.
If the SQL Server Agent service is running, this problem occurs
because the SQL Server Agent service cannot interpret the dot mark (.)
that represents the local computer in the ObjectName registry entry
under the following registry subkey. For a default instance, the
registry subkey is as follows:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLSERVER\ For
a named instance, the registry subkey is as follows:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQL$InstanceName\
Note InstanceName is a placeholder for the instance of SQL Server.
Mine was not running, it was "disabled". If this is the case for you: Right click properties, change it from disabled to Automatic. Press OK. Then right click the SQL Server Agent service and click "Start". It should change to have the "Running" status.
from: https://support.microsoft.com/en-us/kb/911841

SQL Server service broker reporting as off when I have written a query to turn it on

I have made a small ASP.NET website. It uses sqlcachedependency
The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported. Please enable the Service Broker for this database if you wish to use notifications.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported. Please enable the Service Broker for this database if you wish to use notifications.
Source Error:
Line 12: System.Data.SqlClient.SqlDependency.Start(connString);
This is the erroneous line in my global.asax.
However, in sql server (2005), I enabled service broker like so (I connect and run the SQL Server service when I debug my site):
ALTER DATABASE mynewdatabase SET ENABLE_BROKER with rollback immediate
And this was successful.
What am I missing? I am trying to use sql caching dependency and have followed all procedures.
Thanks
I faced the same problem on one of our servers. this solved the issue (replace DBNAME with database name)
ALTER DATABASE DBNAME SET NEW_BROKER WITH ROLLBACK IMMEDIATE;
ALTER DATABASE DBNAME SET ENABLE_BROKER;
Finally, check whether you get 1 for is_broker_enabled flag:
SELECT is_broker_enabled FROM sys.databases WHERE name = 'DBNAME'
Do you use a normal SQL instance, including Express, or are you using User Instances? ie. your connection string uses "AttachDbFilename" option? On user instances because the MDF is attached each time the instance is created, the Service Broker gets disabled each time because attach and restore operations always disable the broker in the database.
Ditch the "with rollback immediate" and try running the statement again.
Does it hang? If so kill any other sessions that are in the database and are blocking the session trying to alter the database.
Here's the script I mentioned in my comment.
use master
go
declare #parent int
declare #cmd varchar(100)
set #parent = 53
while exists (select * from sys.sysprocesses where spid = #parent and blocked <> 0)
begin
select #cmd = 'kill ' + cast(blocked as varchar(10))
from sys.sysprocesses
where spid = #parent
print #cmd
exec (#cmd)
end
You can change it by
Data Base - > Properties -> Options -> Service Broker

What does error ORA-12571 (TNS:packet writer failure) mean in a Web Service?

Background: I'm calling a Web Service written in ASP.NET that queries an Oracle database. I know the Web Service itself works, because I've used it before other applications. So I have a web application in Visual Studio that I've been switching back and forth to point from a 'DEV' web service to a production configured version of the same web service for testing. Pointing to the 'DEV' configured web service is no problem, but calling the production version I always get an exception calling the service:
SoapException was unhandled by user code
Server was unable to process request. ---> could not execute query
[ SELECT this_.FIELD1 as FIELD1_18_0_, this_.FIELD2 as FIELD12_18_0_ FROM ABC.TABLE_A this_ WHERE this_.FIELD1 like :p0 ORDER BY this_.FIELD1 asc ]
Positional parameters: #0>00073%
[SQL: SELECT this_.FIELD1 as FIELD1_18_0_, this_.FIELD2 as FIELD12_18_0_ FROM ABC.TABLE_A this_ WHERE this_.FIELD1 like :p0 ORDER BY this_.FIELD1] ---> ORA-12571: TNS:packet writer failure
I ran the SQL queries against the appropriate database (cut and pasted straight out of the exception message) and the query came back with the expected data. I've tried updating and re-adding the Web Service reference both as a "Service Reference" (.NET 3.0+ way) and as a "Web Reference" (Older .NET way), and both give the same error.
Question: So, what does a "ORA-12571: TNS:packet writer failure" error mean in the context of a Web Service? Looking up the Oracle Error number gives some very vague possible causes such as "loose cable connection" or "IP address conflict". I'm fairly certain it's neither of these, since a different application is currently successfully using that Web Service. Possibly some kind of configuration error, or maybe something more subtle? Anyone else seen this vexing Oracle error number being attributed to something web-service related?
Your call is going from the ws client to the ws server to the oracle database.
Your error is an ORA error, which is generated by the database. So your problem is probably between the ws server and the database.
When you ran "the SQL queries against the appropriate database", did you do it from the web server? If not could you try that. Make sure that you are using the same connection configuration.
EDIT
As per the comment below, the real problem was a driver mismatch.
I would suggest re-examining your assumptions more carefully, as this is clearly an error in the web-service dialogue with the db and should be completely independent of the w/s caller.
If the w/s call is generating this specific exception, it should be doing so for all other invocations, so your 'other application' that's using the web service successfully is simply not executing the same code or there are outside factors at play.
Either way, it's unrelated to how the service is registered or invoked.

Resources